faldor20 / tree-sitter-roc

MIT License
27 stars 13 forks source link

This tree-sitter seems to cause a crash in my emacs #18

Closed adrian4096 closed 5 months ago

adrian4096 commented 5 months ago

Sorry for the poor diagnostics provided, but to the best of my ability this tree-sitter seems to be the code responsible for causing a crash in my emacs due to stack corruption. Since i am inexperienced I currently don't know of a way to easily git bisect to find the offending issue. My emacs version is GNU Emacs 29.3 downloaded as the arch emacs-wayland package. (I have tried other emacs packages to same result (emacs, emacs-nativecomp)) The config for the emacs is provided by doom-emacs, specifically

GNU Emacs     v29.3            nil
Doom core     v3.0.0-pre       HEAD -> master 5b7d6763f 2024-04-11 21:51:14 -0400
Doom modules  v24.04.0-pre     HEAD -> master 5b7d6763f 2024-04-11 21:51:14 -0400

this treesitter code is installed by roc-mode The output when crashing is:

Details ``` *** stack smashing detected ***: terminated Fatal error 6: Aborted Backtrace: emacs(+0x140096)[0x57c6dc40f096] emacs(+0x20330)[0x57c6dc2ef330] emacs(+0x21153)[0x57c6dc2f0153] emacs(+0x29ad8d)[0x57c6dc569d8d] /usr/lib/libc.so.6(+0x3c770)[0x73193505a770] /usr/lib/libc.so.6(+0x8d32c)[0x7319350ab32c] /usr/lib/libc.so.6(gsignal+0x18)[0x73193505a6c8] /usr/lib/libc.so.6(abort+0xd7)[0x7319350424b8] /usr/lib/libc.so.6(+0x25395)[0x731935043395] /usr/lib/libc.so.6(+0x11473b)[0x73193513273b] /usr/lib/libc.so.6(+0x115a56)[0x731935133a56] emacs(+0x24a063)[0x57c6dc519063] /usr/lib/emacs/29.3/native-lisp/29.3-4b59e32f/treesit-37439c61-97df641d.eln(F747265657369742d666f6e742d6c6f636b2d666f6e746966792d726567696f6e_treesit_font_lock_fontify_region_0+0x1f2)[0x731926872832] emacs(+0x1b661e)[0x57c6dc48561e] /usr/bin/../lib/emacs/29.3/native-lisp/29.3-4b59e32f/preloaded/font-lock-895216f6-1f3b244f.eln(F666f6e742d6c6f636b2d666f6e746966792d73796e746163746963616c6c792d726567696f6e_font_lock_fontify_syntactically_region_0+0x62)[0x731930786f42] emacs(+0x1b661e)[0x57c6dc48561e] /usr/bin/../lib/emacs/29.3/native-lisp/29.3-4b59e32f/preloaded/font-lock-895216f6-1f3b244f.eln(F666f6e742d6c6f636b2d64656661756c742d666f6e746966792d726567696f6e_font_lock_default_fontify_region_0+0x4af)[0x731930784bef] emacs(+0x1b661e)[0x57c6dc48561e] /usr/bin/../lib/emacs/29.3/native-lisp/29.3-4b59e32f/preloaded/font-lock-895216f6-1f3b244f.eln(F666f6e742d6c6f636b2d666f6e746966792d726567696f6e_font_lock_fontify_region_0+0x93)[0x731930783873] emacs(+0x2078be)[0x57c6dc4d68be] emacs(+0x1b661e)[0x57c6dc48561e] emacs(+0x1bac31)[0x57c6dc489c31] emacs(+0x1b567c)[0x57c6dc48467c] /usr/bin/../lib/emacs/29.3/native-lisp/29.3-4b59e32f/preloaded/jit-lock-8a988e43-a9956d8b.eln(F6a69742d6c6f636b2d2d72756e2d66756e6374696f6e73_jit_lock__run_functions_0+0xd8)[0x7319303e3c88] emacs(+0x1b661e)[0x57c6dc48561e] /usr/bin/../lib/emacs/29.3/native-lisp/29.3-4b59e32f/preloaded/jit-lock-8a988e43-a9956d8b.eln(F6a69742d6c6f636b2d666f6e746966792d6e6f77_jit_lock_fontify_now_0+0x80a)[0x7319303e459a] emacs(+0x1b661e)[0x57c6dc48561e] /usr/bin/../lib/emacs/29.3/native-lisp/29.3-4b59e32f/preloaded/jit-lock-8a988e43-a9956d8b.eln(F6a69742d6c6f636b2d66756e6374696f6e_jit_lock_function_0+0x26f)[0x7319303e398f] emacs(+0x1b661e)[0x57c6dc48561e] emacs(+0x29e8d1)[0x57c6dc56d8d1] emacs(+0x4d90b)[0x57c6dc31c90b] emacs(+0x53a10)[0x57c6dc322a10] emacs(+0x57d96)[0x57c6dc326d96] emacs(+0x5da76)[0x57c6dc32ca76] emacs(+0x54976)[0x57c6dc323976] emacs(+0x175500)[0x57c6dc444500] emacs(+0x1757e8)[0x57c6dc4447e8] /usr/bin/../lib/emacs/29.3/native-lisp/29.3-4b59e32f/preloaded/simple-fab5b0cf-9ff4140c.eln(F626567696e6e696e672d6f662d76697375616c2d6c696e65_beginning_of_visual_line_0+0x72)[0x731931d8b132] emacs(+0x1b661e)[0x57c6dc48561e] /home/adrian/.emacs.d/.local/cache/eln/29.3-4b59e32f/nav-flash-1e91dd13-5b50e800.eln(F6e61762d666c6173682d73686f77_nav_flash_show_0+0x678)[0x731925314868] emacs(+0x1ba85e)[0x57c6dc48985e] ... Aborted (core dumped) ```

Thanks to everyone in advance for supporting me through this issue, which is probably my fault. If you need any more logs, please tell me where to find them :)

faldor20 commented 5 months ago

Does this always happen? If not can you provide a code example where the issue is present.

adrian4096 commented 5 months ago

So far i've had a 100% crash rate when opening any roc file. As an example you could check if there's anything special with https://ass.si/git/adrian/skovir2. I have also attempted to open List.roc from builtins. Which wasn't successful

adrian4096 commented 5 months ago

My apologies, it seems that after recompiling emacs with debug info, the crash seems to have disappeared. Meaning that this module might not be at fault. Closing for now