Hard crash while saving a TIFF file

jhayes_tucson

Member
Feb 25, 2014
24
0
PC: Brand New MacBook Pro w/I9 processor, 64k RAM, OSX Catalina V10.15.5
PI: Ver 1.8.8-5
Action: "Save As"

This crash locked PI and I lost everything I hadn't saved up to that point (ouch!). It actually happened while I was in the process of saving things. I don't normally report small "garden variety" glitches here, but this one is so bad that you guys should know about it. I merely tried to save an image to a TIFF file. The image had 3 previews open. I had accidentally saved it as a 32 bit file and when it finished, it reported that TIFF was insufficient to save the file (or something along those lines). That warning was expected. I then tried to save it again (with the intention of saving it to a 16 bit file, but it immediately crashed as soon as I pressed "Save As". After the crash, I checked and PI did successfully save the TIFF file before crashing. I've attached a screen shot of the crash.

Although I had a lot of stuff saved. This crash will send me back to square one since I was on an intermediate branch of my processing flow. So, I lost essentially a day of work. It is very bad to run into hard crashes like this one in an app like PI so I hope that you guys can fix it. PI is an awesome application and I don't want to have to fear a crash every time I do something! Let me know if you need more information and I'll do my best to help you out.

John
 

Attachments

pfile

PTeam Member
Nov 23, 2009
5,606
103
john - can you find the full crash dump and post it? it should appear in the Console application.

rob
 

Juan Conejero

PTeam Member
Sep 2, 2004
7,548
94
56
Valencia, Spain
pixinsight.com
Hi John,

I am very sorry for this. I cannot reproduce this problem on any platform. I can save TIFF files without problems on Linux, macOS and Windows (as well as files in any supported format), using all data types from 8-bit integers to 64-bit floating point (when applicable). Can you reproduce this crash, or has it been a sporadic error? Can you upload the image that caused the problem?

The backtrace you've included in your screenshot is partial, but it looks like a segmentation fault caused by a third-party component; maybe Qt or a system library. Definitely, it does not look like a segfault in our code. As Rob says, a complete backtrace would be helpful.
 

jhayes_tucson

Member
Feb 25, 2014
24
0
Thanks for the quick response...and sorry, I should have included a crash dump in the first place. Since I couldn't attach a .docx file, I've attached a PDF file. This is the first time that I've ever seen a problem like this Juan so I'll be interested to know what you find. Maybe it's related to the new Mac?

John
 

Attachments

Juan Conejero

PTeam Member
Sep 2, 2004
7,548
94
56
Valencia, Spain
pixinsight.com
Thank you for uploading the crash report. The backtrace clearly shows that the segmentation violation has originated in Qt code, namely from the QApplicationPrivate::isWindowBlocked() routine, being called from QGuiApplicationPrivate::showModalWindow(). The problem has happened when PixInsight was trying to show a dialog window (probably the TIFF Format Options dialog), which can be traced up to the QDialog::setVisible() and QDialog::exec() routines.

So the problem has not been caused by PixInsight code. Qt is a highly stable and proven software library. The probability that such a rough bug exists in the routines mentioned above is extremely low. This problem has probably been caused by unexpected behavior of macOS, and is related to the graphical user interface. In simpler words: something that was expected to happen didn't happen, or a precondition guaranteed by the underlying desktop manager was not fulfilled. These errors happen from time to time on all operating systems. From my experience, they are relatively usual on Windows, relatively infrequent on macOS, and virtually nonexistent on Linux with the KDE desktop manager.
 

jhayes_tucson

Member
Feb 25, 2014
24
0
Juan,
Thank you for taking the time to look at this and to get back to me. Since the Mac is new, I was a little concerned that there might be a bad ram location or some other hardware issue (and yes, I recognize that those issues are also extremely rare.). My son who is studying CS at the Colorado School of Mine has almost convinced me to switch to Linix, but I'm not quite there yet. I'm glad to know that the problem wasn't in PI. BTW, PhotoShop has now crashed twice in one day on the same machine. Not good...

John
 

pfile

PTeam Member
Nov 23, 2009
5,606
103
i think you can make a USB drive with memtest86+ that will boot a mac. then you can run memtest without the OS taking up any memory (and thus test more memory.) also there is a program called Prime95 that really stresses a CPU - download that and select "torture test". it can then check its own work and tell you if there has been a computation error.
 

thutchison

Active member
Jan 5, 2019
29
0
I have had this happening FREQUENTLY on my Mac Pro (brand new) as well. Additionally, I have been having many "Segmentation Violations" happening within PI. Is there anything that we can do about this? I am frequently losing work and it is getting to be frustrating. I know you've said above that the issue is likely with the Qt code, but again, is there anything that we can do? I am happy to provide additional information or whatever is necessary to help to diagnose the problem.

Thank you in advance for your help!
Tim.
 

Juan Conejero

PTeam Member
Sep 2, 2004
7,548
94
56
Valencia, Spain
pixinsight.com
This problem cannot be reproduced under normal working conditions. It is probably being caused by wrong video drivers and/or system updates, or by conflicts with third-party applications.

Try running the application from a terminal with OpenGL hardware acceleration disabled:

/Applications/PixInsight/PixInsight.app/Contents/MacOS/PixInsight --opengl=software

This has worked in a few other cases where similar problems have been reported.
 

thutchison

Active member
Jan 5, 2019
29
0
Juan:

I was running PI as you suggested in the previous post and it just crashed again. This time I was saving an image as a TIFF file. A message box saying "unknown exception" with an OK button came up on the screen and there was a dump in the console window. I had to press the ok button on the message box many many times to try to get it to close. When it finally closed the entire application crashed. I was unable (because of the crash) to save the contents of the console.

I really need and GREATLY appreciate your help.
Tim.
 

thutchison

Active member
Jan 5, 2019
29
0
Sure. Also, I just realized that because I was running it from the terminal the dump was copied to stderr, so I saved it to a text file. Here is the text of the dump. The image (even compressed) is too large to upload. Here is a link to it on my google drive: M27

After the crash, I restarted PI and opened ONLY the file and immediately saved it as a TIFF and it worked...

I know these seemingly random crashes are frustrating for developers. I am willing to do whatever I can to help! Anything you need, just ask.

Tim.
 

Attachments

Juan Conejero

PTeam Member
Sep 2, 2004
7,548
94
56
Valencia, Spain
pixinsight.com
Hi Tim,

The crash.txt file is very informative; thank you for providing it. Clearly, this is a Qt issue. The problem is that Apple changed the way native file open/save dialogs work in macOS Catalina, without notice, for 'security reasons' (how many times are we repeating these two words recently, and always to talk about absurd problems that should not exist on a sound operating system?). This is the 'NSSavePanel' thing that you can see in your crash report. The other messages related to 'clearFocus()' are being caused by a small bug which is completely innocuous (it is already fixed in version 1.8.8-6).

I also get the same warning and error messages on stderr, but nothing bad happens on any of our Macintosh machines, all of them running up-to-date macOS 10.15.5. I have made several intensive tests with very big projects loading your XISF file, and I can save it in TIFF format without any problems (I have tested this at least 50 times on different MacBook Pro and iMac machines). So this is a combination of Apple changes, Qt being unaware of them, and machine-specific issues.

I have two good news. One of them is that there is a workaround: use multiplatform file dialogs instead of native dialogs on macOS:

- Select Edit > Global Preferences from the main menu.

- On the Preferences tool window, select the File I/O Settings section.

- On the right panel, uncheck the Use native file dialogs option.

- Click Apply Global, or press F6, to apply the changes.

Multiplatform file dialogs do not use any resource provided by the underlying desktop manager, so they are completely stable on all supported platforms. They are the default option on Linux and FreeBSD, which are the reference implementations of PixInsight.

The other good news is that the incoming version 1.8.8-6 of PixInsight uses the latest Qt 5.15 LTS version, where these problems will hopefully be solved.

Let me know if this helps.
 

thutchison

Active member
Jan 5, 2019
29
0
Juan:

I have been using PI as you suggest above. When using the Multiplatform file dialogs I keep getting a message box in PI that says "Unknown exception" and the following is written to stderr:

QMetaObject::invokeMethod: No such method pi::pixInsightCommandLineWindow::clearFocus()
QMetaObject::invokeMethod: No such method pi::pixInsightCommandLineWindow::clearFocus()
qt.qpa.window: Window position QRect(-12,-47 110x400) outside any known screen, using primary screen
QMetaObject::invokeMethod: No such method pi::pixInsightCommandLineWindow::clearFocus()
QMetaObject::invokeMethod: No such method pi::pixInsightCommandLineWindow::clearFocus()
qt.qpa.window: Window position QRect(14,-12 110x400) outside any known screen, using primary screen
QMetaObject::invokeMethod: No such method pi::pixInsightCommandLineWindow::clearFocus()
QMetaObject::invokeMethod: No such method pi::pixInsightCommandLineWindow::clearFocus()
QMetaObject::invokeMethod: No such method pi::pixInsightCommandLineWindow::clearFocus()
QMetaObject::invokeMethod: No such method pi::pixInsightCommandLineWindow::clearFocus()
QMetaObject::invokeMethod: No such method pi::pixInsightCommandLineWindow::clearFocus()
QMetaObject::invokeMethod: No such method pi::pixInsightCommandLineWindow::clearFocus()
QMetaObject::invokeMethod: No such method pi::pixInsightCommandLineWindow::clearFocus()

Any help you can provide is greatly appreciated, as always.
Tim
 

Juan Conejero

PTeam Member
Sep 2, 2004
7,548
94
56
Valencia, Spain
pixinsight.com
Hi Tim,

We cannot reproduce these 'unknown exception' problems on macOS 10.15.5. Multiplatform file dialogs work without any issues on all of our Macintosh machines. The clearFocus() and window position error messages are innocuous and we are aware of them, as I noted above; they are already fixed in version 1.8.8-6.
 

thutchison

Active member
Jan 5, 2019
29
0
I can reproduce this exception by doing something silly. Perhaps it will help you to see what is going on. I typically run Local Normalization and store the files in the same folder as the image files. When using the Apple dialogs and adding the image files to the ImageStacking dialog, I can hit select all and it will ignore the XNML files and select only the XISF files. Then I add the Local Normalization files, select all and it will select only the XNML files and ignore the XISF. I have been doing it this way for so long that I do it out of habit. This should reproduce the error on your side.

BTW: This is certainly something that I can work around when it happens in this way. I am not suggesting that this is my main issue. Just when this error comes up at other times and causes bigger problems.

Thank you as always for continuing to work through these crashes on Mac OS. I really appreciate your help!
Tim.
 

Juan Conejero

PTeam Member
Sep 2, 2004
7,548
94
56
Valencia, Spain
pixinsight.com
Tim,

I cannot reproduce this problem as you have described. I can add image files and later local normalization or drizzle files using system file dialogs (also multiplatform file dialogs) without problems. I don't know what happens here but is looks like a peculiar machine-specific issue. I would appreciate knowing if other users can reproduce this problem.