Sublime Forum

Build 4143 Crashing on indexing


Mac OS 12.6.5

I am suffering from Sublime Text crashing when I open it each morning. I have been able to get going by using Time Machine to restore older versions of the ~/Library/Application Support/Sublime Text 3 directory. But the problem always returns. I have tried creating new projects and sometimes that works for a while, but it always returns. I have to come up with workarounds every morning. I have now turned off index_files and will see what happens in the morning.

Any thoughts on how to keep the index for getting corrupt, or whatever is happening?




Does it still happen in safe mode?



Not that I know of. But it is hard to repro consistently.

More information: I found there were files that would crash the app when I opened them. If I closed the app, renamed the config directory under ~/Library/Application Support, I could open the app (creating a new config) and open the file without it crashing. So…

I have a new config directory, I have installed the plugins I need, copied over my license, snippets, and build files along with some settings. It is running now and I hope it will not crash tomorrow morning. Is it possible that it is not the indexing, but the caching that is corrupt? Is there a way to clear the cache easily?



You can find the location of the cache described on this page:



Thanks. I tried going back to my original settings, remove the ‘index_files: false’ setting, and just removing the ~/Library/Caches/Sublime Text* directories, but it crashed during indexing. So, I am back to my new config. It seemed to index fine. We will see for how long.



Note that indexing is done using separate processes so that if they crash they don’t affect the app. The cause is likely not related to indexing happening in the background.




What I know so far:

  1. The only way I have been able to recover is by replacing ~/Library/Application Support/Sublime Text with an older version or a new clean version.
  2. With a clean version, all went well until…
  3. I enabled the Babel text highlighting package for .js & .jsx files in order to get highlighting for jsx within .vue files: crashes started occurring again and I had to revert the ~/Library/Application Support/Sublime Text.
  4. Interesting that these crashes started happening after the babel/babel-sublime package was updated on May 10th.
  5. Once the app starts crashing, it always crashes at the same percentage shown in the footer of the app. No idea what those percentages are indicating, thought they had to do with indexing.
  6. Last check of the stack produced during the crash was in lex:

Thread 0 Crashed:: Dispatch queue:
0 sublime_text 0x10ecb6bf4 lex(lex_working_memory*, LexerState*, u32substring, std::__1::vector<TokenInfo, std::__1::allocator >&, long long, backtracking_state*, lexer_state_extractor*) + 10628
1 sublime_text 0x10ecc9384 TokenStorage::updateLexerState(long long) + 2324
2 sublime_text 0x10ecf8bfa TokenStorage::findNamesByScopes(selector_set const&, selector_set const&, std::__1::vector<std::__1::pair<SelectionRegion, NameStack>, std::__1::allocator<std::__1::pair<SelectionRegion, NameStack> > >&) + 122
3 sublime_text 0x10eb477d9 get_indexed_symbol_regions(SP, symbol_parser*, symbol_type, std::__1::vector<symbol_region, std::__1::allocator<symbol_region> >) + 89
4 sublime_text 0x10e8581b8 do_crawl(int, char**) + 1158
5 sublime_text 0x10e859033 crawl_app_loader::callback_finished() + 37
6 sublime_text 0x10e960353 setup_operation::request_finished() + 39
7 sublime_text 0x10e915d05 catalogue_rescan_operation::merge_finished(catalogue::dir
) + 173
8 sublime_text 0x10e8f5cc9 result_helper::process_main() + 15
9 sublime_text 0x10e9b5d9a -[WorkQueueCallback processItems:] + 141
10 Foundation 0x7ff80ca9c527 __NSThreadPerformPerform + 179
11 CoreFoundation 0x7ff80bc1f15b __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
12 CoreFoundation 0x7ff80bc1f0c3 __CFRunLoopDoSource0 + 180
13 CoreFoundation 0x7ff80bc1ee3d __CFRunLoopDoSources0 + 242
14 CoreFoundation 0x7ff80bc1d858 __CFRunLoopRun + 892
15 CoreFoundation 0x7ff80bc1ce1c CFRunLoopRunSpecific + 562
16 Foundation 0x7ff80ca7ad4a -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 216
17 sublime_text 0x10e9be952 px_run_event_loop() + 137
18 sublime_text 0x10e7d89c4 main + 4248
19 dyld 0x115c2752e start + 462

Hope this helps in understanding what is going on.



Looks like the crawl subprocess is crashing. This seems to be another instance of a child process crashing causing the parent process to also crash. This bug was fixed in build 4148.

The crash itself still seems like a bug, though there have been another of related fixes since 4143 so it may already be fixed.



When should we expect to see these changes in a stable release?