Closed kvnh closed 5 years ago
Thanks for the report @kvnh! Based on the crash log this looks related to Tree-sitter -
When typing an 'if' statement in a django view, pressing space after the if will cause atom to crash
Can you share a minimal example file that we can use to reproduce?
@rsese Unfortunately I can't. When I extract that view to its own python file then the problem doesn't happen any more. I've tried extracting the view and surrounding views but still can't replicate. The source file has several thousand lines of code so I can't send that. I've used another editor to bypass the problem in the meantime, but I'm not sure what the next steps are to help.
I've just started getting the same problem (just after running the latest updates on my CentOS 7 machine, but I think that's probably a coincidence). It's reproducible for me with the attached file (running in a fresh Atom session in a fresh directory containing only this file).
Reproducible symptoms: On an empty line (at least line 13 - if I do this before or in between the first four import statements there's no crash):
if a: #no problem
[a if b] # no problem, as long as it's typed inside the brackets.
a if #crash
Also crashes when backspacing from the end of a line hits the if
.
Disabling language-python
plugin and restarting avoids the crash.
Typing a if
at the end of the file also avoids the crash. Working backwards from the end of the file, it appears the last line where typing this string triggers the crash is 2626 (level of indent doesn't appear to matter). Below that point, I note that typing a if
on an otherwise empty line messes up the parsing of triple-quoted strings all the way to the end of the file where simply typing if
doesn't - I strongly suspect this behaviour is a symptom of the same bug.
I'm experiencing the same issue. The file i'm working with is a fairly large one. The issue sometimes also occurs when using something that involves brackets like casting a str or int, but doesn't seem to include 'for' these are all cases where the editor is 'looking' for an end of the statement. I've found that if you start your if statements with the end of the statement i.e. ':' and start your brackets with the closed bracket the crash doesn't occur.
@rsese I can reproduce this with the file and steps that @tristanic shared.
Same with 1.37.0-nightly31 on macOS 10.12.6, thanks @tristanic @Ben3eeE :+1: The crash log looks pretty similar to the crash log in the OP too. I'll update the issue body.
👋 @kvnh @tristanic Thanks so much for providing the exact reproduction steps. I wrote this bug, and these steps show exactly what the problem is. As you might expect, it's a problem with our Python parser, tree-sitter-python. I'll fix it right away.
Oh wow, I'm sorry; this has actually already been fixed for a while (https://github.com/tree-sitter/tree-sitter-python/commit/250cc7863b34b725b0aacc6c6bf35bbbdcadcca3), but I failed to update the dependency in Atom!
This issue has been automatically locked since there has not been any recent activity after it was closed. If you can still reproduce this issue in Safe Mode then please open a new issue and fill out the entire issue template to ensure that we have enough information to address your issue. Thanks!
Edit by @rsese to add repro steps from https://github.com/atom/atom/issues/19062#issuecomment-478061010
Test file to repro with: https://github.com/atom/atom/files/3023460/molobject.py.tar.gz
a if
Expect no crash, Atom crashes though doesn't reproduce with Tree-sitter disabled.
Reproduced with 1.37.0-nightly31 on macOS 10.12.6, crash log looks similar to the OP's crash log.
Full comment (https://github.com/atom/atom/issues/19062#issuecomment-478061010) with more observations copied below:
Prerequisites
Description
When typing an 'if' statement in a django view, pressing space after the if will cause atom to crash
Dialog with 'The editor has crashed' appears with the option to 'keep it open', 'reload' and 'close window'
Steps to Reproduce
Expected behavior: if statement to complete
Actual behavior: atom crashes
Reproduces how often: 100% within certain django views. In other views there are no issues.
Versions
You can get this information from copy and pasting the output of
atom --version
andapm --version
from the command line. Also, please include the OS and what version of the OS you're running.atom --version Atom : 1.35.1 Electron: 2.0.18 Chrome : 61.0.3163.100 Node : 8.9.3
apm --version apm 2.1.3 npm 6.2.0 node 8.9.3 x64 atom 1.35.1 python 2.7.10 git 2.20.1
running macOS Mojave 10.14.3 MacBook Pro (13-inch, 2017, Two Thunderbolt 3 ports)
Additional Information
Any additional information, configuration or data that might be necessary to reproduce the issue.
Edit by @rsese to hide crash log for easier scanning of the issue
Crash log
``` Crash report: Process: Atom Helper [75825] Path: /Applications/Atom.app/Contents/Frameworks/Atom Helper.app/Contents/MacOS/Atom Helper Identifier: Atom Helper Version: 1.35.1 (1.35.1) Code Type: X86-64 (Native) Parent Process: Atom [75706] Responsible: Atom [75706] User ID: 501 Date/Time: 2019-03-26 11:59:24.482 +0000 OS Version: Mac OS X 10.14.3 (18D109) Report Version: 12 Anonymous UUID: D4F7B41B-92B3-6774-CF36-99381B16454A Sleep/Wake UUID: CDB401D1-9151-463C-AFE8-3D210D2CAA7E Time Awake Since Boot: 630000 seconds Time Since Wake: 4100 seconds System Integrity Protection: enabled Crashed Thread: 14 Exception Type: EXC_CRASH (SIGABRT) Exception Codes: 0x0000000000000000, 0x0000000000000000 Application Specific Information: terminating with uncaught exception of type std::length_error: vector abort() called Thread 0:: CrRendererMain Dispatch queue: com.apple.main-thread 0 libsystem_kernel.dylib 0x00007fff6dfa317a mach_msg_trap + 10 1 libsystem_kernel.dylib 0x00007fff6dfa36d0 mach_msg + 60 2 com.apple.CoreFoundation 0x00007fff40c18fde __CFRunLoopServiceMachPort + 337 3 com.apple.CoreFoundation 0x00007fff40c1852d __CFRunLoopRun + 1654 4 com.apple.CoreFoundation 0x00007fff40c17c64 CFRunLoopRunSpecific + 463 5 com.apple.Foundation 0x00007fff42f7e4aa -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 280 6 com.github.electron.framework 0x000000010308611e 0x102df2000 + 2703646 7 com.github.electron.framework 0x0000000103084ccc 0x102df2000 + 2698444 8 com.github.electron.framework 0x000000010309b083 0x102df2000 + 2789507 9 com.github.electron.framework 0x0000000103a48181 0x102df2000 + 12935553 10 com.github.electron.framework 0x000000010324c560 0x102df2000 + 4564320 11 com.github.electron.framework 0x0000000104e5d804 0x102df2000 + 33994756 12 com.github.electron.framework 0x000000010324b374 0x102df2000 + 4559732 13 com.github.electron.framework 0x0000000102df4a04 AtomMain + 68 14 com.github.atom.helper 0x0000000100b58f26 main + 38 15 libdyld.dylib 0x00007fff6de69ed9 start + 1 Thread 1:: TaskSchedulerServiceThread 0 libsystem_kernel.dylib 0x00007fff6dfa9716 kevent + 10 1 com.github.electron.framework 0x00000001030ec849 0x102df2000 + 3123273 2 com.github.electron.framework 0x00000001030eb9cd 0x102df2000 + 3119565 3 com.github.electron.framework 0x0000000103084b10 0x102df2000 + 2698000 4 com.github.electron.framework 0x000000010309b083 0x102df2000 + 2789507 5 com.github.electron.framework 0x00000001030bf119 0x102df2000 + 2937113 6 com.github.electron.framework 0x000000010308fd47 0x102df2000 + 2743623 7 libsystem_pthread.dylib 0x00007fff6e05d305 _pthread_body + 126 8 libsystem_pthread.dylib 0x00007fff6e06026f _pthread_start + 70 9 libsystem_pthread.dylib 0x00007fff6e05c415 thread_start + 13 Thread 2:: Chrome_ChildIOThread 0 libsystem_kernel.dylib 0x00007fff6dfa9716 kevent + 10 1 com.github.electron.framework 0x00000001030ec849 0x102df2000 + 3123273 2 com.github.electron.framework 0x00000001030eb9cd 0x102df2000 + 3119565 3 com.github.electron.framework 0x0000000103084b10 0x102df2000 + 2698000 4 com.github.electron.framework 0x000000010309b083 0x102df2000 + 2789507 5 com.github.electron.framework 0x00000001030bf119 0x102df2000 + 2937113 6 com.github.electron.framework 0x000000010308fd47 0x102df2000 + 2743623 7 libsystem_pthread.dylib 0x00007fff6e05d305 _pthread_body + 126 8 libsystem_pthread.dylib 0x00007fff6e06026f _pthread_start + 70 9 libsystem_pthread.dylib 0x00007fff6e05c415 thread_start + 13 Thread 3:: GpuMemoryThread 0 libsystem_kernel.dylib 0x00007fff6dfa317a mach_msg_trap + 10 1 libsystem_kernel.dylib 0x00007fff6dfa36d0 mach_msg + 60 2 com.apple.CoreFoundation 0x00007fff40c18fde __CFRunLoopServiceMachPort + 337 3 com.apple.CoreFoundation 0x00007fff40c1852d __CFRunLoopRun + 1654 4 com.apple.CoreFoundation 0x00007fff40c17c64 CFRunLoopRunSpecific + 463 5 com.github.electron.framework 0x0000000103085e0f 0x102df2000 + 2702863 6 com.github.electron.framework 0x0000000103084ccc 0x102df2000 + 2698444 7 com.github.electron.framework 0x000000010309b083 0x102df2000 + 2789507 8 com.github.electron.framework 0x00000001030bf119 0x102df2000 + 2937113 9 com.github.electron.framework 0x000000010308fd47 0x102df2000 + 2743623 10 libsystem_pthread.dylib 0x00007fff6e05d305 _pthread_body + 126 11 libsystem_pthread.dylib 0x00007fff6e06026f _pthread_start + 70 12 libsystem_pthread.dylib 0x00007fff6e05c415 thread_start + 13 Thread 4:: Compositor 0 libsystem_kernel.dylib 0x00007fff6dfa317a mach_msg_trap + 10 1 libsystem_kernel.dylib 0x00007fff6dfa36d0 mach_msg + 60 2 com.apple.CoreFoundation 0x00007fff40c18fde __CFRunLoopServiceMachPort + 337 3 com.apple.CoreFoundation 0x00007fff40c1852d __CFRunLoopRun + 1654 4 com.apple.CoreFoundation 0x00007fff40c17c64 CFRunLoopRunSpecific + 463 5 com.github.electron.framework 0x0000000103085e0f 0x102df2000 + 2702863 6 com.github.electron.framework 0x0000000103084ccc 0x102df2000 + 2698444 7 com.github.electron.framework 0x000000010309b083 0x102df2000 + 2789507 8 com.github.electron.framework 0x00000001030bf119 0x102df2000 + 2937113 9 com.github.electron.framework 0x000000010308fd47 0x102df2000 + 2743623 10 libsystem_pthread.dylib 0x00007fff6e05d305 _pthread_body + 126 11 libsystem_pthread.dylib 0x00007fff6e06026f _pthread_start + 70 12 libsystem_pthread.dylib 0x00007fff6e05c415 thread_start + 13 Thread 5:: Renderer::FILE 0 libsystem_kernel.dylib 0x00007fff6dfa317a mach_msg_trap + 10 1 libsystem_kernel.dylib 0x00007fff6dfa36d0 mach_msg + 60 2 com.apple.CoreFoundation 0x00007fff40c18fde __CFRunLoopServiceMachPort + 337 3 com.apple.CoreFoundation 0x00007fff40c1852d __CFRunLoopRun + 1654 4 com.apple.CoreFoundation 0x00007fff40c17c64 CFRunLoopRunSpecific + 463 5 com.github.electron.framework 0x0000000103085e0f 0x102df2000 + 2702863 6 com.github.electron.framework 0x0000000103084ccc 0x102df2000 + 2698444 7 com.github.electron.framework 0x000000010309b083 0x102df2000 + 2789507 8 com.github.electron.framework 0x00000001030bf119 0x102df2000 + 2937113 9 com.github.electron.framework 0x000000010308fd47 0x102df2000 + 2743623 10 libsystem_pthread.dylib 0x00007fff6e05d305 _pthread_body + 126 11 libsystem_pthread.dylib 0x00007fff6e06026f _pthread_start + 70 12 libsystem_pthread.dylib 0x00007fff6e05c415 thread_start + 13 Thread 6:: CompositorTileWorker1/17667 0 libsystem_kernel.dylib 0x00007fff6dfa67de __psynch_cvwait + 10 1 libsystem_pthread.dylib 0x00007fff6e060593 _pthread_cond_wait + 724 2 com.github.electron.framework 0x0000000103900369 0x102df2000 + 11592553 3 com.github.electron.framework 0x00000001030aa2ad 0x102df2000 + 2851501 4 com.github.electron.framework 0x000000010308fd47 0x102df2000 + 2743623 5 libsystem_pthread.dylib 0x00007fff6e05d305 _pthread_body + 126 6 libsystem_pthread.dylib 0x00007fff6e06026f _pthread_start + 70 7 libsystem_pthread.dylib 0x00007fff6e05c415 thread_start + 13 Thread 7:: CompositorTileWorker2/14083 0 libsystem_kernel.dylib 0x00007fff6dfa67de __psynch_cvwait + 10 1 libsystem_pthread.dylib 0x00007fff6e060593 _pthread_cond_wait + 724 2 com.github.electron.framework 0x0000000103900369 0x102df2000 + 11592553 3 com.github.electron.framework 0x00000001030aa2ad 0x102df2000 + 2851501 4 com.github.electron.framework 0x000000010308fd47 0x102df2000 + 2743623 5 libsystem_pthread.dylib 0x00007fff6e05d305 _pthread_body + 126 6 libsystem_pthread.dylib 0x00007fff6e06026f _pthread_start + 70 7 libsystem_pthread.dylib 0x00007fff6e05c415 thread_start + 13 Thread 8:: CompositorTileWorkerBackground/14339 0 libsystem_kernel.dylib 0x00007fff6dfa67de __psynch_cvwait + 10 1 libsystem_pthread.dylib 0x00007fff6e060593 _pthread_cond_wait + 724 2 com.github.electron.framework 0x0000000103900369 0x102df2000 + 11592553 3 com.github.electron.framework 0x00000001030aa2ad 0x102df2000 + 2851501 4 com.github.electron.framework 0x000000010308fd47 0x102df2000 + 2743623 5 libsystem_pthread.dylib 0x00007fff6e05d305 _pthread_body + 126 6 libsystem_pthread.dylib 0x00007fff6e06026f _pthread_start + 70 7 libsystem_pthread.dylib 0x00007fff6e05c415 thread_start + 13 Thread 9:: TaskSchedulerRendererForegroundWorker0 0 libsystem_kernel.dylib 0x00007fff6dfa67de __psynch_cvwait + 10 1 libsystem_pthread.dylib 0x00007fff6e0605c6 _pthread_cond_wait + 775 2 com.github.electron.framework 0x000000010303ea7b 0x102df2000 + 2411131 3 com.github.electron.framework 0x00000001030e4800 0x102df2000 + 3090432 4 com.github.electron.framework 0x00000001030e4931 0x102df2000 + 3090737 5 com.github.electron.framework 0x000000010309e638 0x102df2000 + 2803256 6 com.github.electron.framework 0x000000010309ec8b 0x102df2000 + 2804875 7 com.github.electron.framework 0x000000010308fd47 0x102df2000 + 2743623 8 libsystem_pthread.dylib 0x00007fff6e05d305 _pthread_body + 126 9 libsystem_pthread.dylib 0x00007fff6e06026f _pthread_start + 70 10 libsystem_pthread.dylib 0x00007fff6e05c415 thread_start + 13 Thread 10: 0 libsystem_kernel.dylib 0x00007fff6dfaa5aa __select + 10 1 com.github.electron.framework 0x0000000102f2fee2 atom::NodeBindingsMac::PollEvents() + 210 2 com.github.electron.framework 0x0000000102f2f70f atom::NodeBindings::EmbedThreadRunner(void*) + 63 3 libsystem_pthread.dylib 0x00007fff6e05d305 _pthread_body + 126 4 libsystem_pthread.dylib 0x00007fff6e06026f _pthread_start + 70 5 libsystem_pthread.dylib 0x00007fff6e05c415 thread_start + 13 Thread 11:: TaskSchedulerRendererBackgroundBlockingWorker0 0 libsystem_kernel.dylib 0x00007fff6dfa67de __psynch_cvwait + 10 1 libsystem_pthread.dylib 0x00007fff6e0605c6 _pthread_cond_wait + 775 2 com.github.electron.framework 0x000000010303ea7b 0x102df2000 + 2411131 3 com.github.electron.framework 0x00000001030e4800 0x102df2000 + 3090432 4 com.github.electron.framework 0x00000001030e4931 0x102df2000 + 3090737 5 com.github.electron.framework 0x000000010309e638 0x102df2000 + 2803256 6 com.github.electron.framework 0x000000010309ec8b 0x102df2000 + 2804875 7 com.github.electron.framework 0x000000010308fd47 0x102df2000 + 2743623 8 libsystem_pthread.dylib 0x00007fff6e05d305 _pthread_body + 126 9 libsystem_pthread.dylib 0x00007fff6e06026f _pthread_start + 70 10 libsystem_pthread.dylib 0x00007fff6e05c415 thread_start + 13 Thread 12: 0 libsystem_kernel.dylib 0x00007fff6dfa67de __psynch_cvwait + 10 1 libsystem_pthread.dylib 0x00007fff6e060593 _pthread_cond_wait + 724 2 libnode.dylib 0x0000000100e63859 uv_cond_wait + 9 3 libnode.dylib 0x0000000100e57113 0x100ca9000 + 1761555 4 libsystem_pthread.dylib 0x00007fff6e05d305 _pthread_body + 126 5 libsystem_pthread.dylib 0x00007fff6e06026f _pthread_start + 70 6 libsystem_pthread.dylib 0x00007fff6e05c415 thread_start + 13 Thread 13: 0 libsystem_kernel.dylib 0x00007fff6dfa67de __psynch_cvwait + 10 1 libsystem_pthread.dylib 0x00007fff6e060593 _pthread_cond_wait + 724 2 libnode.dylib 0x0000000100e63859 uv_cond_wait + 9 3 libnode.dylib 0x0000000100e57113 0x100ca9000 + 1761555 4 libsystem_pthread.dylib 0x00007fff6e05d305 _pthread_body + 126 5 libsystem_pthread.dylib 0x00007fff6e06026f _pthread_start + 70 6 libsystem_pthread.dylib 0x00007fff6e05c415 thread_start + 13 Thread 14 Crashed: 0 libsystem_kernel.dylib 0x00007fff6dfa923e __pthread_kill + 10 1 libsystem_pthread.dylib 0x00007fff6e05fc1c pthread_kill + 285 2 libsystem_c.dylib 0x00007fff6df121c9 abort + 127 3 libc++abi.dylib 0x00007fff6b592231 abort_message + 231 4 libc++abi.dylib 0x00007fff6b5923b5 default_terminate_handler() + 241 5 libobjc.A.dylib 0x00007fff6cd9dc8f _objc_terminate() + 105 6 libc++abi.dylib 0x00007fff6b59ddfe std::__terminate(void (*)()) + 8 7 libc++abi.dylib 0x00007fff6b59dbe2 __cxxabiv1::failed_throw(__cxxabiv1::__cxa_exception*) + 27 8 libc++abi.dylib 0x00007fff6b590bb9 __cxa_throw + 113 9 libc++.1.dylib 0x00007fff6b567711 std::__1::__vector_base_common