Firefox hangs when launched in NX session if NX client "multimedia" support is enabled

Asked by MarcRandolph on 2010-01-31

(Completely revising since I've figured out the ultimate source of the problem)

As described in http://ubuntuforums.org/showthread.php?p=8772736, a number of users have found that if multimedia support is enabled within NX, Firefox refuses to launch. This might be ok if Firefox said why it isn't launch, but it provides _zero_ feedback as to what the problem might be... it simply hangs with no output at all.

=========================
strace:

<.... page and pages of stuff before this.... >

open("/usr/lib/firefox-3.6/firefox", O_RDONLY) = 3
fcntl64(3, F_DUPFD, 10) = 10
close(3) = 0
fcntl64(10, F_SETFD, FD_CLOEXEC) = 0
rt_sigaction(SIGINT, NULL, {SIG_DFL, [], 0}, 8) = 0
rt_sigaction(SIGINT, {0x804f5fb, ~[RTMIN RT_1], 0}, NULL, 8) = 0
rt_sigaction(SIGQUIT, NULL, {SIG_DFL, [], 0}, 8) = 0
rt_sigaction(SIGQUIT, {SIG_DFL, ~[RTMIN RT_1], 0}, NULL, 8) = 0
rt_sigaction(SIGTERM, NULL, {SIG_DFL, [], 0}, 8) = 0
rt_sigaction(SIGTERM, {SIG_DFL, ~[RTMIN RT_1], 0}, NULL, 8) = 0
read(10, "#!/bin/sh\n#\n# ***** BEGIN LICENS"..., 8192) = 3931
pipe([3, 4]) = 0
clone(child_stack=0, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0xb7779938) = 16298
close(4) = 0
read(3, "/usr/lib/firefox-3.6\n", 128) = 21
--- SIGCHLD (Child exited) @ 0 (0) ---
read(3, "", 128) = 0
close(3) = 0
wait4(-1, [{WIFEXITED(s) && WEXITSTATUS(s) == 0}], 0, NULL) = 16298
pipe([3, 4]) = 0
clone(child_stack=0, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0xb7779938) = 16299
--- SIGCHLD (Child exited) @ 0 (0) ---
close(4) = 0
read(3, "firefox\n", 128) = 8
read(3, "", 128) = 0
close(3) = 0
wait4(-1, [{WIFEXITED(s) && WEXITSTATUS(s) == 0}], 0, NULL) = 16299
stat64("/usr/lib/firefox-3.6/run-mozilla.sh", {st_mode=S_IFREG|0755, st_size=10469, ...}) = 0
geteuid32() = 1001
getgid32() = 1000
getegid32() = 1000
getgroups32(0, NULL) = 16
getgroups32(16, [4, 20, 21, 24, 25, 26, 29, 30, 46, 104, 106, 110, 120, 128, 1000, 1001]) = 16
clone(child_stack=0, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0xb7779938) = 16300
wait4(-1,

where it waits forever until I hit <ctrl-c>
^C <unfinished ...>

=========================
gdb stack trace

Reading symbols from /usr/lib/firefox-3.6/firefox-bin...Reading symbols from /usr/lib/debug/usr/lib/firefox-3.6/firefox-bin...done.
(no debugging symbols found)...done.
(gdb) run
Starting program: /usr/lib/firefox-3.6/firefox-bin
[Thread debugging using libthread_db enabled]

....... I hit <ctrl-c> here after waiting a long time....
Program received signal SIGINT, Interrupt.
0x00363422 in __kernel_vsyscall ()
(gdb) bt full
#0 0x00363422 in __kernel_vsyscall ()
No symbol table info available.
#1 0x005cc829 in __lll_lock_wait ()
    at ../nptl/sysdeps/unix/sysv/linux/i386/i686/../i486/lowlevellock.S:142
No locals.
#2 0x005c7f59 in _L_lock_966 () from /lib/tls/i686/cmov/libpthread.so.0
No locals.
#3 0x005c7ec6 in __pthread_mutex_lock (mutex=0x682014)
    at pthread_mutex_lock.c:101
        ignore3 = 0
        ignore1 = -512
        ignore2 = 128
        max_cnt = 6823956
        __PRETTY_FUNCTION__ = "__pthread_mutex_lock"
        type = <value optimized out>
#4 0x0067ac36 in malloc_mutex_lock () at jemalloc.c:1368
No locals.
#5 malloc_init_hard () at jemalloc.c:5202
        i = 0
        buf = "\000\b\000\000\000\340)y\266\020\000\000\000\214\361\377\277>\177\"\000\364)y\266\340)y\266\020\000\000\000\000\000\000\000\060\270{\266\340\272{\266\260\022\262\266\000\000\000\000@\311\377\277\346\224\"\000\\\361\377\277", '\000' <repeats 12 times>, "\177\361\377\277!\006#\000t\361\377\277\u0205#", '\000' <repeats 17 times>"\364, \177#\000\320\310\377\277\004\000\000\000\270\310\377\277E\a#\000\b\000\000\000\270)y\266\020\000\000\000\214\361\377\277>\177\"\000\314)y\266\270)y\266\020\000\000\000\000\000\000\000P\u0348\266\250*\u0776\260\022\262\266\000\000\000\000\300\311\377\277\346\224\"\000\\\361\377\277", '\000' <repeats 12 times>, "\177\361\377\277x\361\377\277t\361\377\277!\006#", '\000' <repeats 17 times>"\364, \177#\000P\213\"\000\364\177#\000`\311\377\277\004\000\000\000@\311\377\277E\a#\000\b\000\000\000\220)y\266\020\000\000\000\214\361\377\277>\177\"\000\244)y\266\220)y\266\020\000\000\000\000\000\000\000\000\000\000\001\000\000\000\000\060\006!\267\000\200\376\267\260\022\262"...
        opts = 0x237ff4 ",\277\001"
        result = <value optimized out>
        linklen = <value optimized out>
#6 0x0067d7b5 in malloc_init (num=1, size=20) at jemalloc.c:5181
No locals.
#7 calloc (num=1, size=20) at jemalloc.c:5896
        ret = <value optimized out>
        num_size = <value optimized out>
#8 0x00505106 in _dlerror_run (operate=0xfffffe00, args=0xbfffdce0)
    at dlerror.c:142
        result = 0x0
#9 0x00504d4c in __dlsym (handle=0xffffffff, name=0xb66978 "open")
    at dlsym.c:71
        args = {handle = 0xffffffff, name = 0xb66978 "open", who = 0xb666fc,
          sym = 0x1}
        result = <value optimized out>
#10 0x00b666fc in open (pathname=0x67f814 "/proc/cpuinfo", flags=0)
    at esddsp.c:225
        args = <value optimized out>
        mode = <value optimized out>
        func = 0
#11 0x0067ac59 in open () at /usr/include/bits/fcntl2.h:54
No locals.
#12 malloc_ncpus () at jemalloc.c:4946
        fd = -1073753472
        column = <value optimized out>
        buf = "P\213\"\000\300G#\000\064\356\377\277\000\000\000\000\364\177#\000P\213\"\000\214\361\377\277\222~\"\000\001\000\000\000\244\202#\000\220\354\377\277\364\177#\000\001\000\000\000\260\022\262\266\260\355\377\277P\213\"\000\\\361\377\277\000\000\000\000\364\177#\000P\213\"\000\001\000\000\000\000\020\262\266\300\355\377\277\\\361\377\277\000\000\000\000\364\177#\000P\213\"\000\214\361\377\277\001\000\000\000P-\u0776\340\355\377\277\000\000\000\000\364\177#\000P\213\"\000\214\361\377\277\222~\"\000\001\000\000\000\250*\u0776\000\356\377\277\364\177#\000\001\000\000\000\370'\u0776 \356\377\277P\213\"\000\\\361\377\277\000\000\000\000\364\177#\000P\213\"\000\001\000\000\000X%\u07760\356\377\277\\\361\377\277\000\000\000\000\364\177#\000\324\065\236\266\020ii\r\254\356\377\277\200J\"\000\206\u77b6\355\063\\\000\364\177#\000P\213\"\000\000\000\000\000\260gw\266\002\000\377\277\000\242\"\000\305\063\\\000d\022\262\266\364\177#\000|\u7776\036\000\000\000\034\357\377\277\245M\"\000\000\000\000\000\364\177#\000P\213\"\000\001\000\000\000\060\271z\000\244\375\235\266(E#\000\350"...
        i = <value optimized out>
        nread = <value optimized out>
#13 malloc_init_hard () at jemalloc.c:5234
        i = 3221221772
        buf = "\000\001\000\000\000\060\270{\266p\335\377\277\364\177#\000\001\000\000\000h\265{\266\220\335\377\277P\213\"\000\\\361\377\277\000\000\000\000\364\177#\000P\213\"\000\001\000\000\000\260\262{\266\240\335\377\277\\\361\377\277\000\000\000\000\364\177#\000P\213\"\000\214\361\377\277\001\000\000\000\000\260{\266\300\335\377\277\000\000\000\000\364\177#\000P\213\"\000\214\361\377\277\222~\"\000\001\000\000\000hk\203\266\340\335\377\277\364\177#\000\001\000\000\000\250h\203\266\000\336\377\277P\213\"\000\\\361\377\277\000\000\000\000\364\177#\000P\213\"\000\001\000\000\000\360e\203\266\020\336\377\277\\\361\377\277P\213\"\000\000\337\377\277\344\336\377\277\f\336\377\277\360e\203\266\300\342\344\266x\345\u4da8h\203\266hk\203\266\000\260{\266\000\200\376\267\260\262{\266h\265{\266\060\270{\266\340\272{\266X)\226\266X%\u0776P\u0348\266\250*\u0776\260\022\262\266\000\000\000\000\\\361\377\277\000\000\000\000\242\213\"\001\000\000\000\000\177\361\377\277!\006#\000t\361\377\277\u0205#\000\000\000\000\000\242\213\"\001\000\000\000\000\177\361\377\277\364\177#\000\000\337\377\277\006\000\000\000\344\336\377\277E\a#\000\b\000\000\000\230e\203\266\030\000\000\000\214\361\377\277>\177\"\000\264e\203\266\230e\203\266\030\000\000\000\177\361\377\277\364\177"...
        opts = 0x0
        result = <value optimized out>
        linklen = <value optimized out>
#14 0x0067d8c5 in malloc_init (size=352) at jemalloc.c:5181
No locals.
#15 malloc (size=352) at jemalloc.c:5772
        ret = <value optimized out>
#16 0xb6a37ddf in __fopen_internal (filename=0x5b521a "/proc/filesystems",
    mode=0x5b510f "r", is32=0) at iofopen.c:76
No locals.
#17 0xb6a3a42c in _IO_fopen64 (filename=0x5b521a "/proc/filesystems",
    mode=0x5b510f "r") at iofopen64.c:39
No locals.
#18 0x005ab6f0 in ?? () from /lib/libselinux.so.1
No symbol table info available.
#19 0x005b4bfd in ?? () from /lib/libselinux.so.1
No symbol table info available.
#20 0x005a30c8 in _init () from /lib/libselinux.so.1
No symbol table info available.
#21 0x002298bc in call_init (l=<value optimized out>,
    argc=<value optimized out>, argv=0xbffff3a4, env=0xbffff3ac)
    at dl-init.c:70
        init_array = <value optimized out>
#22 0x00229a21 in _dl_init (main_map=0x238670, argc=<value optimized out>,
    argv=<value optimized out>, env=0xbffff3ac) at dl-init.c:134
        preinit_array = 0x80
        preinit_array_size = <value optimized out>
        i = 46
#23 0x0021c88f in _dl_start_user () from /lib/ld-linux.so.2
No symbol table info available.
(gdb) thread apply all backtrace full

Thread 1 (Thread 0xb6772760 (LWP 7040)):
#0 0x00363422 in __kernel_vsyscall ()
No symbol table info available.
#1 0x005cc829 in __lll_lock_wait ()
    at ../nptl/sysdeps/unix/sysv/linux/i386/i686/../i486/lowlevellock.S:142
No locals.
#2 0x005c7f59 in _L_lock_966 () from /lib/tls/i686/cmov/libpthread.so.0
No locals.
#3 0x005c7ec6 in __pthread_mutex_lock (mutex=0x682014)
    at pthread_mutex_lock.c:101
        ignore3 = 0
        ignore1 = -512
        ignore2 = 128
        max_cnt = 6823956
        __PRETTY_FUNCTION__ = "__pthread_mutex_lock"
        type = <value optimized out>
#4 0x0067ac36 in malloc_mutex_lock () at jemalloc.c:1368
No locals.
#5 malloc_init_hard () at jemalloc.c:5202
        i = 0
        buf = "\000\b\000\000\000\340)y\266\020\000\000\000\214\361\377\277>\177\"\000\364)y\266\340)y\266\020\000\000\000\000\000\000\000\060\270{\266\340\272{\266\260\022\262\266\000\000\000\000@\311\377\277\346\224\"\000\\\361\377\277", '\000' <repeats 12 times>, "\177\361\377\277!\006#\000t\361\377\277\u0205#", '\000' <repeats 17 times>"\364, \177#\000\320\310\377\277\004\000\000\000\270\310\377\277E\a#\000\b\000\000\000\270)y\266\020\000\000\000\214\361\377\277>\177\"\000\314)y\266\270)y\266\020\000\000\000\000\000\000\000P\u0348\266\250*\u0776\260\022\262\266\000\000\000\000\300\311\377\277\346\224\"\000\\\361\377\277", '\000' <repeats 12 times>, "\177\361\377\277x\361\377\277t\361\377\277!\006#", '\000' <repeats 17 times>"\364, \177#\000P\213\"\000\364\177#\000`\311\377\277\004\000\000\000@\311\377\277E\a#\000\b\000\000\000\220)y\266\020\000\000\000\214\361\377\277>\177\"\000\244)y\266\220)y\266\020\000\000\000\000\000\000\000\000\000\000\001\000\000\000\000\060\006!\267\000\200\376\267\260\022\262"...
        opts = 0x237ff4 ",\277\001"
        result = <value optimized out>
        linklen = <value optimized out>
#6 0x0067d7b5 in malloc_init (num=1, size=20) at jemalloc.c:5181
No locals.
#7 calloc (num=1, size=20) at jemalloc.c:5896
        ret = <value optimized out>
        num_size = <value optimized out>
#8 0x00505106 in _dlerror_run (operate=0xfffffe00, args=0xbfffdce0)
    at dlerror.c:142
        result = 0x0
#9 0x00504d4c in __dlsym (handle=0xffffffff, name=0xb66978 "open")
    at dlsym.c:71
        args = {handle = 0xffffffff, name = 0xb66978 "open", who = 0xb666fc,
          sym = 0x1}
        result = <value optimized out>
#10 0x00b666fc in open (pathname=0x67f814 "/proc/cpuinfo", flags=0)
    at esddsp.c:225
        args = <value optimized out>
        mode = <value optimized out>
        func = 0
#11 0x0067ac59 in open () at /usr/include/bits/fcntl2.h:54
No locals.
#12 malloc_ncpus () at jemalloc.c:4946
        fd = -1073753472
        column = <value optimized out>
        buf = "P\213\"\000\300G#\000\064\356\377\277\000\000\000\000\364\177#\000P\213\"\000\214\361\377\277\222~\"\000\001\000\000\000\244\202#\000\220\354\377\277\364\177#\000\001\000\000\000\260\022\262\266\260\355\377\277P\213\"\000\\\361\377\277\000\000\000\000\364\177#\000P\213\"\000\001\000\000\000\000\020\262\266\300\355\377\277\\\361\377\277\000\000\000\000\364\177#\000P\213\"\000\214\361\377\277\001\000\000\000P-\u0776\340\355\377\277\000\000\000\000\364\177#\000P\213\"\000\214\361\377\277\222~\"\000\001\000\000\000\250*\u0776\000\356\377\277\364\177#\000\001\000\000\000\370'\u0776 \356\377\277P\213\"\000\\\361\377\277\000\000\000\000\364\177#\000P\213\"\000\001\000\000\000X%\u07760\356\377\277\\\361\377\277\000\000\000\000\364\177#\000\324\065\236\266\020ii\r\254\356\377\277\200J\"\000\206\u77b6\355\063\\\000\364\177#\000P\213\"\000\000\000\000\000\260gw\266\002\000\377\277\000\242\"\000\305\063\\\000d\022\262\266\364\177#\000|\u7776\036\000\000\000\034\357\377\277\245M\"\000\000\000\000\000\364\177#\000P\213\"\000\001\000\000\000\060\271z\000\244\375\235\266(E#\000\350"...
        i = <value optimized out>
        nread = <value optimized out>
#13 malloc_init_hard () at jemalloc.c:5234
        i = 3221221772
        buf = "\000\001\000\000\000\060\270{\266p\335\377\277\364\177#\000\001\000\000\000h\265{\266\220\335\377\277P\213\"\000\\\361\377\277\000\000\000\000\364\177#\000P\213\"\000\001\000\000\000\260\262{\266\240\335\377\277\\\361\377\277\000\000\000\000\364\177#\000P\213\"\000\214\361\377\277\001\000\000\000\000\260{\266\300\335\377\277\000\000\000\000\364\177#\000P\213\"\000\214\361\377\277\222~\"\000\001\000\000\000hk\203\266\340\335\377\277\364\177#\000\001\000\000\000\250h\203\266\000\336\377\277P\213\"\000\\\361\377\277\000\000\000\000\364\177#\000P\213\"\000\001\000\000\000\360e\203\266\020\336\377\277\\\361\377\277P\213\"\000\000\337\377\277\344\336\377\277\f\336\377\277\360e\203\266\300\342\344\266x\345\u4da8h\203\266hk\203\266\000\260{\266\000\200\376\267\260\262{\266h\265{\266\060\270{\266\340\272{\266X)\226\266X%\u0776P\u0348\266\250*\u0776\260\022\262\266\000\000\000\000\\\361\377\277\000\000\000\000\242\213\"\001\000\000\000\000\177\361\377\277!\006#\000t\361\377\277\u0205#\000\000\000\000\000\242\213\"\001\000\000\000\000\177\361\377\277\364\177#\000\000\337\377\277\006\000\000\000\344\336\377\277E\a#\000\b\000\000\000\230e\203\266\030\000\000\000\214\361\377\277>\177\"\000\264e\203\266\230e\203\266\030\000\000\000\177\361\377\277\364\177"...
        opts = 0x0
        result = <value optimized out>
        linklen = <value optimized out>
#14 0x0067d8c5 in malloc_init (size=352) at jemalloc.c:5181
No locals.
#15 malloc (size=352) at jemalloc.c:5772
        ret = <value optimized out>
#16 0xb6a37ddf in __fopen_internal (filename=0x5b521a "/proc/filesystems",
    mode=0x5b510f "r", is32=0) at iofopen.c:76
No locals.
#17 0xb6a3a42c in _IO_fopen64 (filename=0x5b521a "/proc/filesystems",
    mode=0x5b510f "r") at iofopen64.c:39
No locals.
#18 0x005ab6f0 in ?? () from /lib/libselinux.so.1
No symbol table info available.
#19 0x005b4bfd in ?? () from /lib/libselinux.so.1
No symbol table info available.
#20 0x005a30c8 in _init () from /lib/libselinux.so.1
No symbol table info available.
#21 0x002298bc in call_init (l=<value optimized out>,
    argc=<value optimized out>, argv=0xbffff3a4, env=0xbffff3ac)
    at dl-init.c:70
        init_array = <value optimized out>
#22 0x00229a21 in _dl_init (main_map=0x238670, argc=<value optimized out>,
    argv=<value optimized out>, env=0xbffff3ac) at dl-init.c:134
        preinit_array = 0x80
        preinit_array_size = <value optimized out>
        i = 46
#23 0x0021c88f in _dl_start_user () from /lib/ld-linux.so.2
No symbol table info available.
(gdb)

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu firefox Edit question
Assignee:
No assignee Edit question
Solved by:
MarcRandolph
Solved:
2010-02-04
Last query:
2010-02-04
Last reply:
MarcRandolph (mrand) said : #1

I woke up this morning realizing that I left out a vital piece of information: I'm trying to open Firefox from within an NX session (like VNC, but with builtin ssh). It completely slipped my mind - probably because all other apps (MythTV, Epiphany, and anything else I launch) work seemlessly.

I went to the actual machine and logged in with a user that I'm having trouble with over NX. Firefox opens there, even with the old profile. So it isn't a profile problem, and it is not a Firefox install problem.... seems to me to be a system level permission problem: when Firefox is launched within NX, it is trying to access something with respect to the main system that it doesn't have permission to. I don't believe it is sound because I can launch vlc and it plays on the main system speakers just fine. What other system level items does Firefox need access to?

BTW, when I said Firefox hangs, here is what I mean: when launched by clicking the Firefox icon, I get a "Starting Firefox Web Browser..." program down in the task bar, but after a few moments, it goes away and the main browser window never opens up. It hangs forever with the following processes running:

test 16048 1 0 07:48 ? 00:00:00 /bin/sh /usr/lib/firefox-3.6/firefox
test 16053 16048 0 07:48 ? 00:00:00 /bin/sh /usr/lib/firefox-3.6/run-mozilla.sh /usr/lib/firefox-3.6/firefox-bin
test 16057 16053 0 07:48 ? 00:00:00 /usr/lib/firefox-3.6/firefox-bin

MarcRandolph (mrand) said : #2

For anyone else that runs across this, work around is to disable "multimedia support" in the NX client.

Matthew B. (alfers1985) said : #3

Thanks for posting that. I have been trying to figure out why firefox was crashing in NX since last fall. Disabling multimedia support isn't that big of a problem considering that currently NX can only support esd, and next to nothing is still using esd. I just don't get why it hangs trying to open firefox as a regular user with multimedia support enabled, but if you launch firefox from a terminal window during a NX session as root, with multimedia enabled, it works then.

Tom Ellis (tellis) said : #4

Thanks for this too, I also hit this in Karmic with NX.

From the forum post:
"For the record, I ran into this using the freely available NX server and client software, not FreeNX. I did some quick searching and have not been able to determine why this is required... the only hints are here:

http://www.nomachine.com/ar/view.php?ar_id=AR03D00355

Random FYI: pulseaudio support appears to be coming in NX 4.0"

NX 4.0 seems sometime away, but I don't need sound on these thinclients anyway!