Hello all,
I have been working on an application project in ApplescriptObjC and Xcode 4.6. Some details of what my project entails can be found in a recent post where I asked for advice on the main function of the application (link below).
http://macscripter.net/viewtopic.php?id=40329
For this particular project, I am actually reading 2 different log files and displaying them in 2 tableviews in the application’s main interface window. All of that functions mostly to my liking (would like to learn how to scroll to the bottom of the updated tableview on insertion of log data), but will save that for another post after trying myself.
When my application launches (under applicationWillFinishLaunching) I have several lines of code that change file permissions via a chmod command inside of a ‘do shell script’ command. These lines utilize the ‘with administrator privileges’ notation after each (which may be repetitive and also I suspect the cause for the crash).
Two buttons in the interface are used to manually refresh the log file. After each refresh, the log file’s contents will be displayed, sometimes showing the updated lines since the last update. I believe, based on the code supplied in the link above, that the log files are fully passed through the array controllers each time (which also may be the cause for the crash).
What I am experiencing is that whenever one of the buttons to manually refresh the log file tableview (either) is clicked multiple times, such as repeatedly to see any additional contents of the log, the application crashes with a EXC_BAD_ACCESS error on multiple threads. The best details I can provide (without further instruction) are displayed below. I have read Shane Stanley’s section on memory management in ApplescriptObjcC Explored (thanks Shane, a wonderful resource!) about the differences between ARC and garbage collection methods of memory management. As such, I attempted to troubleshoot the application by enabling ARC to see if the crashes still occur, which they do, on the same threads with the same EXC_BAD_ACCESS error. I have also set a delay timer of 5 (max I want for user friendliness) to see if spacing out the refreshes that way will in any way impact the crashes (it does not).
come.apple.main-thread (serial)
Thread 1
0 objc_msgSend
line showing error is:
0x1005ac250: movq 16(%r11), %r10
error is:
Thread 1: EXC_BAD_ACCESS (code=13, address=0x0)
Thread 1 shows 3 more crashes same error as above, but in differently numbered areas of the application.
31 NSApplicationMain
32 main
33 start
There are additional Threads, but most show the exact same EXC_BAD_ACCESS. My purpose for the post is obviously to get assistance getting my application running reliably, but also to establish a pattern of troubleshooting for others to try to follow. Many Google searches on this error turn up application-specific issues, very few (other than this forum) attributed to ASOC. If this type of crash has been documented further, I will be happy consulting a link to something I have not found previously, and very appreciative!
It would seem from reading around that either at launch or at some early function of the application a reference is being made to something that is not getting closed as the application continues to run. Any help is greatly appreciated!