sharppy / SHARPpy

Sounding/Hodograph Analysis and Research Program in Python
https://sharppy.github.io/SHARPpy/index.html
Other
222 stars 110 forks source link

Inset swapping forces seg fault. - MAJOR BUG #22

Closed wblumberg closed 9 years ago

wblumberg commented 9 years ago

On my machine (Mac OS X Mavericks), the right click inset swapping procedure will force the program to seg fault:

/Users/blumberg/anaconda/bin/pythonw: line 3: 2121 Segmentation fault: 11 /Users/blumberg/anaconda/python.app/Contents/MacOS/python "$@"

Python seg faults, and I am unable to figure out why. All Python code runs and it seems like the swapInset() function exits. The seg faulting usually happens after swapping 1 or more insets. Commanding an inset to swap seems to force this, and it doesn't matter which inset.

This looks like a PySide issue.

wblumberg commented 9 years ago

I have an idea of how to test this. The Mac seg fault output says it has something to do with the popup menu, maybe. It seems the keyboard command for "S" works flawlessly, so maybe if I make the inset swapping through the right click menu act like the keyboard command, SHARPpy won't puke.

Right now SHARPpy recreates all insets each time a new inset is selected. I don't think I need to do this and this may be causing the problem. I don't know.

wblumberg commented 9 years ago

Post exam present...got to work on this and I fixed it! The inset swapping doesn't crap out anymore! No more seg faults! Inset objects now are now treated a little differently. They don't get deleted through deleteLater() anymore, they just get removed from the GridLayout and their visibility is set to False. This has induced a small lag when soundings are looped through though where insets with text in them seem to update at a different speed compared to the Thermo and Kinematic insets. Perhaps the whole setVisible() methodology for changing things is faster than the deleteLater() method?

keltonhalbert commented 9 years ago

I hate to report that inset swapping is completely broken. Any time I right click, it crashed before it will even display the inset. Full set fault, no error messages.

keltonhalbert commented 9 years ago

Because I do not have the time to hunt this bug myself, I am reverting back to a previous commit before this change. Random segfaults is better than constant segfaults.

keltonhalbert commented 9 years ago

This has been fixed.