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 345351 - gnomevfs.async open/read in plugin crashes rhythmbox
gnomevfs.async open/read in plugin crashes rhythmbox
Status: RESOLVED INVALID
Product: rhythmbox
Classification: Other
Component: Programmatic interfaces
HEAD
Other All
: Normal major
: ---
Assigned To: gnome-vfs maintainers
gnome-vfs maintainers
Depends on:
Blocks:
 
 
Reported: 2006-06-19 19:49 UTC by Adam Zimmerman
Modified: 2007-04-29 17:17 UTC
See Also:
GNOME target: ---
GNOME version: 2.13/2.14



Description Adam Zimmerman 2006-06-19 19:49:35 UTC
Please describe the problem:
I'm writing a rhythmbox plugin in python. I'm trying to read a file and parse it with xml.sax. The file is big, and I don't want to block rhythmbox's UI for 2 minutes, so I'm trying to use gnomevfs.async to do it.

When I run the code, I get the following line printed a bunch of times:
(rhythmbox:7409): libgnomevfs-WARNING **: Unknown job kind 9

and then rhythmbox segfaults:

GLib-ERROR **: gmem.c:135: failed to allocate 524288 bytes
aborting...
Segmentation fault!
Cannot display crash dialogue

Steps to reproduce:
Run the code below (taking out the "self" references, as it's not in a class anymore).

Actual results:


Expected results:
The file should be read and parsed, without blocking the UI.

Does this happen every time?
Yes.

Other information:
Here's the code in question:

def open_callback(self, handle, exc_type):
	times = 0
	if not exc_type:
		try:
			while True:
				handle.read(512*1024, self.read_callback) # file is about 5MB
		except EOFError:
			handle.close(lambda *args: None)
	else:
		handle.close(lambda *args: None)
	
def read_callback(self, handle, buf, exc_type, bytes_requested):
	self.parser.feed(buf)

gnomevfs.async.open("http://magnatune.com/info/song_info.xml", self.open_callback)
Comment 1 Gustavo Carneiro 2006-06-19 21:49:14 UTC
Sounds like a bug in gnome-vfs C part.  Some debugging info:

(gdb) bt
  • #0 IA__g_logv
    at gmessages.c line 493
  • #1 IA__g_log
    at gmessages.c line 517
  • #2 _gnome_vfs_job_execute
    at gnome-vfs-job.c line 1691
  • #3 thread_entry_point
    at gnome-vfs-job-queue.c line 66
  • #4 g_thread_pool_thread_proxy
    at gthreadpool.c line 265
  • #5 g_thread_create_proxy
    at gthread.c line 553
  • #6 ??
  • #7 start_thread
    from /lib/libpthread.so.0
  • #8 clone
    from /lib/libc.so.6
  • #9 ??
  • #2 _gnome_vfs_job_execute
    at gnome-vfs-job.c line 1691
1686                            break;
1687                    case GNOME_VFS_OP_FILE_CONTROL:
1688                            execute_file_control (job);
1689                            break;
1690                    default:
1691                            g_warning (_("Unknown job kind %u"), job->op->type);
1692                            break;
1693                    }
1694                    /* NB. 'job' is quite probably invalid now */
1695                    clear_current_job ();

Job type 9 is GNOME_VFS_OP_READ_WRITE_DONE.
Comment 2 Christian Kellner 2006-07-13 13:06:36 UTC
Backtrace is not really helping and my simple test program didn't crash. Are you sure its not a binding problem?
Comment 3 Adam Zimmerman 2006-07-14 06:02:19 UTC
You're right, I never tested it outside rhythmbox. When I do, it doesn't crash. It only crashes when run from the rhythmbox python console. Maybe related somehow to bug 346328?
Comment 4 Adam Zimmerman 2007-04-29 17:17:02 UTC
Obviously, this doesn't happen anymore. Closing.