languagetool-org / languagetool

Style and Grammar Checker for 25+ Languages
https://languagetool.org
GNU Lesser General Public License v2.1
12.27k stars 1.38k forks source link

LanguageTool 5.6 causes LibreOffice Writer to crash #6412

Closed GerryT11 closed 7 months ago

GerryT11 commented 2 years ago

I experience LibreOffice Writer 7.2.5 / 7.3.0 crashes when the LanguageTool 5.5 / 5.6 extension is active. The crashes happen shortly after a document has loaded.

I filed a bug in the LibreOffice bug tracker with detailed information: https://bugs.documentfoundation.org/show_bug.cgi?id=147668 A LibreOffice developer confirmed that LanguageTool triggers the crashes and LibreOffice cannot deal with it. Thus, both, LanguageTool and LibreOffice seem to have bugs that cause the crashes.

Particularly the comments 5 and 6 of the bug report should contain valuable information to trace the bug as well as the attachment of comment 7.

System: Ubuntu 21.10 with LibreOffice (see details in the bug report mentioned above)

danielnaber commented 2 years ago

@FredKruse

FredKruse commented 2 years ago

@GerryT11 The bug occurs only, if writer is opened with an empty document, and after that a real document is loaded (This depends on the used machine. I count to four, open the document, and LO crashes. If you are opening very fast the document, no new XComponent is generated - LT and LO don't recognize the document as new - and LO doesn't crash). I could localize the problem at the class which installs a dynamic LT menu. If a document is loaded in the same window, LO crashes, when the dynamic menu is set (this is only the case if an unnamed empty document is overwritten by another document). Now (LT 5.7), the dynamic menu is only set, when the document is not empty. That is not the nice way, but it prevents LO from crashing. A better solution would be, if it will be solved at the side of LO.

FredKruse commented 2 years ago

Maybe there is also a relation to issue #6390. LO seems to have a serious problem with gtk3.

FredKruse commented 2 years ago

I could reproduce the bug described at #6390. I opened LibreOffice from the console. As fast as possible, I opened and close the same document. After five or six times, a second menubar appears and LO crashes. I got the following console output:

SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder". SLF4J: Defaulting to no-operation (NOP) logger implementation SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.

(soffice:195767): Gdk-WARNING **: 18:45:58.075: XSetErrorHandler() called with a GDK error trap pushed. Don't do that.

(soffice:195767): GLib-CRITICAL **: 18:46:31.638: g_hash_table_iter_next: assertion 'ri->version == ri->hash_table->version' failed

(soffice:195767): GLib-CRITICAL **: 18:46:31.639: g_hash_table_iter_next: assertion 'ri->version == ri->hash_table->version' failed

(soffice:195767): GLib-CRITICAL **: 18:46:31.692: g_hash_table_iter_next: assertion 'ri->version == ri->hash_table->version' failed

(soffice:195767): GLib-CRITICAL **: 18:46:31.693: g_hash_table_iter_next: assertion 'ri->version == ri->hash_table->version' failed

(soffice:195767): GLib-CRITICAL **: 18:46:31.693: g_hash_table_iter_next: assertion 'ri->version == ri->hash_table->version' failed

(soffice:195767): GLib-CRITICAL **: 18:46:31.693: g_hash_table_iter_next: assertion 'ri->version == ri->hash_table->version' failed

(soffice:195767): GLib-CRITICAL **: 18:46:31.695: g_hash_table_iter_next: assertion 'ri->version == ri->hash_table->version' failed

(soffice:195767): GLib-CRITICAL **: 18:46:31.696: g_hash_table_iter_next: assertion 'ri->version == ri->hash_table->version' failed

(soffice:195767): GLib-CRITICAL **: 18:46:31.697: g_hash_table_iter_next: assertion 'ri->version == ri->hash_table->version' failed

Fatal exception: Signal 11 Stack: /usr/lib/libreoffice/program/libuno_sal.so.3(+0x3ffc3)[0x7f6815886fc3] /usr/lib/libreoffice/program/libuno_sal.so.3(+0x4013a)[0x7f681588713a] /usr/lib/jvm/java-11-openjdk-amd64/lib/server/libjvm.so(+0xbe3bf9)[0x7f67edf48bf9] /usr/lib/jvm/java-11-openjdk-amd64/lib/server/libjvm.so(JVM_handle_linux_signal+0x201)[0x7f67edf4e8f1] /usr/lib/jvm/java-11-openjdk-amd64/lib/server/libjvm.so(+0xbdc93c)[0x7f67edf4193c] /lib/x86_64-linux-gnu/libc.so.6(+0x430c0)[0x7f68156720c0] /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0(g_hash_table_lookup+0x50)[0x7f6814d89760] /usr/lib/x86_64-linux-gnu/libgio-2.0.so.0(+0xe8aaa)[0x7f6814fbbaaa] /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0(g_closure_invoke+0x1b2)[0x7f6814e87802] /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0(+0x28814)[0x7f6814e9b814] /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0(g_signal_emit_valist+0x10ae)[0x7f6814ea6bbe] /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0(g_signal_emit+0x93)[0x7f6814ea70f3] /usr/lib/libreoffice/program/libvclplug_gtk3lo.so(+0x181096)[0x7f680e8d9096] /usr/lib/libreoffice/program/libvclplug_gtk3lo.so(+0x17b8e9)[0x7f680e8d38e9] /usr/lib/libreoffice/program/libmergedlo.so(_ZN4Menu7disposeEv+0x128)[0x7f6818704ef8] /usr/lib/libreoffice/program/libmergedlo.so(+0x2e65aae)[0x7f6818715aae] /usr/lib/libreoffice/program/libmergedlo.so(+0x2e65dce)[0x7f6818715dce] /usr/lib/libreoffice/program/libmergedlo.so(_ZN4Menu7disposeEv+0x134)[0x7f6818704f04] /usr/lib/libreoffice/program/libmergedlo.so(+0x2e65aae)[0x7f6818715aae] /usr/lib/libreoffice/program/libmergedlo.so(+0x2e65dce)[0x7f6818715dce] /usr/lib/libreoffice/program/libmergedlo.so(_ZN4Menu7disposeEv+0x134)[0x7f6818704f04] /usr/lib/libreoffice/program/libmergedlo.so(_ZN8VCLXMenuD1Ev+0xf7)[0x7f68182c6687] /usr/lib/libreoffice/program/libmergedlo.so(+0x2a18d37)[0x7f68182c8d37] /usr/lib/libreoffice/program/libgcc3_uno.so(+0xbf5e)[0x7f681583ef5e] /usr/lib/libreoffice/program/libuno_cppu.so.3(+0x25fc2)[0x7f68135f8fc2] /usr/lib/libreoffice/program/libuno_cppu.so.3(+0x24315)[0x7f68135f7315] /usr/lib/libreoffice/program/libuno_cppu.so.3(uno_Environment_invoke+0x98)[0x7f68135f7808] /usr/lib/libreoffice/program/libjava_uno.so(Java_com_sun_star_bridges_jni_1uno_JNI_1proxy_finalize__J+0x68)[0x7f67ec0d0738] [0x7f67d86846fb]

The bug happens also in the libjava_uno.so. So, there should be a relation, I think.

@GerryT11 Could you please add this to your conversation in LibreOffice Bugzilla? Thank you, Fred

KingJulianS commented 2 years ago

I also experienced, but only the first part of the error, posted by Fred Cruse above when I start libre via cli on debian bullseye. SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder". SLF4J: Defaulting to no-operation (NOP) logger implementation SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.

(soffice:195767): Gdk-WARNING **: 18:45:58.075: XSetErrorHandler() called with a GDK error trap pushed. Don't do that.

GerryT11 commented 2 years ago

Stephan Bergman from the LibreOffice team has started working on the bug at the side of LibreOffice. He committed a first patch, but another patch will be necessary to fix the issue.

See comments 14-17 in https://bugs.documentfoundation.org/show_bug.cgi?id=147668

GerryT11 commented 2 years ago

The LibreOffice bug is now fixed, too! https://bugs.documentfoundation.org/show_bug.cgi?id=147668

FredKruse commented 7 months ago

I'm closing the issue as resolved. If necessary, please open a new one with the current versions (LO and LT).