Diagnosing issues with stalling desktop application (or a whole desktop environment) is difficult these days as the application often requires multiple processes interconnected with sockets, pipes, futexes, etc. to work and often it is not clear which process is the one responsible for blocking the whole ecosystem. The idea of this project is to write a tool that gathers information about processes in the system and for each process that is sleeping display the resource (file, socket, futex) it is waiting on as well as the process that is likely responsible for unblocking (feeding pipe, sending data to socket, unlock futex, ...). Once the information is gathered, we can also plot it for graphical displaying with tools like graphviz.

Looking for hackers with the skills:

Nothing? Add some keywords!

This project is part of:

Hack Week 19


Comments

  • okurz
    8 months ago by okurz | Reply

    I would be very interested in your findings. This could be something we could include in openQA tests for self-diagnosing.

    • jankara
      8 months ago by jankara | Reply

      It seems to be working out nicely. I'll add here my hackweek summary with details...

  • jankara
    8 months ago by jankara | Reply

    So I was working on this and significant part of the functionality is implemented. What's working: * Identification of processes blocked on pipes and processes that could unblock the blocked process (by writing to / reading from the pipe) * Identification of processes blocked on sockets, finding matching peer socket (in case of AFUNIX sockets), and processes having access to the peer socket * Identification of other processes blocked on file descriptor read/write (in the remaining cases we don't know how to determine process that can unblock - there isn't necessarily one) * Identification of processes blocked on futex and of other processes having access to the futex (and not blocked on it). In case futex uses PILOCK/UNLOCK operations, we can exactly identify futex holder. * Identification of processes waiting on other process exit/signal (waitpid(2) and friends) and which tasks they wait for * Identification of processes in nanosleep(2) and similar sleeping syscalls * only x86-64 is supported (due to ptrace() arch specific details)

    What doesn't work yet: * Handling of poll(), epoll(), select() * Generate .dot file for plotting of results

    Neither of this should be too difficult but it will need a few more hours...

Similar Projects

This project is one of its kind!