Segfault when request sent using soup_session_send_async is cancelled
@mjog
Submitted by Michael Gratton Assigned to libsoup-maint@gnome.bugs
Link to original bug (#771912)
Description
I'm getting frequent crashes when a request sent using soup_session_send_async() has the passed GCancellable actually cancelled, via the main loop.
The session in use is an unremarkable SoupSession that has a small single-user cache.
Representative backtrace:
Thread 1 "geary" received signal SIGSEGV, Segmentation fault.
write_ready_cb (source=<optimised out>
, result=<optimised out>
,
istream=0x642e750 [SoupCacheInputStream]) at soup-cache-input-stream.c:175
175 if (pending) {
(gdb) bt
#0 0x00007ffff31dae27 in write_ready_cb (source=<optimised out>, result=<optimised out>, istream=0x642e750 [SoupCacheInputStream]) at soup-cache-input-stream.c:175
#1 0x00007ffff27ccb43 in g_task_return_now (task=0x7fff0c016540 [GTask])
at /build/glib2.0-7IO_Yw/glib2.0-2.48.1/./gio/gtask.c:1107
#2 0x00007ffff27cd1ee in g_task_return (task=0x7fff0c016540 [GTask], type=<optimised out>) at /build/glib2.0-7IO_Yw/glib2.0-2.48.1/./gio/gtask.c:1165
#3 0x00007ffff27b3123 in async_ready_write_callback_wrapper (source_object=0x7fff7000a200 [GLocalFileOutputStream], res=0x7fff18010030, user_data=0x7fff0c016540)
at /build/glib2.0-7IO_Yw/glib2.0-2.48.1/./gio/goutputstream.c:752
#4 0x00007ffff27ccb43 in g_task_return_now (task=0x7fff18010030 [GTask])
at /build/glib2.0-7IO_Yw/glib2.0-2.48.1/./gio/gtask.c:1107
#5 0x00007ffff27ccb79 in complete_in_idle_cb (task=0x7fff18010030)
at /build/glib2.0-7IO_Yw/glib2.0-2.48.1/./gio/gtask.c:1121
#6 0x00007ffff222b05a in g_main_context_dispatch (context=0xa34000)
at /build/glib2.0-7IO_Yw/glib2.0-2.48.1/./glib/gmain.c:3154
#7 0x00007ffff222b05a in g_main_context_dispatch (context=context@entry=0xa34000)
at /build/glib2.0-7IO_Yw/glib2.0-2.48.1/./glib/gmain.c:3769
#8 0x00007ffff222b400 in g_main_context_iterate (context=context@entry=0xa34000, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimised out>)
at /build/glib2.0-7IO_Yw/glib2.0-2.48.1/./glib/gmain.c:3840
#9 0x00007ffff222b4ac in g_main_context_iteration (context=context@entry=0xa34000, may_block=may_block@entry=1) at /build/glib2.0-7IO_Yw/glib2.0-2.48.1/./glib/gmain.c:3901
#10 0x00007ffff27f2cdd in g_application_run (application=0xa23140 [GearyApplication], argc=argc@entry=2, argv=argv@entry=0x7fffffffe408)
at /build/glib2.0-7IO_Yw/glib2.0-2.48.1/./gio/gapplication.c:2381
#11 0x0000000000488bcf in _vala_main (args=0x7fffffffe408, args_length1=2)
at /home/mjg/Projects/GNOME/geary/src/client/application/main.vala:25
#12 0x00007ffff18c8830 in __libc_start_main (main=
0x46a960 <main>, argc=2, argv=0x7fffffffe408, init=<optimised out>, fini=<optimised out>, rtld_fini=<optimised out>, stack_end=0x7fffffffe3f8) at ../csu/libc-start.c:291
#13 0x000000000046a9a9 in _start ()
(gdb) info locals
ostream = <optimised out>
priv = 0x642e6f0
write_size = 1369
pending = <error reading variable pending (Cannot access memory at address 0x8)>
error = 0x0
Version: 2.54.x