GNOME Bugzilla – Bug 676038
Fix rygel test run
Last modified: 2012-05-15 16:24:25 UTC
I'm doing a jhbuild and it's failing at rygel's unit tests. rygel does something along these lines (abridged): public async void run () { SourceFunc run_continue = run.callback; size_t bytes_received = 0; this.msg.got_chunk.connect ((msg, chunk) => { bytes_received += chunk.length; if (bytes_received >= this.total_bytes) { this.context.session.cancel_message (this.msg, KnownStatusCode.CANCELLED); } }); this.context.session.queue_message (this.msg, (session, msg) => { run_continue (); }); yield; this.completed (); } This crashes shortly after the cancel_message because libsoup tries to access a cancellable that's been freed.
Created attachment 214017 [details] [review] soup-message-io: fix reference leak io_run_until forgets to release a reference it takes in a cancellation error path. This commit fixes that.
Created attachment 214018 [details] [review] soup-message-io: keep cancellable alive for duration of io_run_until io_run_until calls io_read/io_write which may ultimately cause the passed in cancellable to be freed. This commit refs the cancellable before the io operations, so it can be checked for cancellation following those operations. Fixes crasher in rygel test case.
Please make sure the reference count leak (attachment 214017 [details] [review]) is actually a leak, and not something more subtle. I just tossed that patch in at the same time because I noticed it when I was near those lines in the code.
Comment on attachment 214017 [details] [review] soup-message-io: fix reference leak this part is definitely right
Comment on attachment 214017 [details] [review] soup-message-io: fix reference leak Attachment 214017 [details] pushed as dbc41f6 - soup-message-io: fix reference leak
Pushed a slightly different version of that patch, and updated misc-test to crash in the absence of this fix. Thanks for the patches