Re: gnome_show_url() hangs in threaded programs



On 2001-08-29 02:50 James Henstridge wrote:
> Do you still see the problems if you link with:
>   cc atfork-test.c `glib-config --cflags --libs gthread`
> 
> Or equivalently for 1.3:
>   cc atfork-test.c `pkg-config --cflags --libs gthread-2.0`
> 
> If those cases don't work, then report it as a bug.  Relying on the
> dynamic linker to pull in pthread as a dynamic dependency is asking
> for trouble.  Various C library functions change behaviour after
> linking with pthread (for instance, errno changes).

Well, for this *simple* program, it works. For more complex programs,
which link also against gnome libs, it may not (depending on the linking
order). There are some more details on this on

http://mail.gnome.org/archives/balsa-list/2001-August/msg00681.html

For example following command line (that includes pthread library!) will
produce executable that will hang.

# cc atfork-test.c -I/usr/include/glib-1.2 -I/usr/lib/glib/include
-D_REENTRANT -lglib -lc -lpthread -lgthread

We have spotted this issue in balsa when we used configure-generated
$GNOME_LIBS, $GLIB_LIBS, $GTK_LIBS (as generated by autoconf macros)
make variables for linking. It produced working code in some
configurations, and in other setups, balsa hang on fork. 

The workaround we use now is to collect a list of used gnome libraries
and then run gnome-config --libs once with the list. 

/Pawel




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