GNOME Bugzilla – Bug 366331
returns GNOME_VFS_OK for some broken responses
Last modified: 2018-08-17 13:52:14 UTC
What were you doing when the application crashed? Estaba escuchando Vaughanradio (http://www.vaughanradio.com/vaughanradio.pls) Distribution: Ubuntu 6.10 (edgy) Gnome Release: 2.16.1 2006-10-02 (Ubuntu) BugBuddy Version: 2.16.0 Memory status: size: 68046848 vsize: 0 resident: 68046848 share: 0 rss: 19468288 rss_rlim: 0 CPU usage: start_time: 1162047453 rtime: 0 utime: 79 stime: 0 cutime:74 cstime: 0 timeout: 5 it_real_value: 0 frequency: 3 Backtrace was generated from '/usr/bin/rhythmbox' (no debugging symbols found) Using host libthread_db library "/lib/tls/i686/cmov/libthread_db.so.1". (no debugging symbols found) [Thread debugging using libthread_db enabled] [New Thread -1229191504 (LWP 12170)] [New Thread -1243255904 (LWP 12181)] [New Thread -1252283488 (LWP 12180)] (no debugging symbols found) 0xffffe410 in __kernel_vsyscall ()
+ Trace 79309
Thread 2 (Thread -1243255904 (LWP 12181))
The server hosting that stream is hopelessly broken. It seems to randomly skip the trailing blank line that marks the end of the HTTP response headers.
Here's what's happening: - ne_request.c:read_response_headers fails because the response appears to have more than MAX_HEADER_FIELDS headers, returning NE_ERROR; this is after it has parsed the (200) status code. - http-neon-method.c:resolve_result returns GNOME_VFS_OK because it got a 200 response code and there is no socket error set - http-neon-method.c:http_transfer_start_read() sets handle->transfer_state = TRANSFER_ERROR and handle->last_error = GNOME_VFS_OK - future do_read() calls see the transfer state and return GNOME_VFS_OK (last_error) without setting *bytes_read - totem-pl-parser.c:my_gnome_vfs_get_mime_type_with_data doesn't initialize bytes_read before calling gnome_vfs_read(), so later on it tries to allocate a random (large) number of bytes, which usually fails, so it dies. Simple test case: gnomevfs-cat http://212.81.130.17 will mostly segfault, depending on the uninitialized value of bytes_read.
Created attachment 75593 [details] [review] simple patch This ensures that resolve_result() does not return GNOME_VFS_OK when the incoming result is NE_ERROR.
Added a work-around in Totem's playlist parser as well, in both HEAD and gnome-2-16 2006-10-29 Bastien Nocera <hadess@hadess.net> * src/plparse/totem-pl-parser.c: (my_gnome_vfs_get_mime_type_with_data): initialise bytes_read to avoid problems with gnome-vfs not initialising it (See bug #366331)
*** Bug 370490 has been marked as a duplicate of this bug. ***
-> me
Created attachment 76128 [details] [review] Clean up the resolve_result function a bit. I think this is fine to commit but I wanna be sure and apply that only after the branching.
*** Bug 384047 has been marked as a duplicate of this bug. ***
Christian, ping?
*** Bug 400055 has been marked as a duplicate of this bug. ***
*** Bug 401282 has been marked as a duplicate of this bug. ***
*** Bug 402885 has been marked as a duplicate of this bug. ***
*** Bug 403239 has been marked as a duplicate of this bug. ***
*** Bug 406030 has been marked as a duplicate of this bug. ***
*** Bug 414164 has been marked as a duplicate of this bug. ***
*** Bug 435873 has been marked as a duplicate of this bug. ***
*** Bug 476416 has been marked as a duplicate of this bug. ***
Christian, did you branch yet?
ahem, may I assume that this bug is OBSOLETE and the patch is not to be committed anymore?
Mass re-assignin old gnome-vfs http bugs to gnome-vfs-maint@gnome.bugs so they disappear from my "My bugs" list. Sorry for the spam.
gnome-vfs got deprecated in 2008. gnome-vfs is not under active development anymore and had its last code changes in 2011. Its codebase has been archived: https://gitlab.gnome.org/Archive/gnome-vfs/commits/master gio (in glib) and gvfs are its successors. See https://developer.gnome.org/gio/stable/ch33.html and https://people.gnome.org/~gicmo/gio-migration-guide/ for porting info. Closing this report as WONTFIX as part of Bugzilla Housekeeping to reflect reality. Feel free to open a task in GNOME Gitlab if the issue described in this task still applies to a recent + supported version of glib/gio/gvfs. Thanks!