Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SIGSEGV During regular operation #21467

Closed
nullishamy opened this issue Dec 18, 2022 · 33 comments
Closed

SIGSEGV During regular operation #21467

nullishamy opened this issue Dec 18, 2022 · 33 comments
Labels
bug-crash issue reporting a crash or segfault has:backtrace issue contains a stacktrace/ASAN log needs:repro We need minimal steps to reproduce the issue

Comments

@nullishamy
Copy link

Neovim version (nvim -v)

NVIM v0.8.1

Vim (not Nvim) behaves the same?

no, 9.0

Operating system/version

NixOS 23.05.20221214.2f38822 (Stoat) x86_64

Terminal name/version

wezterm 20221119-145034-49b9839f

$TERM environment variable

xterm-256color

Installation

nixpkgs

How to reproduce the issue

Segfaulting appears in regular operation, inconsistently.

Expected behavior

Neovim works without segfaulting.

Actual behavior

Neovim segfaults. Backtrace:

       PID: 78517 (gdb)
       UID: 1000 (amy)
       GID: 100 (users)
    Signal: 11 (SEGV)
 Timestamp: Sun 2022-12-18 20:37:49 GMT (2min 19s ago)

Command Line: gdb /nix/store/39xg6gawi83swjp15y0d8yglv81kx8b9-neovim-unwrapped-0.8.1/bin/nvim -c /run/user/1000/coredump-XXC1VT
Executable: /nix/store/ghvw9lxj8wy3qjip2jv6qsqwvqh6r86j-gdb-12.1/bin/gdb
Control Group: /user.slice/user-1000.slice/session-2.scope
Unit: session-2.scope
Slice: user-1000.slice
Session: 2
Owner UID: 1000 (amy)
Boot ID: 77c76e7d8f5b4897ae66405eca23feeb
Machine ID: 84cac12fbb954a6c87b564a1d614a61b
Hostname: nixon
Storage: /var/lib/systemd/coredump/core.gdb.1000.77c76e7d8f5b4897ae66405eca23feeb.78517.1671395869000000.zst (present)
Size on Disk: 4.4M
Message: Process 78517 (gdb) of user 1000 dumped core.

            Module libicuuc.so.72 without build-id.
            Module libicui18n.so.72 without build-id.
            Module libicudata.so.72 without build-id.
            Module libgcc_s.so.1 without build-id.
            Module libstdc++.so.6 without build-id.
            Module libboost_regex.so.1.79.0 without build-id.
            Module libsource-highlight.so.4 without build-id.
            Module libgmp.so.10 without build-id.
            Module libmpfr.so.6 without build-id.
            Module libipt.so.2 without build-id.
            Module libexpat.so.1 without build-id.
            Module libcrypt.so.1 without build-id.
            Module libncursesw.so.6 without build-id.
            Module libz.so.1 without build-id.
            Module libreadline.so.8 without build-id.
            Module gdb without build-id.
            Stack trace of thread 78517:
            #0  0x00007f561ec78bc7 __pthread_kill_implementation (libc.so.6 + 0x8abc7)
            #1  0x00007f561ec2bb46 raise (libc.so.6 + 0x3db46)
            #2  0x00000000006241c2 _ZL19handle_fatal_signali (gdb + 0x2241c2)
            #3  0x00000000006243df _ZL14handle_sigsegvi (gdb + 0x2243df)
            #4  0x00007f561ec2bbf0 __restore_rt (libc.so.6 + 0x3dbf0)
            #5  0x00007f561f78804b PyErr_SetInterrupt (libpython3.10.so.1.0 + 0x12804b)
            #6  0x0000000000623ed2 _Z14handle_sigtermi (gdb + 0x223ed2)
            #7  0x00007f561ec2bbf0 __restore_rt (libc.so.6 + 0x3dbf0)
            #8  0x00007f561f71a6f4 gc_collect_main (libpython3.10.so.1.0 + 0xba6f4)
            #9  0x00007f561f7aed95 PyGC_Collect (libpython3.10.so.1.0 + 0x14ed95)
            #10 0x00007f561f8d23bb Py_FinalizeEx.part.0 (libpython3.10.so.1.0 + 0x2723bb)
            #11 0x00000000007f0584 _ZL15finalize_pythonPv (gdb + 0x3f0584)
            #12 0x0000000000dfb3f2 _Z17do_final_cleanupsv (gdb + 0x9fb3f2)
            #13 0x00000000009217fa _Z10quit_forcePii (gdb + 0x5217fa)
            #14 0x000000000054a96c _Z12quit_commandPKci (gdb + 0x14a96c)
            #15 0x0000000000623dab _ZL16async_disconnectPv (gdb + 0x223dab)
            #16 0x00000000004da9cd _Z28invoke_async_signal_handlersv (gdb + 0xda9cd)
            #17 0x0000000000dff52e _Z16gdb_do_one_eventv (gdb + 0x9ff52e)
            #18 0x0000000000705e2d _ZL21captured_command_loopv (gdb + 0x305e2d)
            #19 0x0000000000707b35 _Z8gdb_mainP18captured_main_args (gdb + 0x307b35)
            #20 0x000000000043a26c main (gdb + 0x3a26c)
            #21 0x00007f561ec1724e __libc_start_call_main (libc.so.6 + 0x2924e)
            #22 0x00007f561ec17309 __libc_start_main@@GLIBC_2.34 (libc.so.6 + 0x29309)
            #23 0x0000000000442665 _start (gdb + 0x42665)
            
            Stack trace of thread 78519:
            #0  0x00007f561ec737d5 __futex_abstimed_wait_common (libc.so.6 + 0x857d5)
            #1  0x00007f561ec76202 pthread_cond_wait@@GLIBC_2.3.2 (libc.so.6 + 0x88202)
            #2  0x00007f561eef1940 _ZNSt18condition_variable4waitERSt11unique_lockISt5mutexE (libstdc++.so.6 + 0xd9940)
            #3  0x0000000000e0978b _ZN3gdb11thread_pool15thread_functionEv (gdb + 0xa0978b)
            #4  0x00007f561eef73d4 execute_native_thread_routine (libstdc++.so.6 + 0xdf3d4)
            #5  0x00007f561ec76e86 start_thread (libc.so.6 + 0x88e86)
            #6  0x00007f561ecfdc60 __clone3 (libc.so.6 + 0x10fc60)
            
            Stack trace of thread 78521:
            #0  0x00007f561ec737d5 __futex_abstimed_wait_common (libc.so.6 + 0x857d5)
            #1  0x00007f561ec76202 pthread_cond_wait@@GLIBC_2.3.2 (libc.so.6 + 0x88202)
            #2  0x00007f561eef1940 _ZNSt18condition_variable4waitERSt11unique_lockISt5mutexE (libstdc++.so.6 + 0xd9940)
            #3  0x0000000000e0978b _ZN3gdb11thread_pool15thread_functionEv (gdb + 0xa0978b)
            #4  0x00007f561eef73d4 execute_native_thread_routine (libstdc++.so.6 + 0xdf3d4)
            #5  0x00007f561ec76e86 start_thread (libc.so.6 + 0x88e86)
            #6  0x00007f561ecfdc60 __clone3 (libc.so.6 + 0x10fc60)
            
            Stack trace of thread 78523:
            #0  0x00007f561ec737d5 __futex_abstimed_wait_common (libc.so.6 + 0x857d5)
            #1  0x00007f561ec76202 pthread_cond_wait@@GLIBC_2.3.2 (libc.so.6 + 0x88202)
            #2  0x00007f561eef1940 _ZNSt18condition_variable4waitERSt11unique_lockISt5mutexE (libstdc++.so.6 + 0xd9940)
            #3  0x0000000000e0978b _ZN3gdb11thread_pool15thread_functionEv (gdb + 0xa0978b)
            #4  0x00007f561eef73d4 execute_native_thread_routine (libstdc++.so.6 + 0xdf3d4)
            #5  0x00007f561ec76e86 start_thread (libc.so.6 + 0x88e86)
            #6  0x00007f561ecfdc60 __clone3 (libc.so.6 + 0x10fc60)
            
            Stack trace of thread 78524:
            #0  0x00007f561ec737d5 __futex_abstimed_wait_common (libc.so.6 + 0x857d5)
            #1  0x00007f561ec76202 pthread_cond_wait@@GLIBC_2.3.2 (libc.so.6 + 0x88202)
            #2  0x00007f561eef1940 _ZNSt18condition_variable4waitERSt11unique_lockISt5mutexE (libstdc++.so.6 + 0xd9940)
            #3  0x0000000000e0978b _ZN3gdb11thread_pool15thread_functionEv (gdb + 0xa0978b)
            #4  0x00007f561eef73d4 execute_native_thread_routine (libstdc++.so.6 + 0xdf3d4)
            #5  0x00007f561ec76e86 start_thread (libc.so.6 + 0x88e86)
            #6  0x00007f561ecfdc60 __clone3 (libc.so.6 + 0x10fc60)
            
            Stack trace of thread 78526:
            #0  0x00007f561ec737d5 __futex_abstimed_wait_common (libc.so.6 + 0x857d5)
            #1  0x00007f561ec76202 pthread_cond_wait@@GLIBC_2.3.2 (libc.so.6 + 0x88202)
            #2  0x00007f561eef1940 _ZNSt18condition_variable4waitERSt11unique_lockISt5mutexE (libstdc++.so.6 + 0xd9940)
            #3  0x0000000000e0978b _ZN3gdb11thread_pool15thread_functionEv (gdb + 0xa0978b)
            #4  0x00007f561eef73d4 execute_native_thread_routine (libstdc++.so.6 + 0xdf3d4)
            #5  0x00007f561ec76e86 start_thread (libc.so.6 + 0x88e86)
            #6  0x00007f561ecfdc60 __clone3 (libc.so.6 + 0x10fc60)
            
            Stack trace of thread 78534:
            #0  0x00007f561ec737d5 __futex_abstimed_wait_common (libc.so.6 + 0x857d5)
            #1  0x00007f561ec76202 pthread_cond_wait@@GLIBC_2.3.2 (libc.so.6 + 0x88202)
            #2  0x00007f561eef1940 _ZNSt18condition_variable4waitERSt11unique_lockISt5mutexE (libstdc++.so.6 + 0xd9940)
            #3  0x0000000000e0978b _ZN3gdb11thread_pool15thread_functionEv (gdb + 0xa0978b)
            #4  0x00007f561eef73d4 execute_native_thread_routine (libstdc++.so.6 + 0xdf3d4)
            #5  0x00007f561ec76e86 start_thread (libc.so.6 + 0x88e86)
            #6  0x00007f561ecfdc60 __clone3 (libc.so.6 + 0x10fc60)
            
            Stack trace of thread 78525:
            #0  0x00007f561ec737d5 __futex_abstimed_wait_common (libc.so.6 + 0x857d5)
            #1  0x00007f561ec76202 pthread_cond_wait@@GLIBC_2.3.2 (libc.so.6 + 0x88202)
            #2  0x00007f561eef1940 _ZNSt18condition_variable4waitERSt11unique_lockISt5mutexE (libstdc++.so.6 + 0xd9940)
            #3  0x0000000000e0978b _ZN3gdb11thread_pool15thread_functionEv (gdb + 0xa0978b)
            #4  0x00007f561eef73d4 execute_native_thread_routine (libstdc++.so.6 + 0xdf3d4)
            #5  0x00007f561ec76e86 start_thread (libc.so.6 + 0x88e86)
            #6  0x00007f561ecfdc60 __clone3 (libc.so.6 + 0x10fc60)
            
            Stack trace of thread 78528:
            #0  0x00007f561ec737d5 __futex_abstimed_wait_common (libc.so.6 + 0x857d5)
            #1  0x00007f561ec76202 pthread_cond_wait@@GLIBC_2.3.2 (libc.so.6 + 0x88202)
            #2  0x00007f561eef1940 _ZNSt18condition_variable4waitERSt11unique_lockISt5mutexE (libstdc++.so.6 + 0xd9940)
            #3  0x0000000000e0978b _ZN3gdb11thread_pool15thread_functionEv (gdb + 0xa0978b)
            #4  0x00007f561eef73d4 execute_native_thread_routine (libstdc++.so.6 + 0xdf3d4)
            #5  0x00007f561ec76e86 start_thread (libc.so.6 + 0x88e86)
            #6  0x00007f561ecfdc60 __clone3 (libc.so.6 + 0x10fc60)
            
            Stack trace of thread 78530:
            #0  0x00007f561ec737d5 __futex_abstimed_wait_common (libc.so.6 + 0x857d5)
            #1  0x00007f561ec76202 pthread_cond_wait@@GLIBC_2.3.2 (libc.so.6 + 0x88202)
            #2  0x00007f561eef1940 _ZNSt18condition_variable4waitERSt11unique_lockISt5mutexE (libstdc++.so.6 + 0xd9940)
            #3  0x0000000000e0978b _ZN3gdb11thread_pool15thread_functionEv (gdb + 0xa0978b)
            #4  0x00007f561eef73d4 execute_native_thread_routine (libstdc++.so.6 + 0xdf3d4)
            #5  0x00007f561ec76e86 start_thread (libc.so.6 + 0x88e86)
            #6  0x00007f561ecfdc60 __clone3 (libc.so.6 + 0x10fc60)
            
            Stack trace of thread 78522:
            #0  0x00007f561ec737d5 __futex_abstimed_wait_common (libc.so.6 + 0x857d5)
            #1  0x00007f561ec76202 pthread_cond_wait@@GLIBC_2.3.2 (libc.so.6 + 0x88202)
            #2  0x00007f561eef1940 _ZNSt18condition_variable4waitERSt11unique_lockISt5mutexE (libstdc++.so.6 + 0xd9940)
            #3  0x0000000000e0978b _ZN3gdb11thread_pool15thread_functionEv (gdb + 0xa0978b)
            #4  0x00007f561eef73d4 execute_native_thread_routine (libstdc++.so.6 + 0xdf3d4)
            #5  0x00007f561ec76e86 start_thread (libc.so.6 + 0x88e86)
            #6  0x00007f561ecfdc60 __clone3 (libc.so.6 + 0x10fc60)
            
            Stack trace of thread 78529:
            #0  0x00007f561ec737d5 __futex_abstimed_wait_common (libc.so.6 + 0x857d5)
            #1  0x00007f561ec76202 pthread_cond_wait@@GLIBC_2.3.2 (libc.so.6 + 0x88202)
            #2  0x00007f561eef1940 _ZNSt18condition_variable4waitERSt11unique_lockISt5mutexE (libstdc++.so.6 + 0xd9940)
            #3  0x0000000000e0978b _ZN3gdb11thread_pool15thread_functionEv (gdb + 0xa0978b)
            #4  0x00007f561eef73d4 execute_native_thread_routine (libstdc++.so.6 + 0xdf3d4)
            #5  0x00007f561ec76e86 start_thread (libc.so.6 + 0x88e86)
            #6  0x00007f561ecfdc60 __clone3 (libc.so.6 + 0x10fc60)
            
            Stack trace of thread 78532:
            #0  0x00007f561ec737d5 __futex_abstimed_wait_common (libc.so.6 + 0x857d5)
            #1  0x00007f561ec76202 pthread_cond_wait@@GLIBC_2.3.2 (libc.so.6 + 0x88202)
            #2  0x00007f561eef1940 _ZNSt18condition_variable4waitERSt11unique_lockISt5mutexE (libstdc++.so.6 + 0xd9940)
            #3  0x0000000000e0978b _ZN3gdb11thread_pool15thread_functionEv (gdb + 0xa0978b)
            #4  0x00007f561eef73d4 execute_native_thread_routine (libstdc++.so.6 + 0xdf3d4)
            #5  0x00007f561ec76e86 start_thread (libc.so.6 + 0x88e86)
            #6  0x00007f561ecfdc60 __clone3 (libc.so.6 + 0x10fc60)
            
            Stack trace of thread 78533:
            #0  0x00007f561ec737d5 __futex_abstimed_wait_common (libc.so.6 + 0x857d5)
            #1  0x00007f561ec76202 pthread_cond_wait@@GLIBC_2.3.2 (libc.so.6 + 0x88202)
            #2  0x00007f561eef1940 _ZNSt18condition_variable4waitERSt11unique_lockISt5mutexE (libstdc++.so.6 + 0xd9940)
            #3  0x0000000000e0978b _ZN3gdb11thread_pool15thread_functionEv (gdb + 0xa0978b)
            #4  0x00007f561eef73d4 execute_native_thread_routine (libstdc++.so.6 + 0xdf3d4)
            #5  0x00007f561ec76e86 start_thread (libc.so.6 + 0x88e86)
            #6  0x00007f561ecfdc60 __clone3 (libc.so.6 + 0x10fc60)
            
            Stack trace of thread 78527:
            #0  0x00007f561ec737d5 __futex_abstimed_wait_common (libc.so.6 + 0x857d5)
            #1  0x00007f561ec76202 pthread_cond_wait@@GLIBC_2.3.2 (libc.so.6 + 0x88202)
            #2  0x00007f561eef1940 _ZNSt18condition_variable4waitERSt11unique_lockISt5mutexE (libstdc++.so.6 + 0xd9940)
            #3  0x0000000000e0978b _ZN3gdb11thread_pool15thread_functionEv (gdb + 0xa0978b)
            #4  0x00007f561eef73d4 execute_native_thread_routine (libstdc++.so.6 + 0xdf3d4)
            #5  0x00007f561ec76e86 start_thread (libc.so.6 + 0x88e86)
            #6  0x00007f561ecfdc60 __clone3 (libc.so.6 + 0x10fc60)
            
            Stack trace of thread 78520:
            #0  0x00007f561ec737d5 __futex_abstimed_wait_common (libc.so.6 + 0x857d5)
            #1  0x00007f561ec76202 pthread_cond_wait@@GLIBC_2.3.2 (libc.so.6 + 0x88202)
            #2  0x00007f561eef1940 _ZNSt18condition_variable4waitERSt11unique_lockISt5mutexE (libstdc++.so.6 + 0xd9940)
            #3  0x0000000000e0978b _ZN3gdb11thread_pool15thread_functionEv (gdb + 0xa0978b)
            #4  0x00007f561eef73d4 execute_native_thread_routine (libstdc++.so.6 + 0xdf3d4)
            #5  0x00007f561ec76e86 start_thread (libc.so.6 + 0x88e86)
            #6  0x00007f561ecfdc60 __clone3 (libc.so.6 + 0x10fc60)
            
            Stack trace of thread 78531:
            #0  0x00007f561ec737d5 __futex_abstimed_wait_common (libc.so.6 + 0x857d5)
            #1  0x00007f561ec76202 pthread_cond_wait@@GLIBC_2.3.2 (libc.so.6 + 0x88202)
            #2  0x00007f561eef1940 _ZNSt18condition_variable4waitERSt11unique_lockISt5mutexE (libstdc++.so.6 + 0xd9940)
            #3  0x0000000000e0978b _ZN3gdb11thread_pool15thread_functionEv (gdb + 0xa0978b)
            #4  0x00007f561eef73d4 execute_native_thread_routine (libstdc++.so.6 + 0xdf3d4)
            #5  0x00007f561ec76e86 start_thread (libc.so.6 + 0x88e86)
            #6  0x00007f561ecfdc60 __clone3 (libc.so.6 + 0x10fc60)
            ELF object binary architecture: AMD x86-64

GNU gdb (GDB) 12.1
Copyright (C) 2022 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-unknown-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
https://www.gnu.org/software/gdb/bugs/.
Find the GDB manual and other documentation resources online at:
http://www.gnu.org/software/gdb/documentation/.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from /nix/store/ghvw9lxj8wy3qjip2jv6qsqwvqh6r86j-gdb-12.1/bin/gdb...
(No debugging symbols found in /nix/store/ghvw9lxj8wy3qjip2jv6qsqwvqh6r86j-gdb-12.1/bin/gdb)
[New LWP 78517]
[New LWP 78519]
[New LWP 78521]
[New LWP 78523]
[New LWP 78524]
[New LWP 78526]
[New LWP 78534]
[New LWP 78525]
[New LWP 78528]
[New LWP 78530]
[New LWP 78522]
[New LWP 78529]
[New LWP 78532]
[New LWP 78533]
[New LWP 78527]
[New LWP 78520]
[New LWP 78531]

warning: Section .reg-xstate/78517' in core file too small. [Thread debugging using libthread_db enabled] Using host libthread_db library "/nix/store/4nlgxhb09sdr51nc9hdm8az5b08vzkgx-glibc-2.35-163/lib/libthread_db.so.1". Core was generated by gdb /nix/store/39xg6gawi83swjp15y0d8yglv81kx8b9-neovim-unwrapped-0.8.1/bin/nvim'.
Program terminated with signal SIGSEGV, Segmentation fault.

warning: Section `.reg-xstate/78517' in core file too small.
#0 0x00007f561ec78bc7 in __pthread_kill_implementation () from /nix/store/4nlgxhb09sdr51nc9hdm8az5b08vzkgx-glibc-2.35-163/lib/libc.so.6
[Current thread is 1 (Thread 0x7f561c8ceec0 (LWP 78517))]
�[?2004h(gdb) �[?2004l
quit

@nullishamy nullishamy added the bug issues reporting wrong behavior label Dec 18, 2022
@nullishamy nullishamy changed the title SIGSEGV SIGSEGV During regular operation Dec 18, 2022
@nullishamy
Copy link
Author

Apologies for the lack of information, I'm a relative noob with systems debugging.

@lewis6991
Copy link
Member

Nothing useful in the backtrace which leads me to believe this is a bad install.

@zeertzjq zeertzjq added the needs:repro We need minimal steps to reproduce the issue label Dec 19, 2022
@rubyowo
Copy link

rubyowo commented Dec 19, 2022

On nix here aswell, and im facing the same problem.

@nullishamy
Copy link
Author

Nothing useful in the backtrace which leads me to believe this is a bad install.

I'd be very surprised if it were considering this is built from a Nix package, where the main focus is reproducible builds. I can investigate further into it being a config issue though.

@tomcur
Copy link
Contributor

tomcur commented Dec 19, 2022

Not encountering this issue on nixos-unstable, current Neovim master NVIM v0.9.0-dev, $TERM=alacritty. Either it's fixed, or it's related to wezterm.

You can try v0.9.0-dev on a flakes-enabled NixOS by running

$ nix run "github:neovim/neovim?dir=contrib" -- --clean

@lewis6991
Copy link
Member

Is it possible to get a backtrace or a core dump from a debug build?

@nullishamy
Copy link
Author

nullishamy commented Dec 19, 2022

I will run the suggested nix version above later on and report back. Do you have docs for building a debug binary with nix in case the unstable build doesn't fix it.

@nullishamy
Copy link
Author

After some amount of testing on 0.9.0, I cannot reproduce it. This could also just be because the LSPs are disabled, so I will test further tonight if LSPs are causing the problem.

@tomcur
Copy link
Contributor

tomcur commented Dec 19, 2022

@nullishamy

Do you have docs for building a debug binary with nix in case the unstable build doesn't fix it.

The following runs a debug build for Neovim 0.8

$ nix run "github:neovim/neovim/release-0.8?dir=contrib#neovim-debug" -- --clean

This could also just be because the LSPs are disabled, so I will test further tonight if LSPs are causing the problem.

NixOS wraps Neovim with your config, in the commands I gave I added --clean to ensure no config is loaded. Without it your config will load without NixOS's wrapping, which sometimes breaks things. The following steps allow running a manually built Neovim with your usual config

$ nix build "github:neovim/neovim/release-0.8?dir=contrib#neovim-debug" # the build ends up in ./result
$ cp $(which nvim) ./nvim.sh
$ chmod +w ./nvim.sh
$ nvim ./nvim.sh # edit the last line, replacing Neovim's executable path with `./result/bin/nvim`
$ ./nvim.sh

@nullishamy
Copy link
Author

Thanks! I'll give it a go now.

@nullishamy
Copy link
Author

Update, got a SIGABRT (??), going to gather the traceback and send it over.

@nullishamy
Copy link
Author

       PID: 45817 (nvim)
       UID: 1000 (amy)
       GID: 100 (users)
    Signal: 6 (ABRT)
 Timestamp: Mon 2022-12-19 21:45:49 GMT (2min 23s ago)

Command Line: ./result/bin/nvim
Executable: /nix/store/y6hb4jppriryr7nkaqq1j2z0yszgwn7j-neovim-unwrapped-master/bin/nvim
Control Group: /user.slice/user-1000.slice/session-2.scope
Unit: session-2.scope
Slice: user-1000.slice
Session: 2
Owner UID: 1000 (amy)
Boot ID: 20a5d4d546ac4fbfad39acfaaa795fe0
Machine ID: 84cac12fbb954a6c87b564a1d614a61b
Hostname: nixon
Storage: /var/lib/systemd/coredump/core.nvim.1000.20a5d4d546ac4fbfad39acfaaa795fe0.45817.1671486349000000.zst (present)
Size on Disk: 9.9M
Message: Process 45817 (nvim) of user 1000 dumped core.

            Module /home/amy/.local/share/nvim/site/pack/packer/start/nvim-treesitter/parser/c.so without build-id.
            Module /home/amy/.local/share/nvim/site/pack/packer/start/nvim-treesitter/parser/c.so
            Module /home/amy/.local/share/nvim/site/pack/packer/start/nvim-treesitter/parser/rust.so without build-id.
            Module /home/amy/.local/share/nvim/site/pack/packer/start/nvim-treesitter/parser/typescript.so without build-id.
            Module /home/amy/.local/share/nvim/site/pack/packer/start/nvim-treesitter/parser/typescript.so
            Module /home/amy/.local/share/nvim/site/pack/packer/start/nvim-treesitter/parser/markdown.so without build-id.
            Module /home/amy/.local/share/nvim/site/pack/packer/start/nvim-treesitter/parser/nix.so without build-id.
            Module /home/amy/.local/share/nvim/site/pack/packer/start/nvim-treesitter/parser/bash.so without build-id.
            Module libgcc_s.so.1 without build-id.
            Module libluajit-5.1.so.2 without build-id.
            Module libtree-sitter.so.0 without build-id.
            Module libunibilium.so.4 without build-id.
            Module libtermkey.so.1 without build-id.
            Module libvterm.so.0 without build-id.
            Module libmsgpackc.so.2 without build-id.
            Module libuv.so.1 without build-id.
            Module libluv.so.1 without build-id.
            Module nvim without build-id.
            Stack trace of thread 45817:
            #0  0x00007f5003eecbc7 __pthread_kill_implementation (libc.so.6 + 0x8abc7)
            #1  0x00007f5003e9fb46 raise (libc.so.6 + 0x3db46)
            #2  0x00007f5003e8a4b5 abort (libc.so.6 + 0x284b5)
            #3  0x00007f5003ee0a60 __libc_message (libc.so.6 + 0x7ea60)
            #4  0x00007f5003ef6b9a malloc_printerr (libc.so.6 + 0x94b9a)
            #5  0x00007f5003ef86ec _int_free (libc.so.6 + 0x966ec)
            #6  0x00007f5003efb273 free (libc.so.6 + 0x99273)
            #7  0x00007f500426d818 uv__fs_readdir_cleanup (libuv.so.1 + 0xf818)
            #8  0x00007f50042713ab uv_fs_req_cleanup (libuv.so.1 + 0x133ab)
            #9  0x00007f50042a555b luv_fs_cb (libluv.so.1 + 0x1555b)
            #10 0x00007f500426a3c2 uv__work_done (libuv.so.1 + 0xc3c2)
            #11 0x00007f500426e09d uv__async_io.part.0 (libuv.so.1 + 0x1009d)
            #12 0x00007f50042820b5 uv__io_poll (libuv.so.1 + 0x240b5)
            #13 0x00007f500426e9bc uv_run (libuv.so.1 + 0x109bc)
            #14 0x000000000050c5a4 loop_poll_events (nvim + 0x10c5a4)
            #15 0x00000000005fe01d os_breakcheck (nvim + 0x1fe01d)
            #16 0x0000000000687a73 state_handle_k_event (nvim + 0x287a73)
            #17 0x00000000005da868 nv_event (nvim + 0x1da868)
            #18 0x00000000005d4113 normal_execute (nvim + 0x1d4113)
            #19 0x0000000000687904 state_enter (nvim + 0x287904)
            #20 0x00000000005ceaa6 normal_enter (nvim + 0x1ceaa6)
            #21 0x000000000058be8c main (nvim + 0x18be8c)
            #22 0x00007f5003e8b24e __libc_start_call_main (libc.so.6 + 0x2924e)
            #23 0x00007f5003e8b309 __libc_start_main@@GLIBC_2.34 (libc.so.6 + 0x29309)
            #24 0x0000000000451ce5 _start (nvim + 0x51ce5)
            
            Stack trace of thread 45820:
            #0  0x00007f5003ee77d5 __futex_abstimed_wait_common (libc.so.6 + 0x857d5)
            #1  0x00007f5003eea202 pthread_cond_wait@@GLIBC_2.3.2 (libc.so.6 + 0x88202)
            #2  0x00007f500427c2e9 uv_cond_wait (libuv.so.1 + 0x1e2e9)
            #3  0x00007f5004269d86 worker (libuv.so.1 + 0xbd86)
            #4  0x00007f5003eeae86 start_thread (libc.so.6 + 0x88e86)
            #5  0x00007f5003f71c60 __clone3 (libc.so.6 + 0x10fc60)
            
            Stack trace of thread 45818:
            #0  0x00007f5003f71237 epoll_wait (libc.so.6 + 0x10f237)
            #1  0x00007f50042824a7 uv__io_poll (libuv.so.1 + 0x244a7)
            #2  0x00007f500426e9bc uv_run (libuv.so.1 + 0x109bc)
            #3  0x000000000050c5a4 loop_poll_events (nvim + 0x10c5a4)
            #4  0x00000000006ad8fd tui_main (nvim + 0x2ad8fd)
            #5  0x00000000006bac6e ui_thread_run (nvim + 0x2bac6e)
            #6  0x00007f5003eeae86 start_thread (libc.so.6 + 0x88e86)
            #7  0x00007f5003f71c60 __clone3 (libc.so.6 + 0x10fc60)
            
            Stack trace of thread 45821:
            #0  0x00007f5003ee77d5 __futex_abstimed_wait_common (libc.so.6 + 0x857d5)
            #1  0x00007f5003eea202 pthread_cond_wait@@GLIBC_2.3.2 (libc.so.6 + 0x88202)
            #2  0x00007f500427c2e9 uv_cond_wait (libuv.so.1 + 0x1e2e9)
            #3  0x00007f5004269d86 worker (libuv.so.1 + 0xbd86)
            #4  0x00007f5003eeae86 start_thread (libc.so.6 + 0x88e86)
            #5  0x00007f5003f71c60 __clone3 (libc.so.6 + 0x10fc60)
            
            Stack trace of thread 45822:
            #0  0x00007f5003ee77d5 __futex_abstimed_wait_common (libc.so.6 + 0x857d5)
            #1  0x00007f5003eea202 pthread_cond_wait@@GLIBC_2.3.2 (libc.so.6 + 0x88202)
            #2  0x00007f500427c2e9 uv_cond_wait (libuv.so.1 + 0x1e2e9)
            #3  0x00007f5004269d86 worker (libuv.so.1 + 0xbd86)
            #4  0x00007f5003eeae86 start_thread (libc.so.6 + 0x88e86)
            #5  0x00007f5003f71c60 __clone3 (libc.so.6 + 0x10fc60)
            
            Stack trace of thread 45823:
            #0  0x00007f5003ee77d5 __futex_abstimed_wait_common (libc.so.6 + 0x857d5)
            #1  0x00007f5003eea202 pthread_cond_wait@@GLIBC_2.3.2 (libc.so.6 + 0x88202)
            #2  0x00007f500427c2e9 uv_cond_wait (libuv.so.1 + 0x1e2e9)
            #3  0x00007f5004269d86 worker (libuv.so.1 + 0xbd86)
            #4  0x00007f5003eeae86 start_thread (libc.so.6 + 0x88e86)
            #5  0x00007f5003f71c60 __clone3 (libc.so.6 + 0x10fc60)
            ELF object binary architecture: AMD x86-64

GNU gdb (GDB) 12.1
Copyright (C) 2022 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-unknown-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
https://www.gnu.org/software/gdb/bugs/.
Find the GDB manual and other documentation resources online at:
http://www.gnu.org/software/gdb/documentation/.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from /nix/store/y6hb4jppriryr7nkaqq1j2z0yszgwn7j-neovim-unwrapped-master/bin/nvim...

warning: Can't open file /run/nscd/dbl9tGUY (deleted) during file-backed mapping note processing
[New LWP 45817]
[New LWP 45820]
[New LWP 45818]
[New LWP 45821]
[New LWP 45822]
[New LWP 45823]

warning: Section .reg-xstate/45817' in core file too small. [Thread debugging using libthread_db enabled] Using host libthread_db library "/nix/store/4nlgxhb09sdr51nc9hdm8az5b08vzkgx-glibc-2.35-163/lib/libthread_db.so.1". Core was generated by ./result/bin/nvim'.
Program terminated with signal SIGABRT, Aborted.

warning: Section `.reg-xstate/45817' in core file too small.
#0 0x00007f5003eecbc7 in __pthread_kill_implementation () from /nix/store/fz54faknl123dimzz6jsppw193lx2mip-glibc-2.35-163/lib/libc.so.6
[Current thread is 1 (Thread 0x7f5003e3e740 (LWP 45817))]
�[?2004h(gdb) quit
�[?2004l

@lewis6991
Copy link
Member

Unfortunately still not really anything useful to get much insight from. Looks like libuv is just crashing hard.

@nullishamy
Copy link
Author

Unfortunately so. I could look into disabling LSPs and such to see if it resolves it tomorrow.

@zeertzjq zeertzjq added bug-crash issue reporting a crash or segfault and removed bug issues reporting wrong behavior labels Dec 23, 2022
@nullishamy
Copy link
Author

Disabled the following, issue still appeared:

  1. LSP
  2. Formatting
  3. Mason
  4. Treesitter
  5. Discord RPC

As they all have IO at some point. Still unsure what's causing it lol.

@nullishamy
Copy link
Author

More info:

Got IOT instruction (core dumped) today. With the text size vs. prev_size in fastbins, with some research, this appears to be a memory bug. https://stackoverflow.com/questions/53905164/realloc-inside-a-function-corrupted-size-vs-prev-size#53907212. Will run with valgrind and attempt to repro with more info.

@nullishamy
Copy link
Author

nullishamy commented Feb 6, 2023

Managed to get gdb attached and captured the error, stack:

libluv is definitely dying.

Thread 6 (Thread 0x7fffe37fe640 (LWP 66637) "nvim"):
#0  0x00007ffff7bde7d5 in __futex_abstimed_wait_common () from /nix/store/fz54faknl123dimzz6jsppw193lx2mip-glibc-2.35-163/lib/libc.so.6
No symbol table info available.
#1  0x00007ffff7be1202 in pthread_cond_wait@@GLIBC_2.3.2 () from /nix/store/fz54faknl123dimzz6jsppw193lx2mip-glibc-2.35-163/lib/libc.so.6
No symbol table info available.
#2  0x00007ffff7f732e9 in uv_cond_wait () from /nix/store/8dmxy0l6n2i8a3kfyl30anjv8igriibk-libuv-1.44.2/lib/libuv.so.1
No symbol table info available.
#3  0x00007ffff7f60d86 in worker () from /nix/store/8dmxy0l6n2i8a3kfyl30anjv8igriibk-libuv-1.44.2/lib/libuv.so.1
No symbol table info available.
#4  0x00007ffff7be1e86 in start_thread () from /nix/store/fz54faknl123dimzz6jsppw193lx2mip-glibc-2.35-163/lib/libc.so.6
No symbol table info available.
#5  0x00007ffff7c68c60 in clone3 () from /nix/store/fz54faknl123dimzz6jsppw193lx2mip-glibc-2.35-163/lib/libc.so.6
No symbol table info available.

Thread 5 (Thread 0x7fffe3fff640 (LWP 66636) "nvim"):
#0  0x00007ffff7f6ebb0 in uv.signal_handler () from /nix/store/8dmxy0l6n2i8a3kfyl30anjv8igriibk-libuv-1.44.2/lib/libuv.so.1
No symbol table info available.
#1  <signal handler called>
No symbol table info available.
#2  0x00007ffff7bde7d3 in __futex_abstimed_wait_common () from /nix/store/fz54faknl123dimzz6jsppw193lx2mip-glibc-2.35-163/lib/libc.so.6
No symbol table info available.
#3  0x00007ffff7be1202 in pthread_cond_wait@@GLIBC_2.3.2 () from /nix/store/fz54faknl123dimzz6jsppw193lx2mip-glibc-2.35-163/lib/libc.so.6
No symbol table info available.
#4  0x00007ffff7f732e9 in uv_cond_wait () from /nix/store/8dmxy0l6n2i8a3kfyl30anjv8igriibk-libuv-1.44.2/lib/libuv.so.1
No symbol table info available.
#5  0x00007ffff7f60d86 in worker () from /nix/store/8dmxy0l6n2i8a3kfyl30anjv8igriibk-libuv-1.44.2/lib/libuv.so.1
No symbol table info available.
#6  0x00007ffff7be1e86 in start_thread () from /nix/store/fz54faknl123dimzz6jsppw193lx2mip-glibc-2.35-163/lib/libc.so.6
No symbol table info available.
#7  0x00007ffff7c68c60 in clone3 () from /nix/store/fz54faknl123dimzz6jsppw193lx2mip-glibc-2.35-163/lib/libc.so.6
No symbol table info available.

Thread 4 (Thread 0x7fffe8f92640 (LWP 66635) "nvim"):
#0  0x00007ffff7f6ebb0 in uv.signal_handler () from /nix/store/8dmxy0l6n2i8a3kfyl30anjv8igriibk-libuv-1.44.2/lib/libuv.so.1
No symbol table info available.
#1  <signal handler called>
No symbol table info available.
#2  0x00007ffff7bde7d3 in __futex_abstimed_wait_common () from /nix/store/fz54faknl123dimzz6jsppw193lx2mip-glibc-2.35-163/lib/libc.so.6
No symbol table info available.
#3  0x00007ffff7be1202 in pthread_cond_wait@@GLIBC_2.3.2 () from /nix/store/fz54faknl123dimzz6jsppw193lx2mip-glibc-2.35-163/lib/libc.so.6
No symbol table info available.
#4  0x00007ffff7f732e9 in uv_cond_wait () from /nix/store/8dmxy0l6n2i8a3kfyl30anjv8igriibk-libuv-1.44.2/lib/libuv.so.1
No symbol table info available.
#5  0x00007ffff7f60d86 in worker () from /nix/store/8dmxy0l6n2i8a3kfyl30anjv8igriibk-libuv-1.44.2/lib/libuv.so.1
No symbol table info available.
#6  0x00007ffff7be1e86 in start_thread () from /nix/store/fz54faknl123dimzz6jsppw193lx2mip-glibc-2.35-163/lib/libc.so.6
No symbol table info available.
#7  0x00007ffff7c68c60 in clone3 () from /nix/store/fz54faknl123dimzz6jsppw193lx2mip-glibc-2.35-163/lib/libc.so.6
No symbol table info available.

Thread 3 (Thread 0x7fffe9793640 (LWP 66631) "nvim"):
#0  0x00007ffff7bde7d5 in __futex_abstimed_wait_common () from /nix/store/fz54faknl123dimzz6jsppw193lx2mip-glibc-2.35-163/lib/libc.so.6
No symbol table info available.
#1  0x00007ffff7be1202 in pthread_cond_wait@@GLIBC_2.3.2 () from /nix/store/fz54faknl123dimzz6jsppw193lx2mip-glibc-2.35-163/lib/libc.so.6
No symbol table info available.
#2  0x00007ffff7f732e9 in uv_cond_wait () from /nix/store/8dmxy0l6n2i8a3kfyl30anjv8igriibk-libuv-1.44.2/lib/libuv.so.1
No symbol table info available.
#3  0x00007ffff7f60d86 in worker () from /nix/store/8dmxy0l6n2i8a3kfyl30anjv8igriibk-libuv-1.44.2/lib/libuv.so.1
No symbol table info available.
#4  0x00007ffff7be1e86 in start_thread () from /nix/store/fz54faknl123dimzz6jsppw193lx2mip-glibc-2.35-163/lib/libc.so.6
No symbol table info available.
#5  0x00007ffff7c68c60 in clone3 () from /nix/store/fz54faknl123dimzz6jsppw193lx2mip-glibc-2.35-163/lib/libc.so.6
No symbol table info available.

Thread 2 (Thread 0x7fffea525640 (LWP 66629) "nvim"):
#0  0x00007ffff7c68237 in epoll_wait () from /nix/store/fz54faknl123dimzz6jsppw193lx2mip-glibc-2.35-163/lib/libc.so.6
No symbol table info available.
#1  0x00007ffff7f794a7 in uv.io_poll () from /nix/store/8dmxy0l6n2i8a3kfyl30anjv8igriibk-libuv-1.44.2/lib/libuv.so.1
No symbol table info available.
#2  0x00007ffff7f659bc in uv_run () from /nix/store/8dmxy0l6n2i8a3kfyl30anjv8igriibk-libuv-1.44.2/lib/libuv.so.1
No symbol table info available.
#3  0x000000000050c694 in ?? ()
No symbol table info available.
#4  0x00000000ffffff00 in ?? ()
No symbol table info available.
#5  0x0000000000836520 in ?? ()
No symbol table info available.
#6  0x0000000000836670 in ?? ()
No symbol table info available.
#7  0x00007fffe4000e30 in ?? ()
No symbol table info available.
#8  0x00007fffea524790 in ?? ()
No symbol table info available.
#9  0x00000000006ad9dd in ?? ()
No symbol table info available.
#10 0x00000000006b04e0 in ?? ()
No symbol table info available.
#11 0x00007fffe4022eb0 in ?? ()
No symbol table info available.
#12 0x0000000000000000 in ?? ()
No symbol table info available.

Thread 1 (Thread 0x7ffff7b35740 (LWP 66627) "nvim"):
#0  0x00007ffff7f969ee in push_fs_result () from /nix/store/31l0lqkld6b90h0wf5pz6387bk89vfpn-libluv-1.43.0-0/lib/libluv.so.1
No symbol table info available.
#1  0x00007ffff7f9c524 in luv_fs_cb () from /nix/store/31l0lqkld6b90h0wf5pz6387bk89vfpn-libluv-1.43.0-0/lib/libluv.so.1
No symbol table info available.
#2  0x00007ffff7f613c2 in uv.work_done () from /nix/store/8dmxy0l6n2i8a3kfyl30anjv8igriibk-libuv-1.44.2/lib/libuv.so.1
No symbol table info available.
#3  0x00007ffff7f6509d in uv.async_io.part () from /nix/store/8dmxy0l6n2i8a3kfyl30anjv8igriibk-libuv-1.44.2/lib/libuv.so.1
No symbol table info available.
#4  0x00007ffff7f790b5 in uv.io_poll () from /nix/store/8dmxy0l6n2i8a3kfyl30anjv8igriibk-libuv-1.44.2/lib/libuv.so.1
No symbol table info available.
#5  0x00007ffff7f659bc in uv_run () from /nix/store/8dmxy0l6n2i8a3kfyl30anjv8igriibk-libuv-1.44.2/lib/libuv.so.1
No symbol table info available.
#6  0x000000000050c694 in ?? ()
No symbol table info available.
#7  0x00000000007efaf8 in ?? ()
No symbol table info available.
#8  0x0000000000000080 in ?? ()
No symbol table info available.
#9  0x00000000007efaa0 in ?? ()
No symbol table info available.
#10 0x00000000007efa4c in ?? ()
No symbol table info available.
#11 0x0000000000000000 in ?? ()
No symbol table info available.

@zeertzjq zeertzjq added the has:backtrace issue contains a stacktrace/ASAN log label Feb 6, 2023
@nullishamy
Copy link
Author

One interesting note I forgot to mention was neovim spawning a whole load of child processes? Every time i switched windows, GDB logged about child process detaching, which i found weird. Is this expected / intended?

@dundargoc
Copy link
Member

Not intended, it's an ongoing problem we're trying to fix. Any help is welcome.

@nullishamy
Copy link
Author

Alright, thanks for that! Thought it might have been related in some sense, not sure though..

All I can say is that it's still spawning a lot of processes.

At least that rules out a plugin making processes and crashing.

@nullishamy
Copy link
Author

After getting many crashes today, I do believe it is related to the file saving logic. I have an autosave plugin (entirely lua, only calling neovim APIs), so when I leave insert, it crashes.

@CnTeng
Copy link

CnTeng commented Mar 1, 2023

NixOS/nixpkgs#218939 (comment) I have the same problem, I use pure lua config and use nix to install treesiiter. But it can't work.

@CnTeng
Copy link

CnTeng commented Mar 1, 2023

luvit/luv#633 maybe this problem because of this
type :lua require("luv").handle_get_type(newproxy()) will show this crash

@nullishamy
Copy link
Author

Yep, can repro that. It crashed mine. Can't say for certain that this is the same bug, but its certainly something. Thanks for the update!

@Bilal2453

This comment was marked as spam.

@nullishamy

This comment was marked as off-topic.

@Bilal2453

This comment was marked as off-topic.

@nullishamy

This comment was marked as off-topic.

@justinmk
Copy link
Member

justinmk commented Mar 3, 2023

Looks like updating luv might help? luvit/luv#634 (thank you @Bilal2453 !)

@nullishamy
Copy link
Author

nullishamy commented Mar 3, 2023

I'll write some overlay stuff in my Nix config to pull it and test.

EDIT: Can't get the overlay to work lol.

@Bilal2453
Copy link

Something is definitely going wrong with the thread code. It seems to be mainly triggered by the argument setting, I can't really debug this effectively as gdb is reporting a different backtrace on the thread segfaulting. The actual segfault seems to happen after the arguments error, possibly somewhere in luv_handle_init things go wrong.

Will open an issue on the Luv repo later on, still not entirely sure if it is related but it is consistently segfaulting for me so worth mentioning.

@clason
Copy link
Member

clason commented Mar 3, 2023

Can you try #22502?

@nullishamy
Copy link
Author

Recently redid my config and this issue seems to have gone. Could still be a neovim core issue which was triggered by an odd set of plugins, but i'm not sure. Closing for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug-crash issue reporting a crash or segfault has:backtrace issue contains a stacktrace/ASAN log needs:repro We need minimal steps to reproduce the issue
Projects
None yet
Development

No branches or pull requests

10 participants