After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 309867 - hang when setting SoupSession::proxy_uri from a GConfClient notify callback
hang when setting SoupSession::proxy_uri from a GConfClient notify callback
Status: RESOLVED FIXED
Product: libsoup
Classification: Core
Component: HTTP Transport
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Dan Winship
Dan Winship
Depends on:
Blocks:
 
 
Reported: 2005-07-09 06:07 UTC by James Henstridge
Modified: 2006-05-22 14:48 UTC
See Also:
GNOME target: ---
GNOME version: 2.11/2.12



Description James Henstridge 2005-07-09 06:07:40 UTC
Distribution/Version: Ubuntu

I wrote some code to make a SoupSession object follow the desktop proxy settings
using GConf.  The code is fairly simple:
 1. hook up a gconf notify callback for the /system/http_proxy key
 2. inside the notify callback, construct a proxy URI
 3. call g_object_set() on the SoupSession to set "proxy_uri".

I have noticed step 3 hanging when setting the proxy.  The code in question is
available in my bazaar archive:
  baz get
http://www.gnome.org/~jamesh/arch/james@jamesh.id.au/http-resource--devel--0

Compile it and run "./lookup someurl" and then alter the proxy settings in the
network control panel.

Below is the traceback I got when I interrupted the program when it hung:

  • #0 __lll_mutex_lock_wait
    from /lib/libpthread.so.0
  • #1 ??
  • #2 ??
  • #3 pthread_mutex_lock
    from /lib/libpthread.so.0
  • #4 ??
  • #5 ??
  • #6 ??
  • #7 ??
  • #8 ??
  • #9 ??
  • #10 ??
  • #11 iconv_close
    from /lib/libc.so.6
  • #12 ??
  • #13 ??
  • #14 ??
  • #15 ??
  • #16 g_signal_accumulator_true_handled
    at gsignal.c line 2655
  • #17 ??
  • #18 IA__g_cclosure_marshal_VOID__VOID
    at gmarshal.c line 77
  • #19 IA__g_closure_invoke
    at gclosure.c line 437
  • #20 signal_emit_unlocked_R
    at gsignal.c line 2488
  • #21 IA__g_signal_emit_valist
    at gsignal.c line 2247
  • #22 IA__g_signal_emit
    at gsignal.c line 2291
  • #23 soup_connection_disconnect
    at soup-connection.c line 620
  • #24 free_host
    at soup-session.c line 578
  • #25 foreach_free_host
    at soup-session.c line 124
  • #26 g_hash_table_foreach_remove_or_steal
    at ghash.c line 506
  • #27 cleanup_hosts
    at soup-session.c line 132
  • #28 IA__g_object_set_valist
    at gobject.c line 732
  • #29 IA__g_object_set
    at gobject.c line 1218
  • #30 update_http_proxy
    at http-session-gconf.c line 67
  • #31 notify_listeners_callback
    at gconf-client.c line 2367
  • #32 notify_listener_list
    at gconf-listeners.c line 588
  • #33 ltable_notify
    at gconf-listeners.c line 654
  • #34 notify_one_entry
    at gconf-client.c line 2392
  • #35 gconf_client_flush_notifies
    at gconf-client.c line 2432
  • #36 notify_idle_callback
    at gconf-client.c line 2326
  • #37 g_idle_dispatch
    at gmain.c line 3812
  • #38 g_main_dispatch
    at gmain.c line 1933
  • #39 IA__g_main_context_dispatch
  • #40 g_main_context_iterate
    at gmain.c line 2564
  • #41 IA__g_main_loop_run
    at gmain.c line 2768
  • #42 main
    at lookup.c line 42

The top entry in the libsoup changelog for my checkout is 2005-07-06
Comment 1 James Henstridge 2005-07-11 13:13:40 UTC
Instructions for triggering the bug:
 1. compile the "lookup" program
 2. run "./lookup http://www.gnome.org/"
 3. open "Network Proxy" control panel
 4. set HTTP proxy and unset proxy until the program hangs

The program prints "changing proxy URI to ..." or "unsetting proxy URI" before
making the change, and "successfully set proxy URI" after the change.  If the
second message does not get printed then the program has hung.
Comment 2 Dan Winship 2005-07-13 16:58:29 UTC
I tried this, and switched the proxy on and off about a hundred times, but
didn't get a hang.

That stack trace is weird... what are all those "??"s? You seem to have
symbols for both libsoup and glib, and the place it's getting stuck doesn't
seem to be in either of them. So where is it?

Alex, any reason you cc:ed yourself on this? Are you seeing this problem too?
Comment 3 Alex Graveley 2005-07-13 17:14:39 UTC
Nope.  I tried to trace the code paths and couldn't immediately find anything
racy, so I wanted to see where this goes.

Keep up the good work, Dan.
Comment 4 James Henstridge 2005-07-14 03:23:29 UTC
I just did a "jhbuild build libsoup gconf" to make sure everything is up to date.

I'm guessing there is some timing related issue, since I can't get it to hang
when running the program under GDB.  If I managed to hang the program and attach
GDB, I get the same traceback as above.

I wonder if this is a libc or libpthread related issue?  If I run the same
executable with the same libraries I'd built with jhbuild under my Fedora chroot
(so this is essentially just a different libc + libpthread), I couldn't trigger
the bug at all.
Comment 5 Dan Winship 2006-05-22 14:48:14 UTC
Fixed in CVS.