Sublime Forum

ST4 consistently crashes on large directory structure changes

#1

Unfortunately I cannot provide a simple way to reproduce this, but I have a repository with a pretty old branch that I have to maintain. I’m using Terminus to checkout the branch.

The only clue that I have so far is that it have something to do with pretty large directory structure changes. For example this one have updates to around 80 files, and lots of directories have to be added or removed on checkout. I can get Sublime consistently crashing when switching from my staging branch to the old feature branch. It happens always.

Note that I’ve been using Terminus on ST3 and I have never experienced crashes where with ST4 for the past month or so I had close to 10. It always happens when there is a sudden and probably dramatic change in directory structure, usually on branch checkout.

EDIT: I just tried checking out the branch from my terminal instead, same result, Sublime crashes immediately, so it’s definitely not Terminus related issue.

I’m using Ubuntu.

0 Likes

#2

Does it happen in safe mode?

0 Likes

#3

Yes, just tried that:

  1. Run Sublime in safe mode
  2. Load the project folder
  3. Checkout the branch from my terminal

Sublime crashes immediately.

0 Likes

#4

Which build are you using?

0 Likes

#5

The latest official one - 4107

0 Likes

#6

If you have a license you can try and see if it happens on the development build 4109: https://www.sublimetext.com/dev

0 Likes

#7

Yes, same thing with 4109, it crashes immediately.

EDIT: I used safe mode with 4109 as well.

0 Likes

#8

@simov I had similar issue:

if the project is opened in ST and later there are some directories created inside project folder but these directories belong to different user (in my case they are created by Docker and they are created as root user). If I try to remove these directories with rm -rf dirname I got rm: cannot remove 'dirname': Permission denied. And after I forced deletion by sudo rm -rf dirname, then ST crashed.

For directories which were created and deleted by myself no crashes happened.

Magically it is not an issue anymore, after returning from two weeks vacation crashes stopped, maybe ST updated and fixed the issue.

But if this happens with same conditions in your case it may shed light on the source of the issue somehow

0 Likes

#9

Thanks for the feedback, @DDDsa, unfortunately I don’t think that’s related in my case. All files are owned by my user since I did the clone on my local workstation. I also opened the folder, it’s not a project, in Sublime using the actual path, meaning not a symlink because I have that too, just in case.

So in my case it’s really opening a folder in Sublime and then triggering a directory change from my terminal.

0 Likes

#10

Seems like an issue I’ve been having on MacOS.
I narrowed it down to a git project I was using as a submodule, but I was able to reproduce it every time with it:

0 Likes

#11

The crash is still present on 4110 --safe-mode. I followed the instructions from this thread Sublime Merge crashes without any logs to get some crash logs:

Thread 1 "sublime_text" received signal SIGSEGV, Segmentation fault.
0x00000000005b9e8a in ?? ()
(gdb) bt
#0  0x00000000005b9e8a in  ()
#1  0x0000000000674a10 in  ()
#2  0x00000000006bfe4a in  ()
#3  0x00000000006d5090 in  ()
#4  0x000000000066178b in  ()
#5  0x000000000065ffe7 in  ()
#6  0x000000000065dc29 in  ()
#7  0x000000000063e528 in  ()
#8  0x00000000006e8360 in  ()
#9  0x00000000006e8275 in  ()
#10 0x00007f120b8663a5 in g_main_context_dispatch () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#11 0x00007f120b866770 in  () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#12 0x00007f120b866a82 in g_main_loop_run () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#13 0x00007f1203637a25 in gtk_main () at /usr/lib/x86_64-linux-gnu/libgtk-3.so.0
#14 0x00000000006ee51e in  ()
#15 0x00000000005544c5 in  ()
#16 0x00007f120a8c9bf7 in __libc_start_main (main=
    0x550949, argc=3, argv=0x7fff9938e398, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7fff9938e388) at ../csu/libc-start.c:310
#17 0x00000000004a767a in  ()

I’m totally not sure what I’m looking at, but I checked my GTK version as well:

ii  libgtk-3-0:amd64                                      3.22.30-1ubuntu4                amd64
ii  libgtk2.0-0:amd64                                     2.24.32-1ubuntu1                amd64

Then I used strace and I got this:

inotify_add_watch(13, "/home/s/projects/the-project/.git", IN_MODIFY|IN_ATTRIB|IN_MOVED_FROM|IN_MOVED_TO|IN_CREATE|IN_DELETE) = 62
futex(0x274c260, FUTEX_WAKE_PRIVATE, 1) = 1
inotify_add_watch(13, "/home/s/projects/the-project/bin", IN_MODIFY|IN_ATTRIB|IN_MOVED_FROM|IN_MOVED_TO|IN_CREATE|IN_DELETE) = 65
futex(0x274c260, FUTEX_WAKE_PRIVATE, 1) = 1
inotify_add_watch(13, "/home/s/projects/the-project/src", IN_MODIFY|IN_ATTRIB|IN_MOVED_FROM|IN_MOVED_TO|IN_CREATE|IN_DELETE) = 66
futex(0x274c260, FUTEX_WAKE_PRIVATE, 1) = 1
inotify_add_watch(13, "/home/s/projects/the-project/terraform", IN_MODIFY|IN_ATTRIB|IN_MOVED_FROM|IN_MOVED_TO|IN_CREATE|IN_DELETE) = 67
futex(0x274c260, FUTEX_WAKE_PRIVATE, 1) = 1
inotify_add_watch(13, "/home/s/projects/the-project/tests", IN_MODIFY|IN_ATTRIB|IN_MOVED_FROM|IN_MOVED_TO|IN_CREATE|IN_DELETE) = 68
futex(0x274c260, FUTEX_WAKE_PRIVATE, 1) = 1
--- SIGSEGV {si_signo=SIGSEGV, si_code=SEGV_MAPERR, si_addr=0x21} ---
rt_sigaction(SIGSEGV, NULL, {sa_handler=0x631b4c, sa_mask=[ILL TRAP ABRT BUS FPE SEGV], sa_flags=SA_RESTORER|SA_ONSTACK|SA_SIGINFO, sa_restorer=0x7f95f2f64980}, 8) = 0
prctl(PR_SET_DUMPABLE, SUID_DUMP_USER)  = 0
gettid()                                = 20016
mmap(NULL, 16384, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f95f45c8000
getpid()                                = 20016
pipe([128, 129])                        = 0
clone(child_stack=0x7f95f45cbe80, flags=CLONE_FS|CLONE_UNTRACED) = 20176
close(128)                              = 0
prctl(PR_SET_PTRACER, 20176)            = 0
write(129, "a", 1)                      = 1
wait4(20176, [{WIFEXITED(s) && WEXITSTATUS(s) == 0}], __WALL, NULL) = 20176
close(129)                              = 0
clone(child_stack=NULL, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0x7f95f464bb10) = 20177
munmap(0x7f95f45c8000, 16384)           = 0
rt_sigaction(SIGSEGV, {sa_handler=SIG_DFL, sa_mask=[SEGV], sa_flags=SA_RESTORER|SA_RESTART, sa_restorer=0x7f95f2ba0040}, {sa_handler=0x631b4c, sa_mask=[ILL TRAP ABRT BUS FPE SEGV], sa_flags=SA_RESTORER|SA_ONSTACK|SA_SIGINFO, sa_restorer=0x7f95f2f64980}, 8) = 0
rt_sigreturn({mask=[]})                 = 1
--- SIGSEGV {si_signo=SIGSEGV, si_code=SEGV_MAPERR, si_addr=0x21} ---
+++ killed by SIGSEGV (core dumped) +++
0 Likes

#12

For what it’s worth, I cloned the memfault-firmware-sdk repository (did all the steps mentioned in your post), but ST doesn’t crash on Windows 10.

0 Likes

#13

I tried that repo with 4110 in safe mode, the first time sublime got unresponsive, and I had to force quit, the second time it crashed immediately.

Same output with strace at the end:

--- SIGSEGV {si_signo=SIGSEGV, si_code=SEGV_MAPERR, si_addr=0x3564000} ---
rt_sigaction(SIGSEGV, NULL, {sa_handler=0x631b4c, sa_mask=[ILL TRAP ABRT BUS FPE SEGV], sa_flags=SA_RESTORER|SA_ONSTACK|SA_SIGINFO, sa_restorer=0x7f05d9e22980}, 8) = 0
prctl(PR_SET_DUMPABLE, SUID_DUMP_USER)  = 0
gettid()                                = 26349
mmap(NULL, 16384, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f05db48d000
getpid()                                = 26349
pipe([128, 129])                        = 0
clone(child_stack=0x7f05db490e80, flags=CLONE_FS|CLONE_UNTRACED) = 26481
close(128)                              = 0
prctl(PR_SET_PTRACER, 26481)            = 0
write(129, "a", 1)                      = 1
wait4(26481, [{WIFEXITED(s) && WEXITSTATUS(s) == 0}], __WALL, NULL) = 26481
close(129)                              = 0
clone(child_stack=NULL, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0x7f05db509b10) = 26482
munmap(0x7f05db48d000, 16384)           = 0
rt_sigaction(SIGSEGV, {sa_handler=SIG_DFL, sa_mask=[SEGV], sa_flags=SA_RESTORER|SA_RESTART, sa_restorer=0x7f05d9a5e040}, {sa_handler=0x631b4c, sa_mask=[ILL TRAP ABRT BUS FPE SEGV], sa_flags=SA_RESTORER|SA_ONSTACK|SA_SIGINFO, sa_restorer=0x7f05d9e22980}, 8) = 0
rt_sigreturn({mask=[]})                 = 44936024
--- SIGSEGV {si_signo=SIGSEGV, si_code=SEGV_MAPERR, si_addr=0x3564000} ---
+++ killed by SIGSEGV (core dumped) +++
0 Likes