1

I have a programme that suddenly started to not terminate (I was not updating the programme, but my system & the kernel, I do not remember what was causing the effect. Recompiling the programme did not change the non-terminating behaviour). Under strace, however, it does terminate.

How can such things be traced down?

Concrete example:

Here is the concrete example where I encountered this )(for me) strange thing:

It is regarding WWWOFFLE, SVN revision 2250 (latest at the time of investigating/ writing), compiled on Arch/ Artix Linux according to the AUR-package.

Since some time (no update of WWWOFFLE, but updates of system and kernel, and after appearance of this problem recompilation of WWWOFFLE without a noticable change) putting wwwoffle in online- or offline-mode hangs quite often indefinitely. If I want to trace it down with strace, it does not hang. If I wrap it in a shell-script it hangs with strace, but not with strace -f/ strace -ff.

Details:

  1. start wwwoffled server:

    wwwoffled -c /etc/wwwoffle/wwwoffle.conf -f -d 6
    
  2. put WWWOFFLE in online mode (switching from offline to online mode usually succeeds):

    wwwoffle -c /etc/wwwoffle/wwwoffle.conf -online
    

    Terminal output:

    WWWOFFLE Now Online
    

    and return to calling shell.

  3. put WWWOFFLE in offline mode:

    wwwoffle -c /etc/wwwoffle/wwwoffle.conf -offline
    

    Terminal output:

    WWWOFFLE Now Offline
    

    and no termination.

    The log of wwwoffled accoring to number 1 says correctly Important: WWWOFFLE Offline. Aborting wwwoffle -c /etc/wwwoffle/wwwoffle.conf -offline with <STRG>+<c> and trying again now prints out correctly WWWOFFLE Already Offline, but also does not terminate.

  4. switching to online mode while WWWOFFLE is already online does also not terminate:

    wwwoffle -c /etc/wwwoffle/wwwoffle.conf -online
    

    while WWWOFFLE is already online does correctly print out

    WWWOFFLE Already Online
    

    but does not terminate.

  5. strace:

    strace wwwoffle -c /etc/wwwoffle/wwwoffle.conf -offline
    

    and

    strace wwwoffle -c /etc/wwwoffle/wwwoffle.conf -online
    

    does seem to always terminate when wwwoffled is started as in 1.

  6. If I put wwwoffle -c /etc/wwwoffle/wwwoffle.conf -offline andwwwoffle -c /etc/wwwoffle/wwwoffle.conf -online in a bash script:

    #!/bin/bash
    
    wwwoffle -c /etc/wwwoffle/wwwoffle.conf -offline
    

    and execute it, then also with strace it does not terminate:

    strace ./wwwoffle-off.sh
    

    prints out as the last lines

    [...]
    access("/usr/bin/wwwoffle", R_OK)       = 0
    rt_sigprocmask(SIG_BLOCK, [INT CHLD], [], 8) = 0
    clone(child_stack=NULL, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0x7f36a75e1e50) = 6426
    rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
    rt_sigprocmask(SIG_BLOCK, [CHLD], [], 8) = 0
    rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
    rt_sigprocmask(SIG_BLOCK, [CHLD], [], 8) = 0
    rt_sigaction(SIGINT, {sa_handler=0x5573f5295be0, sa_mask=[], sa_flags=SA_RESTORER, sa_restorer=0x7f36a76898b0}, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=SA_RESTORER, sa_restorer=0x7f36a76898b0}, 8) = 0
    wait4(-1, WWWOFFLE Already Offline
    

    and waiting there forever. (Note that the WWWOFFLE Already Offline is the output from wwwoffle and is written to stdout, the last output from strace, written to stderr, is wait4(-1,)

  7. With strace -f or strace -ff (which traces also forked child threads), it terminates again.

I see it only with WWWOFFLE, but it might not be a WWWOFFLE-problem. I have no idea how to track it down. How can those things be tracked down, what might cause such behaviour?

0

This is generally a symptom of something going wrong within the software in some way, no general answer can be given.

So it is really specific to the bugs in the concrete software which shows such behaviour.

In the WWWOFFLE-case, listening to the network communication between wwwoffle and wwwoffled does reveal some information.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.