Skip to content

Several crashes while typing text #1832

@evandrocoan

Description

@evandrocoan

Summary

When the crash occurred, I could copy some info from Visual Studio:

Unhandled exception at 0x00AC7691 in sublime_text.exe: 0xC000041D: An unhandled exception was encountered during a user callback. occurred

It crashed from yesterday, to today twice while was typing text. On this screen shot points to the exactly moment when it crashed. I was typing Bu, then the autocomplete pops up. But suddenly Sublime Text stopped, and the windows Crash Dialog/Report showed up:

image

Then it asked to open with my debugger Visual Studio 2017, and when it opened it asked for the debug symbols. But I forgot to copy the whole call stack from the Visual Studio, but I have a picture:

image

untitled

But I do not have them. Anyway, I cannot post here the dump file, because all the times Sublime Text is crashing now, the dump file has size 0. The dump file generated this time had the name 1c3144ee-5221-46fc-8d66-5ae3bac633fa.dmp, but as the others, it had size 0, i.e., the file is completely empty:

image

Dump file view from inside it:

image

Expected behavior

Not crash while I am using the program.

Actual behavior

The program crashes when I am typing simple long texts.

Steps to reproduce

I which I knew steps to reproduce it. For now the crashes are completely random. But they all seem to have one thing in common. I am typing text. May be related to the auto complete?

I use this auto complete for words auto complete form all views:

	def on_query_completions(self, view, prefix, locations):

        ... the called function for text files is this:

	def all_views_autocomplete( self, active_view, prefix, locations, g_words_set ):
		# print_debug( 16, "AMXXEditor::all_views_autocomplete(5)" )
		# print_debug( 16, "( all_views_autocomplete ) g_words_set size: %d" % len( g_words_set ) )

		words_set  = g_words_set.copy()
		words_list = []
		start_time = time.time()

		if g_word_autocomplete:
			view_words = None

			if len( locations ) > 0:
				view_words = active_view.extract_completions( prefix, locations[0] )
			else:
				view_words = active_view.extract_completions( prefix )

			view_words = fix_truncation( active_view, view_words )

			for word in view_words:
				# Remove the annoying `(` on the string
				word = word.replace('$', '\\$').split('(')[0]

				if word not in words_set:
					words_set.add( word )
					words_list.append( ( word, word ) )

				if time.time() - start_time > 0.05:
					break

		# print_debug( 16, "( all_views_autocomplete ) Current views loop took: %f" % ( time.time() - start_time ) )
		# print_debug( 16, "( all_views_autocomplete ) words_set size: %d" % len( words_set ) )

		if g_use_all_autocomplete:
			# Limit number of views but always include the active view. This
			# view goes first to prioritize matches close to cursor position.
			views = sublime.active_window().views()

			buffers_id_set = set()
			view_words 	   = None
			view_base_name = None

			buffers_id_set.add( active_view.buffer_id() )

			for view in views:
				view_buffer_id = view.buffer_id()
				# print_debug( 16, "( all_views_autocomplete ) view: %d" % view.id() )
				# print_debug( 16, "( all_views_autocomplete ) buffers_id: %d" % view_buffer_id )
				# print_debug( 16, "( all_views_autocomplete ) buffers_id_set size: %d" % len( buffers_id_set ) )

				if view_buffer_id not in buffers_id_set:
					buffers_id_set.add( view_buffer_id )

					view_words     = view.extract_completions(prefix)
					view_words     = fix_truncation(view, view_words)
					view_base_name = view.file_name()

					if view_base_name is None:
						view_base_name = ""
					else:
						view_base_name = os.path.basename( view_base_name )

					for word in view_words:
						# Remove the annoying `(` on the string
						word = word.replace('$', '\\$').split('(')[0]

						if word not in words_set:
							# print_debug( 16, "( all_views_autocomplete ) word: %s" % word )
							words_set.add( word )
							words_list.append( ( word + ' \t' + view_base_name, word ) )

						if time.time() - start_time > 0.3:
							# print_debug( 16, "( all_views_autocomplete ) Breaking all views loop after: %f" % time.time() - start_time )
							# print_debug( 16, "( all_views_autocomplete ) words_set size: %d" % len( words_set ) )
							return words_list

		# print_debug( 16, "( all_views_autocomplete ) All views loop took: %f" % ( time.time() - start_time ) )
		# print_debug( 16, "( all_views_autocomplete ) words_set size: %d" % len( words_set ) )
		return words_list


  1. https://github.com/evandrocoan/SublimeAMXX_Editor/blob/master/AMXXEditor.py#L346-L500

Environment

  • Operating system and version:
    • Windows 10 build 15063
    • Mac OS ...
    • Linux ...
  • Monitor:
    • Resolution 1920x1080
    • dpi_scale used in ST 1.0
  • Sublime Text:
    • Build 3141
    • 32 bit

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions