{"issue":{"milestone":null,"user":{"id":101319,"login":"jdmuys","url":"https://api.github.com/users/jdmuys","avatar_url":"https://secure.gravatar.com/avatar/deed51cddc830e162557b8f01383a057?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"deed51cddc830e162557b8f01383a057"},"title":"mogenerator crashes on my model","created_at":"2011-12-18T01:53:55Z","updated_at":"2011-12-18T02:34:20Z","labels":[],"state":"open","id":2591437,"pull_request":{"patch_url":null,"html_url":null,"diff_url":null},"html_url":"https://github.com/rentzsch/mogenerator/issues/80","closed_at":null,"body":"mogenerator crashes with a segmentation fault when running on one of my model. Here is the line in Xcode's build log reporting the crash:\r\n\r\n/Development/Klee/MarcXMLTool/Entities/mogend.sh: line 24:  7501 Segmentation fault: 11  mogenerator --template-var arc=true --model \"${INPUT_FILE_PATH}/${INPUT_FILE_BASE}.xcdatamodel\" --output-dir \"${INPUT_FILE_DIR}/\" --base-class JDManagedObject\r\n\r\nIs there anything not too complex I can do to debug this? I looked at the crash report, and it looks like the crash happens in a call to retain.\r\n\r\nHere is the start of the crash report:\r\n\r\n\r\nProcess:         mogenerator [7501]\r\nPath:            /usr/bin/mogenerator\r\nIdentifier:      mogenerator\r\nVersion:         ??? (???)\r\nCode Type:       X86-64 (Native)\r\nParent Process:  sh [7499]\r\n\r\nDate/Time:       2011-12-18 02:46:14.417 +0100\r\nOS Version:      Mac OS X 10.7.2 (11C74)\r\nReport Version:  9\r\n\r\nCrashed Thread:  0  Dispatch queue: com.apple.main-thread\r\n\r\nException Type:  EXC_BAD_ACCESS (SIGSEGV)\r\nException Codes: 0x000000000000000d, 0x0000000000000000\r\n\r\nVM Regions Near 0:\r\n--> \r\n    __TEXT                 000000010c99e000-000000010c9c1000 [  140K] r-x/rwx SM=COW  /usr/bin/mogenerator\r\n\r\nApplication Specific Information:\r\nobjc_msgSend() selector name: release\r\nobjc[7501]: garbage collection is OFF\r\n\r\nThread 0 Crashed:: Dispatch queue: com.apple.main-thread\r\n0   libobjc.A.dylib               \t0x00007fff884d6e90 objc_msgSend + 16\r\n1   libobjc.A.dylib               \t0x00007fff884dc03c (anonymous namespace)::AutoreleasePoolPage::pop(void*) + 434\r\n2   com.apple.CoreFoundation      \t0x00007fff8e634f75 _CFAutoreleasePoolPop + 37\r\n3   com.apple.Foundation          \t0x00007fff8fca67a3 -[NSAutoreleasePool drain] + 154\r\n4   mogenerator                   \t0x000000010c9ace12 DDCliAppRunWithClass + 101\r\n5   mogenerator                   \t0x000000010c99ef0c start + 52\r\n\r\nThread 1:: Dispatch queue: com.apple.libdispatch-manager\r\n0   libsystem_kernel.dylib        \t0x00007fff861de7e6 kevent + 10\r\n1   libdispatch.dylib             \t0x00007fff8adea5be _dispatch_mgr_invoke + 923\r\n2   libdispatch.dylib             \t0x00007fff8ade914e _dispatch_mgr_thread + 54\r\n\r\nThread 2:\r\n0   libsystem_kernel.dylib        \t0x00007fff861de192 __workq_kernreturn + 10\r\n1   libsystem_c.dylib             \t0x00007fff89911594 _pthread_wqthread + 758\r\n2   libsystem_c.dylib             \t0x00007fff89912b85 start_wqthread + 13\r\n\r\nThread 3:\r\n0   libsystem_kernel.dylib        \t0x00007fff861de192 __workq_kernreturn + 10\r\n1   libsystem_c.dylib             \t0x00007fff89911594 _pthread_wqthread + 758\r\n2   libsystem_c.dylib             \t0x00007fff89912b85 start_wqthread + 13\r\n\r\nThread 0 crashed with X86 Thread State (64-bit):\r\n  rax: 0x00007f8408829960  rbx: 0x00007f8408829038  rcx: 0x00007f8408829958  rdx: 0x00000000a1a1a1a1\r\n  rdi: 0x00007f8409a6ee80  rsi: 0x00007fff8810a5f8  rbp: 0x00007fff6c599110  rsp: 0x00007fff6c598cc0\r\n   r8: 0x0000000000000003   r9: 0x00007f8409a39b80  r10: 0x00000000bc4da2d9  r11: 0xe00007f8409a6300\r\n  r12: 0x00007f8408829000  r13: 0x0000000000000000  r14: 0x00007f8408829000  r15: 0xa3a3a3a3a3a3a3a3\r\n  rip: 0x00007fff884d6e90  rfl: 0x0000000000010246  cr2: 0x00007fff73e14048\r\nLogical CPU: 2\r\n","number":80,"url":"https://api.github.com/repos/rentzsch/mogenerator/issues/80","comments":4,"assignee":null},"comment":{"user":{"id":101319,"login":"jdmuys","url":"https://api.github.com/users/jdmuys","avatar_url":"https://secure.gravatar.com/avatar/deed51cddc830e162557b8f01383a057?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"deed51cddc830e162557b8f01383a057"},"created_at":"2011-12-18T02:34:20Z","updated_at":"2011-12-18T02:34:20Z","id":3192862,"body":"with Zombies enabled, I get more info:\r\n\r\n2011-12-18 03:10:02.624 mogenerator[8749:707] *** -[CFString release]: message sent to deallocated instance 0x100145140\r\n\r\ninfo malloc on that address yields:\r\n\r\n\r\nAlloc: Block address: 0x0000000100145140 length: 48\r\nStack - pthread: 0x7fff74318960 number of frames: 14\r\n    0: 0x7fff899613ed in malloc_zone_malloc\r\n    1: 0x7fff8e607310 in _CFRuntimeCreateInstance\r\n    2: 0x7fff8e606e1e in __CFStringCreateImmutableFunnel3\r\n    3: 0x7fff8e696ed7 in _CFStringCreateWithBytesNoCopy\r\n    4: 0x7fff8fcfb48d in -[NSString initWithContentsOfFile:encoding:error:]\r\n    5: 0x7fff8fcfb3f2 in +[NSString stringWithContentsOfFile:encoding:error:]\r\n    6: 0x100013697 in -[MiscMergeTemplate contentsOfFileWithName:] at /Volumes/Data/Development/mogenerator/MiscMerge/../MiscMerge/MiscMergeTemplate.m:137\r\n    7: 0x1000144d9 in -[MiscMergeTemplate parseContentsOfFile:] at /Volumes/Data/Development/mogenerator/MiscMerge/../MiscMerge/MiscMergeTemplate.m:447\r\n    8: 0x1000068fa in engineWithTemplatePath at /Volumes/Data/Development/mogenerator/mogenerator.m:308\r\n    9: 0x1000057ec in -[MOGeneratorApp application:runWithArguments:] at /Volumes/Data/Development/mogenerator/mogenerator.m:631\r\n   10: 0x100018718 in -[DDCliApplication runWithClass:] at /Volumes/Data/Development/mogenerator/ddcli/DDCliApplication.m:76\r\n   11: 0x100018a67 in DDCliAppRunWithClass at /Volumes/Data/Development/mogenerator/ddcli/DDCliApplication.m:113\r\n   12: 0x100006978 in main at /Volumes/Data/Development/mogenerator/mogenerator.m:765\r\n   13: 0x100001a64 in start\r\n\r\nso it sounds like the string under scrutiny is allocated at:\r\n\r\n\r\n- (NSString *) contentsOfFileWithName:(NSString *)filename {\r\n    NSError *error = nil;\r\n    NSString *fileString = [NSString stringWithContentsOfFile:filename\r\n                                                     encoding:NSASCIIStringEncoding\r\n                                                        error:&error];\r\n\r\n\r\nNow I'd like to break on release for that string, but it looks like Xcode 4 will not allow a symbolic breakpoint to have a condition??? And breaking on all releases doesn't seem so practical...\r\n","url":"https://api.github.com/repos/rentzsch/mogenerator/issues/comments/3192862"},"action":"created"}