Crash in

I am getting crash when LT is enabled
LT 6.0
Build ID: 40(Build:1)
CPU threads: 20; OS: Linux 6.1; UI render: default; VCL: kf5 (cairo+xcb)
Locale: en-US (en_US.UTF-8); UI: en-US at /builddir/build/BUILD/libreoffice-
at Method)
at jdk.proxy1/jdk.proxy1.$Proxy47.nextElement(Unknown Source)
at org.languagetool.openoffice.DocumentCursorTools.getDeletedCharacters(
at org.languagetool.openoffice.DocumentCursorTools.getAllTextParagraphs(
at org.languagetool.openoffice.DocumentCache.refreshWriterCache(
at org.languagetool.openoffice.DocumentCache.refresh(
at org.languagetool.openoffice.DocumentCache.refreshAndCompare(
at org.languagetool.openoffice.CheckRequestAnalysis.handleCacheChanges(
at org.languagetool.openoffice.CheckRequestAnalysis.changesInNumberOfParagraph(
at org.languagetool.openoffice.CheckRequestAnalysis.getParaFromFlatparagraph(
at org.languagetool.openoffice.CheckRequestAnalysis.getParaPos(
at org.languagetool.openoffice.CheckRequestAnalysis.getNumberOfParagraph(
at org.languagetool.openoffice.SingleDocument.getCheckResults(
at org.languagetool.openoffice.SingleDocument.getCheckResults(
at org.languagetool.openoffice.MultiDocumentsHandler.getCheckResults(
at org.languagetool.openoffice.MultiDocumentsHandler.doProofreading(
at org.languagetool.openoffice.Main.doProofreading(

In what context happened the crash?

I had a file opened (big one - ~180 pages) and LT check enabled (Ukrainian language).
After I work editing the text and scrolling through the pages at some point LibreOffice crashes.
Usually happened every ~3-5 min, and roughly 5-10 pages scrolled.

Ok, a but more context: I had lots of sentences split by new line (new paragraph to be precise), so I had a lot of UpperCaseSentence rule errors. I was merging lots of sentences together, I wonder if that has something to do with it.
Also I had the option set to Text mode.
Once I turned that rule off and switched to Paragraph mode it started to work way quicker and I don’t think it crashes any more (even if I merge sentences).

The paragraph mode is a simpler check mode that does not perform cross-paragraph checks. The affected function is not used there.

To find the cause of the problem, I have to ask again:
What do you mean by ‘LibreOffice crashes’? Did LibreOffice really crash (shutdown), or did a LanguageTool window open with the error message? In the first case: Where does the error message come from?

LibreOffice app completely crashes (shuts down), the error I saw was in the log in ~/.config/LanguageTool/LibreOffice

From my point of view, it is a LibreOffice bug. There is a timing problem within the interface between the LO app and the LT extension. This should result in giving back a null, not in a crash.
I can’t reproduce the problem at my machine. So, I can’t run tests. I made a change in the code for a workaround. It is in tomorrow’s snapshot. Could you install the snapshot tomorrow and test it?

Thank you, is there a snapshot repo or shall I build it myself?

The snapshots are here: Index of /snapshots/.
Please test the latest OXT.

I’ve tried a bit more with latest SNAPSHOT and I think it was more stable, I went through ~60 pages and was about to say all good when I got another crash. I am attaching the log. Although I am not sure if the NPE caused actual crash (I guess not)
LanguageTool.txt (4.1 KB)

java.lang.NullPointerException: Cannot read field “Language” because “locale” is null
at org.languagetool.openoffice.OfficeTools.localeToString(
at org.languagetool.openoffice.TextLevelCheckQueue.getLanguage(
at org.languagetool.openoffice.TextLevelCheckQueue$

I think the NPE is not the reason of the crash, but I solved the problem. It is corrected in the snapshot tomorrow.

Thank you, I appreciate your help on this!!

Probably not too important, but I just opened a document in LibreOffice by mistake, so I closed before it even rendered and got LT exception:

MultiDocumentsHandler: setContextOfClosedDoc: Error: Disposed Document not found - Cache not deleted at /builddir/build/BUILD/libreoffice-
    at Method)
    at jdk.proxy1/jdk.proxy1.$Proxy38.getCurrentController(Unknown Source)
    at org.languagetool.openoffice.SingleDocument.setDokumentListener(
    at org.languagetool.openoffice.SingleDocument.<init>(
    at org.languagetool.openoffice.MultiDocumentsHandler.getNumDoc(
    at org.languagetool.openoffice.MultiDocumentsHandler.getCheckResults(
    at org.languagetool.openoffice.MultiDocumentsHandler.doProofreading(
    at org.languagetool.openoffice.Main.doProofreading(