Sublime Forum

Build 3181 segfaults on startup on macOS

#1

stacktrace from the crash reporter tool:

Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0   com.sublimetext.3             	0x0000000101fa9d00 next_token(usubstring) + 48
1   com.sublimetext.3             	0x0000000101faa75a lex(lex_working_memory&, LexerState*, usubstring, std::__1::vector<TokenInfo, std::__1::allocator<TokenInfo> >&) + 2042
2   com.sublimetext.3             	0x0000000101fbc717 TokenStorage::tokenise(BucketContainer<tree_list<TokenBuffer, TokenBuffer::token_list_ops>, TokenStorage::TokenBufferFactory>::iterator, long long, LexerState*, usubstring) + 663
3   com.sublimetext.3             	0x0000000101fba5df TokenStorage::insertCharacters(long long, usubstring) + 671
4   com.sublimetext.3             	0x00000001022abf7f process_read_data(ReadData*) + 1310
5   com.sublimetext.3             	0x00000001022ab143 FileBufferSource::beginRead(TextBuffer*, TokenStorage*) + 623
6   com.sublimetext.3             	0x00000001022e899f TextBuffer::associate(BufferSource*) + 207
7   com.sublimetext.3             	0x000000010205cbd0 crawl_app_loader::callback_finished() + 1366
8   com.sublimetext.3             	0x000000010211cf87 setup_operation::request_finished() + 33
9   com.sublimetext.3             	0x00000001020dedc0 catalogue_rescan_operation::merge_finished(catalogue::dir*) + 160
10  com.sublimetext.3             	0x00000001020e0042 catalogue_rescan_operation::scan_callback::main_scan_single_dir(substring, std::__1::vector<file_info, std::__1::allocator<file_info> > const&) + 3916
11  com.sublimetext.3             	0x00000001020c4ff7 result_helper::process_main() + 15
12  com.sublimetext.3             	0x0000000102160708 -[WorkQueueCallback processItems:] + 151
13  com.apple.Foundation          	0x00007fff45f2dabb __NSThreadPerformPerform + 327
14  com.apple.CoreFoundation      	0x00007fff43b4f155 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
15  com.apple.CoreFoundation      	0x00007fff43b4f0fb __CFRunLoopDoSource0 + 108
16  com.apple.CoreFoundation      	0x00007fff43b32b95 __CFRunLoopDoSources0 + 195
17  com.apple.CoreFoundation      	0x00007fff43b3213e __CFRunLoopRun + 1219
18  com.apple.CoreFoundation      	0x00007fff43b31a28 CFRunLoopRunSpecific + 463
19  com.apple.Foundation          	0x00007fff45e983ba -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 280
20  com.sublimetext.3             	0x000000010216881f px_run_event_loop() + 137
21  com.sublimetext.3             	0x0000000101f9e56a main + 5700
22  com.sublimetext.3             	0x0000000101f9cc94 start + 52

I’ll try gathering some more info

0 Likes

#2

After removing all cache data the crash does not occur anymore :slight_smile:

cd "~/Library/Application Support/Sublime Text 3"
rm -rf Index Backup Cache
rm Local/Session.sublime_session
0 Likes

#3

Looks fairly similar to https://github.com/sublimehq/Packages/issues/1671, I wonder if they are related somehow.

0 Likes

#4

UPDATE

I can confirm that starting with env GDK_BACKEND=x11 subl as described in Issue #2488 fixes the problem.


Build 3181 segfaults on Linux too.

I’ve removed the entire .config/sublime-text-3 folder.

When I start subl, it asks me for the license. I enter my license, it says thank you, and on next start it segfaults.

dmesg output:

[  644.733751] sublime_text[3793]: segfault at 0 ip 0000000000000000 sp 00007ffe65b90678 error 14 in sublime_text[200000+2b2000]
[  644.733758] Code: Bad RIP value.

I’ve added valgrind output below, and the dump is here: https://transfer.sh/JTZGE/44352914-17fc-4d4e-44289288-dd663e51.dmp

valgrind output

  % valgrind -v  /usr/bin/subl                    
==4891== Memcheck, a memory error detector
==4891== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==4891== Using Valgrind-3.14.0-353a3587bb-20181007X and LibVEX; rerun with -h for copyright info
==4891== Command: /usr/bin/subl
==4891== 
--4891-- Valgrind options:
--4891--    -v
--4891-- Contents of /proc/version:
--4891--   Linux version 4.18.0-3-amd64 (debian-kernel@lists.debian.org) (gcc version 7.3.0 (Debian 7.3.0-30)) #1 SMP Debian 4.18.20-2 (2018-11-23)
--4891-- 
--4891-- Arch and hwcaps: AMD64, LittleEndian, amd64-cx16-lzcnt-rdtscp-sse3-avx-avx2-bmi
--4891-- Page sizes: currently 4096, max supported 4096
--4891-- Valgrind library directory: /usr/lib/x86_64-linux-gnu/valgrind
--4891-- Reading syms from /bin/dash
--4891--    object doesn't have a symbol table
--4891-- Reading syms from /lib/x86_64-linux-gnu/ld-2.28.so
--4891--   Considering /usr/lib/debug/.build-id/59/3875c1bda1bb2d739f6892bceb12d7282a57a3.debug ..
--4891--   .. build-id is valid
--4891-- Reading syms from /usr/lib/x86_64-linux-gnu/valgrind/memcheck-amd64-linux
--4891--   Considering /usr/lib/debug/.build-id/93/5efea22a69d45c080fd7ebab50cfe06d56e7af.debug ..
--4891--   .. build-id is valid
--4891--    object doesn't have a dynamic symbol table
--4891-- Scheduler: using generic scheduler lock implementation.
--4891-- Reading suppressions file: /usr/lib/x86_64-linux-gnu/valgrind/default.supp
==4891== embedded gdbserver: reading from /tmp/vgdb-pipe-from-vgdb-to-4891-by-fl-on-???
==4891== embedded gdbserver: writing to   /tmp/vgdb-pipe-to-vgdb-from-4891-by-fl-on-???
==4891== embedded gdbserver: shared mem   /tmp/vgdb-pipe-shared-mem-vgdb-4891-by-fl-on-???
==4891== 
==4891== TO CONTROL THIS PROCESS USING vgdb (which you probably
==4891== don't want to do, unless you know exactly what you're doing,
==4891== or are doing some strange experiment):
==4891==   /usr/lib/x86_64-linux-gnu/valgrind/../../bin/vgdb --pid=4891 ...command...
==4891== 
==4891== TO DEBUG THIS PROCESS USING GDB: start GDB like this
==4891==   /path/to/gdb /usr/bin/subl
==4891== and then give GDB the following command
==4891==   target remote | /usr/lib/x86_64-linux-gnu/valgrind/../../bin/vgdb --pid=4891
==4891== --pid is optional if only one valgrind process is running
==4891== 
--4891-- REDIR: 0x401e350 (ld-linux-x86-64.so.2:strlen) redirected to 0x580c97f2 (vgPlain_amd64_linux_REDIR_FOR_strlen)
--4891-- REDIR: 0x401e130 (ld-linux-x86-64.so.2:index) redirected to 0x580c980c (vgPlain_amd64_linux_REDIR_FOR_index)
--4891-- Reading syms from /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_core-amd64-linux.so
--4891--   Considering /usr/lib/debug/.build-id/3d/5115a2ef08a4077609b25d33f892f9260b8b5b.debug ..
--4891--   .. build-id is valid
--4891-- Reading syms from /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so
--4891--   Considering /usr/lib/debug/.build-id/19/fb020e170903e05352b43e84af203f8f9ed2d8.debug ..
--4891--   .. build-id is valid
==4891== WARNING: new redirection conflicts with existing -- ignoring it
--4891--     old: 0x0401e350 (strlen              ) R-> (0000.0) 0x580c97f2 vgPlain_amd64_linux_REDIR_FOR_strlen
--4891--     new: 0x0401e350 (strlen              ) R-> (2007.0) 0x04838d80 strlen
--4891-- REDIR: 0x401ab70 (ld-linux-x86-64.so.2:strcmp) redirected to 0x4839e40 (strcmp)
--4891-- REDIR: 0x401e890 (ld-linux-x86-64.so.2:mempcpy) redirected to 0x483d860 (mempcpy)
--4891-- Reading syms from /lib/x86_64-linux-gnu/libc-2.28.so
--4891--   Considering /usr/lib/debug/.build-id/c5/a68d5efb81a38d4a35e61efe5a1e9c6e440b6a.debug ..
--4891--   .. build-id is valid
--4891-- REDIR: 0x48fa1d0 (libc.so.6:memmove) redirected to 0x482b1b0 (_vgnU_ifunc_wrapper)
--4891-- REDIR: 0x48f93c0 (libc.so.6:strncpy) redirected to 0x482b1b0 (_vgnU_ifunc_wrapper)
--4891-- REDIR: 0x48fa4b0 (libc.so.6:strcasecmp) redirected to 0x482b1b0 (_vgnU_ifunc_wrapper)
--4891-- REDIR: 0x48f8df0 (libc.so.6:strcat) redirected to 0x482b1b0 (_vgnU_ifunc_wrapper)
--4891-- REDIR: 0x48f93f0 (libc.so.6:rindex) redirected to 0x482b1b0 (_vgnU_ifunc_wrapper)
--4891-- REDIR: 0x48fbae0 (libc.so.6:rawmemchr) redirected to 0x482b1b0 (_vgnU_ifunc_wrapper)
--4891-- REDIR: 0x49144a0 (libc.so.6:wmemchr) redirected to 0x482b1b0 (_vgnU_ifunc_wrapper)
--4891-- REDIR: 0x4913f40 (libc.so.6:wcscmp) redirected to 0x482b1b0 (_vgnU_ifunc_wrapper)
--4891-- REDIR: 0x48fa340 (libc.so.6:mempcpy) redirected to 0x482b1b0 (_vgnU_ifunc_wrapper)
--4891-- REDIR: 0x48fa170 (libc.so.6:bcmp) redirected to 0x482b1b0 (_vgnU_ifunc_wrapper)
--4891-- REDIR: 0x48f9360 (libc.so.6:strncmp) redirected to 0x482b1b0 (_vgnU_ifunc_wrapper)
--4891-- REDIR: 0x48f8e60 (libc.so.6:strcmp) redirected to 0x482b1b0 (_vgnU_ifunc_wrapper)
--4891-- REDIR: 0x48fa2a0 (libc.so.6:memset) redirected to 0x482b1b0 (_vgnU_ifunc_wrapper)
--4891-- REDIR: 0x4913f10 (libc.so.6:wcschr) redirected to 0x482b1b0 (_vgnU_ifunc_wrapper)
--4891-- REDIR: 0x48f9300 (libc.so.6:strnlen) redirected to 0x482b1b0 (_vgnU_ifunc_wrapper)
--4891-- REDIR: 0x48f8ef0 (libc.so.6:strcspn) redirected to 0x482b1b0 (_vgnU_ifunc_wrapper)
--4891-- REDIR: 0x48fa500 (libc.so.6:strncasecmp) redirected to 0x482b1b0 (_vgnU_ifunc_wrapper)
--4891-- REDIR: 0x48f8ec0 (libc.so.6:strcpy) redirected to 0x482b1b0 (_vgnU_ifunc_wrapper)
--4891-- REDIR: 0x48fa640 (libc.so.6:memcpy@@GLIBC_2.14) redirected to 0x482b1b0 (_vgnU_ifunc_wrapper)
--4891-- REDIR: 0x4915740 (libc.so.6:wcsnlen) redirected to 0x482b1b0 (_vgnU_ifunc_wrapper)
--4891-- REDIR: 0x48f9420 (libc.so.6:strpbrk) redirected to 0x482b1b0 (_vgnU_ifunc_wrapper)
--4891-- REDIR: 0x48f8e20 (libc.so.6:index) redirected to 0x482b1b0 (_vgnU_ifunc_wrapper)
--4891-- REDIR: 0x48f92d0 (libc.so.6:strlen) redirected to 0x482b1b0 (_vgnU_ifunc_wrapper)
--4891-- REDIR: 0x49004f0 (libc.so.6:memrchr) redirected to 0x482b1b0 (_vgnU_ifunc_wrapper)
--4891-- REDIR: 0x48fa550 (libc.so.6:strcasecmp_l) redirected to 0x482b1b0 (_vgnU_ifunc_wrapper)
--4891-- REDIR: 0x48fa140 (libc.so.6:memchr) redirected to 0x482b1b0 (_vgnU_ifunc_wrapper)
--4891-- REDIR: 0x4914020 (libc.so.6:wcslen) redirected to 0x482b1b0 (_vgnU_ifunc_wrapper)
--4891-- REDIR: 0x48f96c0 (libc.so.6:strspn) redirected to 0x482b1b0 (_vgnU_ifunc_wrapper)
--4891-- REDIR: 0x48fa480 (libc.so.6:stpncpy) redirected to 0x482b1b0 (_vgnU_ifunc_wrapper)
--4891-- REDIR: 0x48fa450 (libc.so.6:stpcpy) redirected to 0x482b1b0 (_vgnU_ifunc_wrapper)
--4891-- REDIR: 0x48fbb10 (libc.so.6:strchrnul) redirected to 0x482b1b0 (_vgnU_ifunc_wrapper)
--4891-- REDIR: 0x48fa5a0 (libc.so.6:strncasecmp_l) redirected to 0x482b1b0 (_vgnU_ifunc_wrapper)
--4891-- REDIR: 0x48fa080 (libc.so.6:strstr) redirected to 0x482b1b0 (_vgnU_ifunc_wrapper)
--4891-- REDIR: 0x49cd400 (libc.so.6:__strrchr_avx2) redirected to 0x4838790 (rindex)
--4891-- REDIR: 0x48f55e0 (libc.so.6:malloc) redirected to 0x4835710 (malloc)
--4891-- REDIR: 0x49cd210 (libc.so.6:__strchrnul_avx2) redirected to 0x483d390 (strchrnul)
--4891-- REDIR: 0x49cd5d0 (libc.so.6:__strlen_avx2) redirected to 0x4838c60 (strlen)
--4891-- REDIR: 0x49cdb10 (libc.so.6:__memcpy_avx_unaligned_erms) redirected to 0x483c8a0 (memmove)
--4891-- REDIR: 0x49cdaf0 (libc.so.6:__mempcpy_avx_unaligned_erms) redirected to 0x483d4a0 (mempcpy)
--4891-- REDIR: 0x49c8b10 (libc.so.6:__strcmp_avx2) redirected to 0x4839d00 (strcmp)
--4891-- REDIR: 0x49c8720 (libc.so.6:__strcspn_sse42) redirected to 0x483dc00 (strcspn)
--4891-- REDIR: 0x49c88a0 (libc.so.6:__strpbrk_sse42) redirected to 0x483dba0 (strpbrk)
--4891-- REDIR: 0x49ccfe0 (libc.so.6:__strchr_avx2) redirected to 0x4838910 (index)
--4891-- REDIR: 0x490e370 (libc.so.6:__strcpy_sse2_unaligned) redirected to 0x4838db0 (strcpy)
--4891-- REDIR: 0x48f5c20 (libc.so.6:free) redirected to 0x4836940 (free)
0 Likes