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 602057 - gdata_picasaweb_service_upload_file asserts a condition that's untrue when GCancelling operation
gdata_picasaweb_service_upload_file asserts a condition that's untrue when GC...
Status: RESOLVED INVALID
Product: libgdata
Classification: Platform
Component: PicasaWeb service
git master
Other Linux
: Normal major
: ---
Assigned To: libgdata-maint
libgdata-maint
Depends on:
Blocks:
 
 
Reported: 2009-11-16 06:24 UTC by Richard Schwarting
Modified: 2009-11-16 09:18 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Richard Schwarting 2009-11-16 06:24:13 UTC
So, when I use g_cancellable_cancel () on the GCancellable that gets provided through 
  gdata_picasaweb_service_upload_file () 
to 
  gdata_output_stream_splice (), 
the returned response_body from 
  gdata_upload_stream_get_response () 
ends up being NULL, and my programme crashes. 


Here's the culprit code:

GDataPicasaWebFile *
gdata_picasaweb_service_upload_file (..., GCancellable cancellable, ...) {
        ...

        g_output_stream_splice (output_stream, input_stream, G_OUTPUT_STREAM_SPLICE_CLOSE_SOURCE | G_OUTPUT_STREAM_SPLICE_CLOSE_TARGET,
                                cancellable, error);
        ...
        /* Get the response from the server */
        response_body = gdata_upload_stream_get_response (GDATA_UPLOAD_STREAM (output_stream), &response_length);
        g_assert (response_body != NULL && response_length > 0);
        ...
}




Here's a partial stack trace from the code I was writing:

  • #7 <signal handler called>
  • #8 __kernel_vsyscall
  • #9 *__GI_raise
    at ../nptl/sysdeps/unix/sysv/linux/raise.c line 64
  • #10 *__GI_abort
    at abort.c line 88
  • #11 IA__g_assertion_message
  • #12 IA__g_assertion_message_expr
    at gtestutils.c line 1312
  • #13 parse_spliced_stream
    at gdata-picasaweb-service.c line 341
  • #14 gdata_picasaweb_service_upload_file
    at gdata-picasaweb-service.c line 418
  • #15 tmp_picasaweb_upload_async
    at eog-postasa-plugin.c line 156

Comment 1 Richard Schwarting 2009-11-16 06:24:37 UTC
This currently also applies to my upload_async patches () :|
Comment 2 Richard Schwarting 2009-11-16 06:26:30 UTC
Would the correct solution be to check if g_cancellable_is_cancelled () between g_output_stream_splice () and g_upload_stream_get_response (), or to remove the assert?

The assert was based on the assert present in gdata-document-services.c.
Comment 3 Richard Schwarting 2009-11-16 09:18:55 UTC
Er, this actually ONLY applied to my upload_async patches.  Never mind.