Now that the code in SlaveOPML for creating new outlines from scratch works
(including saving), I've spent some time trying to figure out why the
program crashes at opening the app. I'm stuck near the beginning; all I
could figure out is the stack trace.
Crash occurs immediately after choosing the file to open, either via the
"Open Recent" menu or via the Open panel.
Program received signal SIGSEGV, Segmentation fault.
0x00ff4a8c in free () from /lib/tls/i686/cmov/libc.so.6
(gdb) bt
#0 0x00ff4a8c in free () from /lib/tls/i686/cmov/libc.so.6
#1 0x0167fbfc in xmlFreeNodeList () from /usr/lib/libxml2.so.2
#2 0x0167fc35 in xmlFreeNodeList () from /usr/lib/libxml2.so.2
#3 0x0168055f in xmlFreeNode () from /usr/lib/libxml2.so.2
#4 0x00cad2bd in -[NSXMLNode dealloc] (self=0x87f72bc, _cmd=0xef2d18) at
NSXMLNode.m:1038
#5 0x00ca5c45 in -[NSXMLElement dealloc] (self=0x87f72bc, _cmd=0xece3b8)
at NSXMLElement.m:49
#6 0x00b83045 in -[NSObject release] (self=0x87f72bc, _cmd=0xeaa150) at
NSObject.m:2049
#7 0x00a4b8c1 in -[NSAutoreleasePool emptyPool] (self=0x819beac,
_cmd=0xeaa0f8) at NSAutoreleasePool.m:656
#8 0x00a4b451 in -[NSAutoreleasePool dealloc] (self=0x819beac,
_cmd=0xeaa160) at NSAutoreleasePool.m:538
#9 0x00a4b3d0 in -[NSAutoreleasePool release] (self=0x819beac,
_cmd=0x7f4c98) at NSAutoreleasePool.m:531
#10 0x0030858e in -[NSApplication run] (self=0x82ec224, _cmd=0x7ee948) at
NSApplication.m:1580
#11 0x002ccd21 in NSApplicationMain (argc=1, argv=0xbffff2b4) at
Functions.m:91
#12 0x0804efaa in main (argc=1, argv=0xbffff2b4) at OPML/main.m:13
Crash seems to happen somewhere in NSXMLElement/NSXMLNode, in a call to
libxml2.
This happens after my -(id)initWithOPMLData:(NSData*)data
error:(NSError**)error has finished already. Although it works when I
create a blank outline, it fails miserably even if I add return [self
initWithBlankOutline]; as the first line of initWithOPMLData:error:.
I'm really unsure how to proceed with debugging. Turning on zombies didn't
help since the crash occurs in libxml2. I've tried removing some
autoreleases, but to no avail.
NSXMLDocument subclass is not released upon loading (that wouldn't make
sense) and the app works under Cocoa. In fact, I don't really see what I'm
autoreleasing.
Does anyone have some tips on what I can do?
Alternatively, if anyone is willing to directly look at the problem, to
make testing easier I've also added "example.opml" to the repository which
is, as always, available at:
http://bitbucket.org/ivucica/opml