Re: gnome_show_url() hangs in threaded programs



On 2001.08.24 16:39:03 +0100 Carlos Morgado wrote:
> 
> On 2001.08.24 15:52:09 +0100 Toralf Lund wrote:
> 
> > 2. If I replace fork() etc. with system(<something>), everything appears
> to
> > work as expected, i.e. the atfork functions are called. I find this a bit
> > surprising, since I'm assuming system() does little else than fork(), then
> > exec..(<shell>, ...)
> > 

(glibc-2.1.3 here)

actually, diference is both pthread and glibc export fork() as weak symbols
which means compile order is used, while system() only exists in glibc,
i think :)

also,

chbm@whisky:~ cc atfork-test.c  -lglib -lgthread
chbm@whisky:~ ldd a.out 
	libglib-1.2.so.0 => /usr/lib/libglib-1.2.so.0 (0x4001d000)
	libgthread-1.2.so.0 => /usr/lib/libgthread-1.2.so.0 (0x4003e000)
	libc.so.6 => /lib/libc.so.6 (0x40041000)
	libpthread.so.0 => /lib/libpthread.so.0 (0x40136000)
	/lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x40000000)
chbm@whisky:~ cc atfork-test.c -lpthread -lglib -lgthread
chbm@whisky:~ ldd a.out
	libpthread.so.0 => /lib/libpthread.so.0 (0x4001d000)
	libglib-1.2.so.0 => /usr/lib/libglib-1.2.so.0 (0x40030000)
	libgthread-1.2.so.0 => /usr/lib/libgthread-1.2.so.0 (0x40051000)
	libc.so.6 => /lib/libc.so.6 (0x40054000)
	/lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x40000000)

how the link order of the first is messed up, fork() from libc is used
while in the 2nd fork() from libpthread is used. 

this is of course, a glibc 'issue'.

i gota test this in debian/unstable as they have glibc > 2.2.2 which 
aparently have some symbols demangled

-- 
Carlos Morgado - chbm(at)chbm(dot)nu - http://chbm.nu/ -- gpgkey: 0x1FC57F0A
http://wwwkeys.pgp.net/ FP:0A27 35D3 C448 3641 0573 6876 2A37 4BB2 1FC5 7F0A
Software is like sex; it's better when it's free. - Linus Torvalds




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]