Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SnappySonic segfaults on Linux #25

Open
henrykrumb opened this issue May 3, 2023 · 5 comments
Open

SnappySonic segfaults on Linux #25

henrykrumb opened this issue May 3, 2023 · 5 comments

Comments

@henrykrumb
Copy link

Bug report:
Running SnappySonic from the most recent master commit (e2e2e45) on Linux Mint segfaults almost directly after the application starts.
Command line output:

QWidget: Must construct a QApplication before a QWidget
Abgebrochen (Speicherabzug geschrieben)

How to reproduce:

  1. Clone snappysonic repo
  2. Install all dependencies. sksurgery-utils needs to be installed from the git repo: pip install git+https://github.com/SciKit-Surgery/scikit-surgeryutils.git
  3. Download example config from https://github.com/SciKit-Surgery/snappysonic/blob/master/config.json
  4. Run python3 snappysonic.py -c config.json

My uname -a:

Linux henry-ThinkPad-P51-W10DG 5.19.0-38-generic #39~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Fri Mar 17 21:16:15 UTC 2 x86_64 x86_64 x86_64 GNU/Linux
@thompson318
Copy link
Collaborator

Thanks for raising. 2 ideas:

Could you please try turning of the debug option (line 59 of config.json, change to "debug": false,

Also could you try running 'pip freeze' in your running environment and post the output here?

@henrykrumb
Copy link
Author

Thank you so much for your quick answer!

Setting debug=false in config.json did not have an effect on the output.

Please find attached my pip freeze.

freeze.txt

@thompson318
Copy link
Collaborator

OK, I think this may be to do with Qt (Pyside) versions. SnappySonic depends on scikit-surgeryutils and scikit-surgeryvtk. We are in the process of updating those libraries to use PySide6 instead of PySide2. SnappySonic still uses PySide2. According to your 'pip freeze' you have the very latest (pre-release) versions of scikit-surgeryutils and scikit-surgeryvtk installed so there will be a conflict on PySide versions.

Possible ways to fix:

  1. Roll back your versions of scikit-surgeryutils and scikit-surgeryvtk to the most recent stable versions (scikit-surgeryutils==1.2.1, scikit-surgeryvtk==1.1.1)
  2. Or try editing snappysonic to use PySide6. Change line 6 of snappysonic/ui/snappysonic_demo.py to "from PySide6.QtWidgets import QApplication". I don't know if that will work but I'd be interested to know what happens.

Please try either of those and let me know what happens. We're hoping to finish updating to PySide6 in the next week or so, at which point we'll also update snappysonic to use PySide6.

@henrykrumb
Copy link
Author

Wonderful, thank you so much for your suggestions! I just saw the dedicated pyside6 branch you created, and it now runs through until the video device (webcam) is being opened through v4l, which fails. However, I assume that this is an issue from my side (my webcam setup is slightly messed up atm), so I cannot test it further.

I will keep you posted when I manage to fix things on my end, but for now, this resolves the segfault ;)

@thompson318
Copy link
Collaborator

The branch 26-pyside6 seems to work for me now. Let me know if/when you get it running. You can change the webcam setup at line 58 of config.json.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants