I am working on a small plugin for my own use and having some trouble with repeated ‘bugsplats’. I know its impossible to diagnose the specific issue from afar without knowing anything about the plugin, so I’m more wondering if there is a ‘best practice’ that is used to identify, track and resolve these types of errors that folks use and they would be willing to share?
My specific issue at the moment is with a small personal plugin I am making to help me automate and speed up some of my own workflow. The crashing seems a bit ‘irregular’ - that is, sometimes the plugin works great and as expected, and then sometimes it errors on me and ‘splats’. As far as the specific error giving me an issue at the moment, I have reviewed the crash log files (on my Mac OS they are saved in ~/Library/Logs/DiagnosticReports/…) and they seem to show the same (or at least similar) error pretty consistently for each ‘splat’. Sample header:
Process: SketchUp  Path: /Applications/SketchUp 2019/SketchUp.app/Contents/MacOS/SketchUp Identifier: com.sketchup.SketchUp.2019 Version: 19.1 (19.1.173) Code Type: X86-64 (Native) Parent Process: ???  Responsible: SketchUp  OS Version: Mac OS X 10.14.3 (18D109) Report Version: 12 Crashed Thread: 0 CrBrowserMain Dispatch queue: com.apple.main-thread Exception Type: EXC_BAD_ACCESS (SIGSEGV) Exception Codes: KERN_INVALID_ADDRESS at 0x0000000000000010 Exception Note: EXC_CORPSE_NOTIFY Termination Signal: Segmentation fault: 11 Termination Reason: Namespace SIGNAL, Code 0xb Terminating Process: exc handler  VM Regions Near 0x10: --> __TEXT 000000010369a000-0000000103ec7000 [ 8372K] r-x/rwx SM=COW /Applications/SketchUp 2019/SketchUp.app/Contents/MacOS/SketchUp Application Specific Information: Performing @selector(invokeCommand:) from sender NSMenuItem 0x600002131c20. . .
the Exception Type ‘EXEC_BAD_ADDRESS (SIGSEGV)’ and Code: ‘INVALID_ADDRESS at …’ seem to be the issue in all the crashes logged that I can see. Can anyone shed a little light on what those items mean and how I might go about sussing out the offending code based on those errors? Or are those errors too vague to know what they are referring to? Google searching those error types didn’t yield much for me unfortunately.
Oddly, if a file crashes when I run the plugin and I just simply open it back up and try again - it then will work fine almost every time.
Any thoughts or suggestions on where / how I might go about cleaning up these issues would be greatly appreciated - or if there is a resource that you might think would be helpful to review when it comes to error-fixing or building code to be more robust against this sort of thing, that would also be really appreciated for the future.