appledoc
appledoc copied to clipboard
How to debug segmentation fault: 11?
Hi, I've:
- cloned appledoc to my Mac (10.8.5) with the GitHub app
- opened it with Xcode Version 5.0.2 (5A3005) and built it
- copied the binary to some location
- put a symlink to that in /usr/local/bin
- created a Documentation target as per your tutorial
- replaced the 3 company vars in the script
- set --ignore fmdb because on the first run appledoc crashed on FMDatabase.m, which I use on my project
- ~/help exists with full permissions (777)
- appledoc crashes after a lot of logging with a segfault.
Some strings are cut off:
- Finishe/Users/me/...
- --docset-fallback-url "${compa
Final part of the logs (edited for privacy, […] indicates I've removed a lot of similar lines):
[...] Unregistering empty sections... Finished processing method -[MPRabc willBuildRequest]. Removing undocumented object MPRabc... Finished processing class MPRabc. Processing class MPRaaa... Processing method +[MPRaaa enableLogging:]... Removing undocumented method +[MPRaaa enableLogging:]... Unregistering empty sections... Finishe/Users/me/.../MPRxyz.h:65: warning: MPRzzz is not documented! […] /Users/me/.../MPRxyz.h:57: warning: MPRxxx is not documented! /Users/me/Library/Developer/Xcode/DerivedData/MPR-fgzjhhitzkxfnbdacmhzhgekogrn/Build/Intermediates/MyProject.build/Debug-iphoneos/Documentation.build/Script-A993560F19E4618300DC3E9F.sh: line 29: 92653 Segmentation fault: 11 /usr/local/bin/appledoc --project-name "${PROJECT_NAME}" --project-company "${company}" --company-id "${companyID}" --docset-atom-filename "${company}.atom" --docset-feed-url "${companyURL}/${company}/%DOCSETATOMFILENAME" --docset-package-url "${companyURL}/${company}/%DOCSETPACKAGEFILENAME" --docset-fallback-url "${compa
This is log level 6. I've tried other values but they ere no more useful. How can I know what's going on? No stack trace is shown and part of the messages seem truncated (no other logging level fixes that).
Hi!
You can try launching appledoc from Xcode and have it stop on exception. That might provide some more clues.
But otherwise, if log doesn't point to item that's failing, try excluding all your project files and then slowly add them back so that you narrow down the file. Then create a copy of file in question and only run appledoc over it; again try to remove/add parts until you narrow down to the method or declaration that causes problems.
Quick tip: currently appledoc is not working well with block typedefs.
Best, Tom
On 08 Oct 2014, at 14:44, entonio [email protected] wrote:
Hi, I've:
cloned appledoc to my Mac (10.8.5) with the GitHub app opened it with Xcode Version 5.0.2 (5A3005) and built it copied the binary to some location put a symlink to that in /usr/local/bin created a Documentation target as per your tutorial replaced the 3 company vars in the script set --ignore fmdb because on the first run appledoc crashed on FMDatabase.m, which I use on my project ~/help exists with full permissions (777) appledoc crashes after a lot of logging with a segfault. Some strings are cut off:
Finishe/Users/me/... --docset-fallback-url "${compa Final part of the logs (edited for privacy, […] indicates I've removed a lot of similar lines):
[...] Unregistering empty sections... Finished processing method -[MPRabc willBuildRequest]. Removing undocumented object MPRabc... Finished processing class MPRabc. Processing class MPRaaa... Processing method +[MPRaaa enableLogging:]... Removing undocumented method +[MPRaaa enableLogging:]... Unregistering empty sections... Finishe/Users/me/.../MPRxyz.h:65: warning: MPRzzz is not documented! […] /Users/me/.../MPRxyz.h:57: warning: MPRxxx is not documented! /Users/me/Library/Developer/Xcode/DerivedData/MPR-fgzjhhitzkxfnbdacmhzhgekogrn/Build/Intermediates/MyProject.build/Debug-iphoneos/Documentation.build/Script-A993560F19E4618300DC3E9F.sh: line 29: 92653 Segmentation fault: 11 /usr/local/bin/appledoc --project-name "${PROJECT_NAME}" --project-company "${company}" --company-id "${companyID}" --docset-atom-filename "${company}.atom" --docset-feed-url "${companyURL}/${company}/%DOCSETATOMFILENAME" --docset-package-url "${companyURL}/${company}/%DOCSETPACKAGEFILENAME" --docset-fallback-url "${compa
This is log level 6. I've tried other values but they ere no more useful. How can I know what's going on? No stack trace is shown and part of the messages seem truncated (no other logging level fixes that).
— Reply to this email directly or view it on GitHub https://github.com/tomaz/appledoc/issues/487.
Hi! Thanks for your reply.
No amount of tinkering with my project solved the issue, even with no files at all the exact same things happens. I've tried running appledoc from Xcode and what I got was an EXC_BAD_ACCESS 0x0 at objc_msgSend_vtable0 called on behalf of 0x1000c9b92: movq 495759(%rip), %rsi ; "init" (shown below) in GRMustacheImplicitIteratorExpression.
Apparently, this happens on the output phase:
[...] Finished processing blocks MPRXyzErrorBlock. Finished processing in 376ms.
Generating output... Initializing generator with settings provider GBApplicationSettingsProvider... Generating output from parsed objects... Initializing generation steps... Initializing output generators array... Initializing output generator with settings provider GBApplicationSettingsProvider... Initializing output generator with settings provider GBApplicationSettingsProvider... Initializing output generator with settings provider GBApplicationSettingsProvider... Initializing output generator with settings provider GBApplicationSettingsProvider... Initializing output generator with settings provider GBApplicationSettingsProvider... Running generation steps... Generation step 1/5: Running GBHTMLOutputGenerator... Copying template files from '~/.appledoc/html' to '~/help/html'... Removing output at '~/help/html'... Copying template files from '~/.appledoc/html' to '~/help/html'... Removing temporary files from '~/help/html'... Creating template handler for template file '~/.appledoc/html/document-template.html'... Parsing template from /Users/antonio/.appledoc/html/document-template.html... Clearing parsed values... Clearing parsed values... Found section template GBCommentComponentsList at line 45... Found section template GBCommentComponent at line 49... Removing template file 'document-template.html' from output... Creating template handler for template file '~/.appledoc/html/hierarchy-template.html'... Parsing template from /Users/antonio/.appledoc/html/hierarchy-template.html... Clearing parsed values... Clearing parsed values... Found section template Classes at line 95... Found section template Navigation at line 105... Removing template file 'hierarchy-template.html' from output... Creating template handler for template file '~/.appledoc/html/index-template.html'... Parsing template from /Users/antonio/.appledoc/html/index-template.html... Clearing parsed values... Clearing parsed values... Found section template Navigation at line 120... Removing template file 'index-template.html' from output... Creating template handler for template file '~/.appledoc/html/object-template.html'... Parsing template from /Users/antonio/.appledoc/html/object-template.html... Clearing parsed values... Clearing parsed values... Found section template Method at line 287... Found section template MethodDeclaration at line 369... Found section template TaskTitle at line 374... Found section template TaskMethod at line 379... Found section template TaskSelector at line 389... Found section template GBCommentComponentsList at line 394... Found section template BlocksDefList at line 398... Found section template Constant at line 447... Found section template Block at line 468... Found section template GBCommentComponent at line 490... Found section template ObjectSpecification at line 494... Found section template Navigation at line 502... Found section template JumpTo at line 509... Found section template TableOfContents at line 547… EXC!
The exc is inside this:
appledoc`+[GRMustacheImplicitIteratorExpression initialize] at GRMustacheImplicitIteratorExpression.m:30: 0x1000c9b7c: pushq %rbp 0x1000c9b7d: movq %rsp, %rbp 0x1000c9b80: pushq %rbx 0x1000c9b81: pushq %rax 0x1000c9b82: movq 505431(%rip), %rsi ; "alloc" 0x1000c9b89: movq 370096(%rip), %rbx ; (void *)0x00007fff876b2240: objc_msgSend 0x1000c9b90: callq *%rbx 0x1000c9b92: movq 495759(%rip), %rsi ; "init" 0x1000c9b99: movq %rax, %rdi 0x1000c9b9c: callq *%rbx 0x1000c9b9e: movq %rax, 593475(%rip) ; instance 0x1000c9ba5: addq $8, %rsp 0x1000c9ba9: popq %rbx 0x1000c9baa: popq %rbp 0x1000c9bab: ret
I have the same issue. Even when trying to generate doc from a single trivial header with no appledoc I get a segfault:
... DEBUG | Found section template Navigation at line 424... DEBUG | Found section template JumpTo at line 431... DEBUG | Found section template TableOfContents at line 469... Segmentation fault: 11
appledoc invocation:
$ ./appledoc --verbose 6 -h --project-name test --output ~/Projects/Help/test3 --project-company company --company-id com.company.test ~/Documents/test.h
Best regards, Antonis
Tried again from within XCode. Crashed with EXC_BAD_ACCESS :(
@tomaz any workarounds for this?
Here's a screenshot (please let me know if you need any more data):
Make sure you're using latest template files. Other than that try to selectively parse increasingly larger subset of your files until you isolate the one that's causing issues, then check which part is the culprit...
This is an internal appledoc issue. It doesn't matter what project you use, appledoc will crash while loading the templates - and the templates are the ones installed by the very revision of appledoc that we're testing. @atsakiridis, there is a prebuilt binary posted in one of the other issues which works for me, I can't find the link now but @tomaz likely can?
Exactly, as @entonio noted, I haven't messed with the template files. I cloned the appledoc repo yesterday afresh and built the project right after that to come up with appledoc executable. Moreover, I have tried with a very simple setup: the target of appledoc is a single header file, from which I also tried removing all appledoc comments, just to start as simple as possible. Still it crashes. @tomaz, if there is a prebuilt binary that works, that would help a lot.
Thanks
Hmm, there must have been something broken in latest commits.
You can find precompiled binaries on releases page. It is somewhat obscure - you can find the link on top of the main repo page: 4 links there: commits, branches, releases and contributors...
Thanks for the info @tomaz. I tried 2.2 build 963 and worked fine :)