#133 Plugin causes Firefox to hang on SIGCHLD

CVS
closed-fixed
Kevin DeKorte
Plugin (92)
5
2007-06-20
2007-05-27
n0dalus
No

When mplayerplug-in sets up a new child process, it calls:

signal(SIGCHLD, sig_child);

Where sig_child is:
static void sig_child(int signo)
{
wait(NULL);
}

This causes Firefox to hang if there are child processes belonging to other extensions or plugins (such as java, which runs java_vm as a child).

Please only wait for processes that mplayerplug-in started. Even better, don't override the global SIGCHLD handler for Firefox, since that's bound to step on other extensions/plugins/future features.

Discussion

  • Kevin DeKorte
    Kevin DeKorte
    2007-05-28

    Logged In: YES
    user_id=685413
    Originator: NO

    Can you submit a test case of this. This code has been unchanged for nearly 2 years and this is the first report I've seen of this problem.

    Thanks

     
  • n0dalus
    n0dalus
    2007-05-28

    Logged In: YES
    user_id=1222981
    Originator: YES

    I don't really know what you want me to put in a test case. I will try to outline how one might reproduce the bug though.

    1) Install Sun Java plugin
    2) Go to page where Java gets initialized (like http://www.w3.org/People/mimasa/test/object/java/clock or something - just got from google "java applet test")
    3) Go to page where mplayerplug-in gets initialized, a video site or something
    4) Open a downloaded file using the Downloads window in Firefox, using an application that forks into the background (like evince or gvim). This makes firefox receive a SIGCHLD when the process does this. Alternatively, just open a terminal and send firefox-bin a SIGCHLD (killall -s SIGCHLD firefox-bin).

    When it hangs, this is what a stacktrace of firefox shows:
    (gdb) bt
    #0 0x007d2402 in ?? ()
    #1 0x0036cc5c in wait () from /lib/libpthread.so.0
    #2 0x0579885e in sig_child (signo=17) at Source/plugin-threads.cpp:17
    #3 <signal handler called>

    Anyway, the code is clearly going to cause bugs, so even if you can't reproduce my bug it should still be fixed. Overriding signal handling for the whole application, and waiting for children that have nothing to do with mplayerplug-in is just asking for trouble.

     
  • Kevin DeKorte
    Kevin DeKorte
    2007-06-05

    • status: open --> pending-fixed
     
  • Kevin DeKorte
    Kevin DeKorte
    2007-06-05

    Logged In: YES
    user_id=685413
    Originator: NO

    should be fixed in CVS.

     
  • Logged In: YES
    user_id=1312539
    Originator: NO

    This Tracker item was closed automatically by the system. It was
    previously set to a Pending status, and the original submitter
    did not respond within 14 days (the time period specified by
    the administrator of this Tracker).

     
    • status: pending-fixed --> closed-fixed