sublimehq / sublime_text

Issue tracker for Sublime Text
https://www.sublimetext.com
810 stars 39 forks source link

Sublime text 4123 crashes on save with (rust) LSP #5082

Closed frederik-vestre-pexip closed 2 years ago

frederik-vestre-pexip commented 2 years ago

Description of the bug

Sublime text 4123 crashes on save with rust LSP if the console window with errors are open.

Steps to reproduce

Open a rust LSP project. Wait for it to index and open the console window. Watch all the windows dissapear.

Expected behavior

No crash

Actual behavior

Sublime text window disappear when i press ctrl+s from dmesg: [44400.593880] sublime_text[720229]: segfault at 28 ip 00000000009209d7 sp 00007ffda37651f0 error 4 in sublime_text[4c5000+58d000] [44400.593895] Code: 0f 10 8c 24 80 01 00 00 f2 41 0f 10 07 f2 0f 58 c1 f2 0f 11 44 24 30 f2 41 0f 58 4f 10 f2 0f 11 4c 24 40 49 8b

from gdb (not sure if it is the right thread: ... warning: Unable to find libthread_db matching inferior's thread library, thread debugging will not be available. Core was generated by `/opt/sublime_text/sublime_text --detached --fwdargv0 /usr/bin/subl'.

0 0x00000000009209d7 in ?? ()

[Current thread is 18010 (LWP 715031)] @(gdb) bt

0 0x00000000009209d7 in ()

1 0x00000000006dfbc8 in ()

2 0x00000000006a34e2 in ()

3 0x00000000006a3508 in ()

4 0x00000000006a3508 in ()

5 0x00000000006a3508 in ()

6 0x00000000006a3508 in ()

7 0x00000000006a3508 in ()

8 0x0000000000717c97 in ()

9 0x0000000000723ead in ()

10 0x00007f52d5bf47c4 in g_main_context_dispatch () at /lib/x86_64-linux-gnu/libglib-2.0.so.0

11 0x00007f52d5c47f08 in () at /lib/x86_64-linux-gnu/libglib-2.0.so.0

12 0x00007f52d5bf3e43 in g_main_loop_run () at /lib/x86_64-linux-gnu/libglib-2.0.so.0

13 0x00007f52d2ea9b6d in gtk_main () at /lib/x86_64-linux-gnu/libgtk-3.so

14 0x0000000000729b08 in ()

15 0x000000000057204a in ()

16 0x00007f52d56f4fd0 in __libc_start_call_main (main=main@entry=0x56eb09, argc=argc@entry=4, argv=argv@entry=0x7fff055a7a88) at ../sysdeps/nptl/libc_start_call_main.h:58

17 0x00007f52d56f507d in __libc_start_main_impl (main=0x56eb09, argc=4, argv=0x7fff055a7a88, init=, fini=, rtld_fini=, stack_end=0x7fff055a7a78) at ../csu/libc-start.c:409

18 0x00000000004c577a in ()

@(gdb) info registers rax 0x0 0 rbx 0x50 80 rcx 0x0 0 rdx 0xc 12 rsi 0x3 3 rdi 0x7f5293b79f80 139992642330496 rbp 0x4066200000000000 0x4066200000000000 rsp 0x7fff055a68b0 0x7fff055a68b0 r8 0x0 0 r9 0x40 64 r10 0x0 0 r11 0x1 1 r12 0x40910c0000000000 4652513084189966336 r13 0x7f5293b79f80 139992642330496 r14 0x0 0 r15 0x7f5293792fb0 139992638238640 rip 0x9209d7 0x9209d7 eflags 0x10206 [ PF IF RF ] cs 0x33 51 ss 0x0 0 ds 0x0 0 es 0x0 0 fs 0x0 0

@(gdb) info thread Id Target Id Frame

Sublime Text build number

4123

Operating system & version

Ubuntu 21.11

(Linux) Desktop environment and/or window manager

i3

Additional information

If you need a dump file i may be able to provide it, but i do not want to upload it publicly as i am not sure to what extent it will contain my source code.

OpenGL context information

No response

deathaxe commented 2 years ago

Happened with LSP-pyright as well on Windows 11. Not sure whether it is related to LSP though.

SamuelBolduc commented 2 years ago

Happening to me with LSP-TypeScript. Running on Mac OSX 11.6. I updated ST this afternoon, didn't happen this morning before the update.

EDIT:

Had to revert to 4121 since I couldn't work at all. I can confirm this doesn't happen on that version.

edaniels commented 2 years ago

Might as well assume it's LSP related. Happened with gopls LSP too.

yvt commented 2 years ago

Can't reproduce it in Build 4124 anymore.

BenjaminSchaaf commented 2 years ago

Fixed in build 4124.

frederik-vestre-pexip commented 2 years ago

Thanks for looking at it so rapidly, and making a fix.

With 4124 it works for a few hours, but it has still crashed twice today. These are some data from the latest dump: [167285.723095] sublime_text[2148051]: segfault at 7f90b958e000 ip 0000000000a22683 sp 00007ffebcab6bd0 error 4 in sublime_text[4c5000+58d000] [167285.723114] Code: 31 f6 eb 08 0f 1f 00 31 f6 4c 89 e7 89 e9 49 8b 46 f8 48 39 44 ca 30 74 3e 49 89 d7 41 89 ec eb 10 66 0f 1f 44 00 00 44 89 e1 <49> 39 44 cf 30 74 2c 41 83 c4 01 45 3b a7 90 0f 00 00 75 e9 49 8b

[Current thread is 17599 (LWP 2148051)] @(gdb) bt

0 0x0000000000a22683 in ()

1 0x00000000008a98f4 in ()

2 0x000000000059ea62 in ()

3 0x00000000005977f1 in ()

4 0x00000000005899fa in ()

5 0x00000000005b585b in ()

6 0x0000000000723d9f in ()

7 0x0000000000723cb4 in ()

8 0x00007f92028287c4 in g_main_context_dispatch () at /lib/x86_64-linux-gnu/libglib-2.0.so.0

9 0x00007f920287bf08 in () at /lib/x86_64-linux-gnu/libglib-2.0.so.0

10 0x00007f9202827e43 in g_main_loop_run () at /lib/x86_64-linux-gnu/libglib-2.0.so.0

11 0x00007f91ffae1b6d in gtk_main () at /lib/x86_64-linux-gnu/libgtk-3.so

12 0x0000000000729af4 in ()

13 0x000000000057206a in ()

14 0x00007f9202328fd0 in __libc_start_call_main (main=main@entry=0x56eb29, argc=argc@entry=4, argv=argv@entry=0x7ffebcab7f28) at ../sysdeps/nptl/libc_start_call_main.h:58

15 0x00007f920232907d in __libc_start_main_impl (main=0x56eb29, argc=4, argv=0x7ffebcab7f28, init=, fini=, rtld_fini=, stack_end=0x7ffebcab7f18) at ../csu/libc-start.c:409

16 0x00000000004c579a in ()

@(gdb)

@(gdb) info registers rax 0x7f91e2306f50 140264541810512 rbx 0x7f91d1f1f200 140264269279744 rcx 0x2f47fa 3098618 rdx 0x7f90b7dea000 140259536838656 rsi 0x0 0 rdi 0x7f91d1f1f278 140264269279864 rbp 0x0 0x0 rsp 0x7ffebcab6bd0 0x7ffebcab6bd0 r8 0x7f9202128080 140265076719744 r9 0x40 64 r10 0x7f908d75a4e0 140258825315552 r11 0x7f908cdfd718 140258815498008 r12 0x2f47fa 3098618 r13 0x7f91c6f64d40 140264085015872 r14 0x7f91c6f64d78 140264085015928 r15 0x7f90b7dea000 140259536838656 rip 0xa22683 0xa22683 eflags 0x10206 [ PF IF RF ] cs 0x33 51 ss 0x0 0 ds 0x0 0 es 0x0 0 fs 0x0 0 gs 0x0 0

@(gdb) info threads Id Target Id Frame

BenjaminSchaaf commented 2 years ago

Fixed in build 4125.