gerbilvis / gerbil

Gerbil Hyperspectral Visualization and Analysis Framework
http://gerbilvis.org
GNU General Public License v3.0
43 stars 15 forks source link

bus error: 10 #34

Closed renatosc closed 7 years ago

renatosc commented 7 years ago

I am using the OSX version.

When I first run qgerbil and opened a simple JPG file it worked fine. After I closed the problem and executed again with another image, the app closes and shows "Bus error: 10". Now all simple JPG/PNG images that I try to load I get that error, even the one that I opened first.

Any idea why is that?

abc$ ./gerbil/gerbil/bin/qgerbil ; exit;
Reading image: /Users/abc/Downloads/test.JPG
Reading band 0: 460 nm
Reading band 1: 540 nm
Reading band 2: 620 nm
ImageModel::respawn(): ignored, no payload available.
ImageModel::respawn(): ignored, no payload available.
ImageModel::respawn(): ignored, no payload available.
Bus error: 10
logout
Saving session...
...copying shared history...
...saving history...truncating history files...
...completed.

[Process completed]
renatosc commented 7 years ago

After some digging, I found that if I remove the org.gerbilvis.Gerbil.plist from my ~/Library/Preferences (which appears to be the file that saves session,...) I am able to run qgerbil and select a new image and it opens. But if I try to run it again later, I gets the Bus error: 10.

So, basically, I can run qgerbil only once. If I want to run it again, I need to remove that file.

ypnos commented 7 years ago

Did you compile from git or are you using the macports package?

We are aware of a problem with starting from some saved states, however this might be a bit different. Are you opening/closing any viewports while Gerbil is running? Does it also occur when you just open the image and immediately close the application window again?

renatosc commented 7 years ago

I compiled from the git and added all dependencies via homebrew.

I just open the image and then I immediately close the program. Next time that I try to open I get that error.

I tried here to instead of opening the same plain jpg image again, to open a txt file/image with 148 bands. The app also crashes but instead of the getting the bus error 10, I get segmentation fault 11.

abc $ /Users/abc/Downloads/gerbil/gerbil/bin/qgerbil ; exit;
Added /Users/abc/Downloads/gerbil/imagehs copy/memorialchurch//memorialchurch_01.png:   1 channel, 16 bits, 414.724 nm
Added /Users/abc/Downloads/gerbil/imagehs copy/memorialchurch//memorialchurch_02.png:   1 channel, 16 bits, 418.369 nm
...
...
...
Added /Users/abc/Downloads/gerbil/imagehs copy/memorialchurch//memorialchurch_148.png:  1 channel, 16 bits, 950.499 nm
Total of 148 bands. Spatial size: 1541x1088   (946.571 MB)
ImageModel::respawn(): ignored, no payload available.
ImageModel::respawn(): ignored, no payload available.
ImageModel::respawn(): ignored, no payload available.
Segmentation fault: 11
logout
Saving session...
...copying shared history...
...saving history...truncating history files...
...completed.

[Process completed]

Since the app crashes, the OS X asks me if I want to send the crash report to Apple. I copied both crash reports (bus error 10 & segmentation fault 11) and they are on the link below:

bus error 10: http://pastebin.com/06TyEy3B Exception Type: EXC_BAD_ACCESS (SIGBUS) Exception Codes: KERN_PROTECTION_FAILURE at 0x000000011d509000

segmentation fault 11: http://pastebin.com/TKZT4T0J Exception Type: EXC_BAD_ACCESS (SIGSEGV) Exception Codes: KERN_INVALID_ADDRESS at 0x000000015d828000

Funny though is that I just compiled here in another macbook (using the same process with same software/dependencies versions) that runs the same OS X version (10.11.6) and there is running fine without that bug.

So, it appears that the problem is related to something in my machine....

ypnos commented 7 years ago

Thank you for the very detailed report. It sheds some new light on the previously known issue.

I will prepare a patch later today that removes the state saving functionality while we can further investigate this or put it on hold while we incorporate the new data handling.

It seems to me the bus error 10 is just a segmentation fault in disguise. Segmentation faults are tricky beasts, they only occur under specific circumstances, so it is a typical phenomenom that you get them on one machine but not another.

renatosc commented 7 years ago

Thanks.

I don't know if the state data stores more than the last image files used. If does, and the bug not always happen, maybe you could just leave the state saving (so people without the bug can continue taking advantage of it) and just add a new argument to open the file ignoring the state data (something like qgerbil -ignore). Just an idea.

Best,

ypnos commented 7 years ago

You can already open a file directly with /Users/abc/Downloads/gerbil/gerbil/bin/qgerbil <filename>, and if you have a labeling for it, /Users/abc/Downloads/gerbil/gerbil/bin/qgerbil <imagefile> <labelfile>. Does that change anything?

renatosc commented 7 years ago

No.. same issue...

Here is a screen record: https://www.dropbox.com/s/28uf0anxug9cak6/gerbil_bug.mov?dl=0

ypnos commented 7 years ago

Thank you! This is what I expected. I'm working on it.

ypnos commented 7 years ago

Could you please try current master?

renatosc commented 7 years ago

Yes, it is working now. Thanks!