How to debug atom crash (on OSX)?


I am trying to load a rather large (approx 1 MB) JavaScript file into my Atom extension (the JS is created by the ghcjs Haskell compiler). This works, and I can call into generated code and am getting the output I expect, but after that happens I immediately get “The editor has crashed. Please report this issue to”, and then “Keep it Open”, “Reload” or “Close Window”.

I start atom as atom -d -f, and I’ve set the ATOM_DEV_RESOURCE_PATH environment variable; I open the dev tools before running my code. On my console I see

[10037:0206/195103:INFO:CONSOLE(62)] "Window load time: 4354ms", source: file:///Users/dev/wt/util/atom/src/atom/static/index.js (62)
[10037:0206/195138:INFO:CONSOLE(24)] "Jstest was toggled!", source: /Users/dev/wt/util/atom/jstest/lib/ (24)
[10037:0206/195138:INFO:CONSOLE(23427)] "Hello world
", source: /Users/dev/wt/util/atom/jstest/hs/Hello.js (23427)

and then nothing; on my dev tools console I see the same Hello world being output, and then nothing else, no stack trace, no nothing. I’ve tried to hook up lldb to atom while it runs, in the hope that that would give me a clue as to where things are going wrong, but they don’t show anything other than that at the point where I get the The editor has crashed error message the Atom Helper --type=renderer and Atom Helper --eval processes both terminate (normally, no exception, exit status 0) and the main Atom process as well as the Atom Helper --type=gpu-process processes keep running normally. I have also checked and that doesn’t list anything.

I don’t know how to debug this any further, or how to get any clues as to what’s wrong. Some sort of stack trace (even to C libraries or something) would be helpful.

Any suggestions appreciated!


@zcbenz, do you have any suggestions?


Aha! It turns out the generated code called process.exit. So that explains why the process terminated normally. Not sure if there’s anything that atom should do differently here.