GNOME Bugzilla – Bug 345351
gnomevfs.async open/read in plugin crashes rhythmbox
Last modified: 2007-04-29 17:17:02 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)
Sounds like a bug in gnome-vfs C part. Some debugging info: (gdb) bt
+ Trace 68933
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.
Backtrace is not really helping and my simple test program didn't crash. Are you sure its not a binding problem?
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?
Obviously, this doesn't happen anymore. Closing.