Open Vilhelm-Ian opened 10 months ago
I was able to triage the problem it is related with "search on typing" option
it also crashes when you check "search on typing" and dosen't crash when you uncheck "search on typing"
checking "search typing" calls this function
SIAC.State.searchOnSelection = $(this).is(":checked"); sendSearchOnSelection();
but calling it dircetly from the browser does nothing
executing this command {showLoading('Searchbar'),html=byId('siac-browser-search-inp').value+'\x1F',pycmd('siac-r-srch-db '+SIAC.State.selectedDecks.toString()+' ~ '+html)}
crashes anki
specifically this part
pycmd('siac-r-srch-db '+SIAC.State.selectedDecks.toString()+' ~ '+html)
the problem appears when a user searches for something but the search is empty. if len(content) < 1: UI.empty_result("No results found for empty string")
this part of the code is executede
# cls._editor.web.eval("setSearchResults(null, '', `%s`, null, 1, 1, 50, %s)" % (message, len(cls.previous_calls) + 1))
commenting this line out prevents itfrom crashing
I figured out whatthe problem is
~~setSearchResults(null, '', %s
, null, 1, 1, 50, %s)" % (message, len(cls.previous_calls) + 1
the second %s is missing ` `~~
nope it's not that. for some reason any code that you run with web.eval makes it crash. I have no idea why cls._editor.web.eval("console.log('hi');")
~~I found out what was the issue.
dosen't have the eval metho cls._editor.web~~
nope that's not the issue
Someone on ankiweb mentioned that the issue is probably caused because the addon is trying to envoke qt code from a background thread
The error I get is
'anki' terminated by signal SIGTRAP (Trace or breakpoint trap)
it happens after creating multiple notes and no pdf is opened. The number of new cards required for it to happen is variable.