GNOME Bugzilla – Bug 701572
g_object_unref: assertion `G_IS_OBJECT (object)' failed when parsing message with StreamCat
Last modified: 2013-07-02 13:54:34 UTC
I recently received a message marked as spam that causes the above assertion when parsing. However, it only occurs when the message is parsed with GMimeStreamCat (the header buffer from one stream, the body buffer from another). If they're loaded into a single buffer and parsed, there's no problem. The broader issue is that I run with fatal-warnings, and so this causes Geary to crash for me every time. I'm concerned about attaching the message directly here, as it's spam and has a ZIP attachment that holds a .EXE. If someone wants to see the message, I can email it directly. I have a Vala program which reproduces this problem. It looks like this: void main(string[] args) { GMime.init(0); try { string header; FileUtils.get_contents("header.txt", out header); string body; FileUtils.get_contents("body.txt", out body); GMime.StreamCat stream_cat = new GMime.StreamCat(); stream_cat.add_source(new GMime.StreamMem.with_buffer(header.data)); stream_cat.add_source(new GMime.StreamMem.with_buffer(body.data)); GMime.Parser parser = new GMime.Parser.with_stream( stream_cat); parser.construct_message(); } catch (Error err) { stderr.printf("%s\n", err.message); } } ... where header.txt has the headers and body.txt the body.
Can you run this under gdb and set a breakpoint on g_logv and get a backtrace of where this log message occurs? and/or attach the headers.txt and body.txt files?
When run with G_DEBUG=fatal-warnings:
+ Trace 232177
I'll attach an archive with all the necessary files to build and execute. I'm compiling with latest Vala, 0.20.1.
Created attachment 248191 [details] Archive of test case with spam email in two parts, header and body
thanks! fixed in git master