novelWriter icon indicating copy to clipboard operation
novelWriter copied to clipboard

Application closes randomly

Open NishkaDG opened this issue 1 year ago • 6 comments

Twice in one hour after the latest update (on Linux Mint Cinnamon) the application has crashed suddenly and with no warning, while trying to select a block of text. There were no other noticeable signs of failure. Reopening the application gives a warning that there is an active version of the document open, but otherwise the document opens again, seemingly without loss of data. Is anyone else experiencing this? Work seems to have been saved, but it is irritating to have to reopen the application again and again.

NishkaDG avatar Jun 27 '24 17:06 NishkaDG

Is it coming just from selecting text, and nothing else? And it crashes completely with no box popping up with any information?

I assume you mean version 2.4.4. Is it installed from Launcpad or is it the AppImage? What Qt version does it say in Help > About Qt?

vkbo avatar Jun 27 '24 20:06 vkbo

Hello, Appreciate the quick response! Yes, as far as I can tell, it is from selecting text. I did a few other things like drag-and-drop rearranging of scenes, renaming scenes, find-and-replace, etc, and hours of typing, but both times it crashed immediately after I selected multiple paragraphs of text, and before I had done anything with my selection like cut,copy,paste. There were also no other applications running on my computer, except Firefox for some research (no video or audio or other heavy load from that end). No box with information pops up when it crashes. When I restart it, then I get a box saying something to the effect of, another instance of this project is open and it might get corrupted but if I am restarting after a crash it should be fine. Sorry for paraphrasing, I did not think to take a screenshot of this message. The file was not corrupted when I chose to proceed both times, it's still fine. (Though the second time I did lose about half a sentence because it hadn't autosaved that much before it crashed. No big loss.) Yes, version 2.4.4 with Qt 5.15.3. I installed it with Launchpad, if I remember correctly, although Linux Mint's update manager now manages the updates for me. Hope this helps. Thanks,

NishkaDG avatar Jun 28 '24 06:06 NishkaDG

By the sound of it, the crash is in Qt itself, not the novelWriter code. This makes it a little hard to debug, especially if I cannot reproduce it. If the crash is in novelWriter's Python code, the error handler will pop up a box with crash details which would allow me to debug it. However, when the crash is in the Qt library, it just exits as the underlying processes are just killed.

That also tracks, because the text selection feature is purely a Qt feature. I am travelling right now, but when I get home I can try to reproduce the crash on my Linux Mint test VM. I tested on Debian yesterday, with multiple rapid selections, drag and drop, and various things, but could not provoke any crash.

Also, just to check, does it crash from the act of selecting text itself, or are you right-clicking to open the menu? Just to make sure it's the selection itself that crashes and not the menu creation (which is done on the novelWriter side in the code).

You can also run novelWriter from the terminal and see if you get any error message there. You just have to type "novelwriter" (no capitalisation) and hit enter to run it. I suspect you'll see a "segmentation fault" message when it crashes.

vkbo avatar Jun 28 '24 11:06 vkbo

Just tested on Linux Mint 21.3 with Qt 5.15.3 and novelWriter 2.4.4. I cannot reproduce what you're reporting.

Could you see if you can provoke the crash by only selecting text? Just to rule out it isn't an accidental correlation? Also, please try to start novelWriter from the command line to see what error is reported there when it crashes. If you run it with --debug it should print a lot more info, and it may be useful to see the last few lines before a crash too.

vkbo avatar Jun 30 '24 14:06 vkbo

Hello, Thank you for checking. I just ran it in the terminal with the --debug flag, and tried selecting a variety of paragraphs, and right clicking, and copying/pasting with CTRL-C+CTRL-V, but no crash yet. Perhaps it interacted in a strange way with something else I was doing? I expect to use it normally (i.e. the way I was using it on Thursday just before the crash) tomorrow, and I can run it in the terminal with --debug tomorrow and see if it happens again. If I can't reproduce it tomorrow either, then maybe it was just a one-off glitch or something. I will let you know tomorrow if I can. Thanks,

NishkaDG avatar Jun 30 '24 16:06 NishkaDG

I have no idea what caused it. It could be random. I have been making some changes to help with memory cleanup, and some of those methods can cause such a crash in theory, but none of it has to do with selecting text or editing in general. It only applies to closing dialog boxes and generated context menus, like the ones seen when right-clicking in the editor or project tree. But none of these are new features either.

vkbo avatar Jun 30 '24 16:06 vkbo

Hello, I have been unable to reproduce the error. Perhaps it was random. Thanks for looking into it anyway!

NishkaDG avatar Jul 01 '24 16:07 NishkaDG