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 580193 - crashes when message is cancelled by restart callback, when using async session
crashes when message is cancelled by restart callback, when using async session
Status: RESOLVED FIXED
Product: libsoup
Classification: Core
Component: API
2.25.x
Other Linux
: Normal normal
: ---
Assigned To: libsoup-maint@gnome.bugs
libsoup-maint@gnome.bugs
: 579029 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2009-04-25 03:00 UTC by Gustavo Noronha (kov)
Modified: 2009-05-05 14:07 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
small test case I was using to test (1.14 KB, application/octet-stream)
2009-04-25 03:04 UTC, Gustavo Noronha (kov)
  Details
patch that seems to fix the issue (455 bytes, patch)
2009-04-25 03:05 UTC, Gustavo Noronha (kov)
none Details | Review

Description Gustavo Noronha (kov) 2009-04-25 03:00:47 UTC
Found this while debugging the last crash we have in our test suite, for WebKitGTK+. I'm attaching a patch that fixes the problem, though I am not sure it is the correct solution. Here's output of the test program I wrote, along with the backtrace:

** (process:24360): WARNING **: Location: http://localhost:12345/blah/

** (process:24360): WARNING **: restarted... uri: http://localhost:12345/blah/

(process:24360): GLib-GObject-CRITICAL **: g_type_instance_get_private: assertion `instance != NULL && instance->g_class != NULL' failed

Program received signal SIGSEGV, Segmentation fault.

Thread 3079719696 (LWP 24360)

  • #0 soup_session_get_queue
    at soup-session.c line 1200
  • #1 run_queue
    at soup-session-async.c line 240
  • #2 request_restarted
    at soup-session-async.c line 317
  • #3 IA__g_cclosure_marshal_VOID__VOID
    at /build/buildd-glib2.0_2.20.1-1-i386-SPuBUJ/glib2.0-2.20.1/gobject/gmarshal.c line 77
  • #4 IA__g_closure_invoke
    at /build/buildd-glib2.0_2.20.1-1-i386-SPuBUJ/glib2.0-2.20.1/gobject/gclosure.c line 767
  • #5 signal_emit_unlocked_R
    at /build/buildd-glib2.0_2.20.1-1-i386-SPuBUJ/glib2.0-2.20.1/gobject/gsignal.c line 3247
  • #6 IA__g_signal_emit_valist
    at /build/buildd-glib2.0_2.20.1-1-i386-SPuBUJ/glib2.0-2.20.1/gobject/gsignal.c line 2980
  • #7 IA__g_signal_emit
    at /build/buildd-glib2.0_2.20.1-1-i386-SPuBUJ/glib2.0-2.20.1/gobject/gsignal.c line 3037
  • #8 soup_message_restarted
    at soup-message.c line 877
  • #9 soup_message_io_finished
    at soup-message-io.c line 168
  • #10 io_read
    at soup-message-io.c line 839
  • #11 IA__g_cclosure_marshal_VOID__VOID
    at /build/buildd-glib2.0_2.20.1-1-i386-SPuBUJ/glib2.0-2.20.1/gobject/gmarshal.c line 77
  • #12 IA__g_closure_invoke
    at /build/buildd-glib2.0_2.20.1-1-i386-SPuBUJ/glib2.0-2.20.1/gobject/gclosure.c line 767
  • #13 signal_emit_unlocked_R
    at /build/buildd-glib2.0_2.20.1-1-i386-SPuBUJ/glib2.0-2.20.1/gobject/gsignal.c line 3247
  • #14 IA__g_signal_emit_valist
    at /build/buildd-glib2.0_2.20.1-1-i386-SPuBUJ/glib2.0-2.20.1/gobject/gsignal.c line 2980
  • #15 IA__g_signal_emit
    at /build/buildd-glib2.0_2.20.1-1-i386-SPuBUJ/glib2.0-2.20.1/gobject/gsignal.c line 3037
  • #16 socket_read_watch
    at soup-socket.c line 1116
  • #17 g_io_unix_dispatch
    at /build/buildd-glib2.0_2.20.1-1-i386-SPuBUJ/glib2.0-2.20.1/glib/giounix.c line 162
  • #18 IA__g_main_context_dispatch
    at /build/buildd-glib2.0_2.20.1-1-i386-SPuBUJ/glib2.0-2.20.1/glib/gmain.c line 1814
  • #19 g_main_context_iterate
    at /build/buildd-glib2.0_2.20.1-1-i386-SPuBUJ/glib2.0-2.20.1/glib/gmain.c line 2448
  • #20 IA__g_main_loop_run
    at /build/buildd-glib2.0_2.20.1-1-i386-SPuBUJ/glib2.0-2.20.1/glib/gmain.c line 2656
  • #21 main
    at redirect-bad-uri.c line 50

Comment 1 Gustavo Noronha (kov) 2009-04-25 03:04:19 UTC
Created attachment 133285 [details]
small test case I was using to test
Comment 2 Gustavo Noronha (kov) 2009-04-25 03:05:11 UTC
Created attachment 133286 [details] [review]
patch that seems to fix the issue
Comment 3 Dan Winship 2009-04-28 16:29:13 UTC
thanks. will go into 2.26.2

commit 74ed15a45689af40d6f210a6624fba0ea829055b
Author: Dan Winship <danw@gnome.org>
Date:   Tue Apr 28 12:23:03 2009 -0400

    Fix a crash when cancelling a message from a "restarted" handler
    
    SoupSessionAsync was mistakenly leaving its own "restarted" handler connected
    even after "finished" was emitted. misc-test was supposed to catch that, but
    it was using SoupSessionSync rather than Async. Changed it to use Async since
    Async adds some signal handlers of its own, while Sync does not.
    
    Fixes #380193, reported by Gustavo Noronha
Comment 4 Dan Winship 2009-05-05 14:07:22 UTC
*** Bug 579029 has been marked as a duplicate of this bug. ***