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
[Problem] EDIT => Preferences crashes at commit ac6f991ba
#12542
Comments
Can you please add steps how to reproduce this? Could you try this with a fresh install? |
Click edit in the menu bar, then click Preferences, crash This was built in a clean build environment and is run in place. |
I cannot reproduce. Can you try this with the lates weekly build? |
I was having an build issue and was discussing it in the forums. Somehow pyside was turned off in cmake(I didn't know it was now an option to not have it) and I got build failures over a missing shiboken module. I turned pyside on and it builds and the the preferences crash went away as the same time. So I guess this can be closed. |
Tested a patch for the shiboken module missing from wmayer and that fixes my other build problem with pyside turned off in cmake, but the preferences crash returned. So if pyside is not optional, this is a bug. Try building without pyside and see if you can reproduce it. |
I don't think that the crashes are related to the other issue. To me it rather looks like there is an issue that leads to random crashes |
In |
Please note there are dozens way to crash FreeCAD when Python interface is used instead PySide C++. It was probably always broken. |
AddonManagerOptions Is the only new info from that. Let me know if that helps. |
What happens if you enter this into the Python console of FreeCAD?
You may test with enabled and disabled PySide. |
This is one of hacks I'm using. It fixes that crash for me...
|
When built with or without pyside.
Returned the following to the shell FreeCAD was launched in, |
This is a Qt warning and can usually be ignored.
This means that it has just worked. The executed code is basically what happens when loading the preferences and I don't know why it doesn't crash with enabled PySide now. |
Being that using pyside fixes my issues I am happy to call this closed. If you want me to test more let me know what to do. |
Please do not add more confusion to the issue. Problem is still there and existed even before ac6f991 Only very few people are not using Shiboken/PySide, so it stays hidden. You may want to try hack I posted earlier. |
I'm not trying to add any confusion. I was just trying to be helpful offering to test. I did not know there was an issue with building without pyside, I didn't even know it was possible, not sure how I got into that state actually. The only thing I was referring to is opening preferences crashing FreeCAD which starts on my machine with ac6f991. If I can help fine, if I can't that's fine too. |
Mentioned commit is just moving ifdeffery into |
For testing purposes I have un-commented the line
Your hack doesn't work for me because the method fromQObject() is not even called when opening the preferences.
The problem is fairly new. Since the beginning of the year there were done quite some changes to PythonWrapper.cpp. So, for testing purposes I switched back to the state of November 2023 and there it worked correctly, i.e. in both cases where HAVE_PYSIDE2 is set or unset the preferences could be loaded without problems. |
After doing some manual bisecting I can confirm that the change to blame is: ac6f991 |
After looking at the code changes it was fairly easy to identify the culprit. It's this line: For Python objects that are not controlled by you |
Let me test it with both Qt5 and Qt6. I'll prepare a fix afterwards. |
This change will fix it:
|
Offending patch coalesced everything to |
Currently, |
Hmm, okay. Both |
Yes, and this was wrong. I have written some test code to confirm that it will crash. |
Okay. Unfortunately that ungly hack is still needed, otherwise just opening Draft WB ends with:
Hack updated:
I have no clue, what the culprit is. Anyway, fix at #12576 |
Ah, good to know that. I can confirm this crash, too. To fix it two things must be done:
|
Thank you! I will implement above (and then happily start using Qt6 builds). |
|
That's then the preferred way.
This behaviour (to return Py::Object with a null pointer) is defined by the PyCXX library and we have to deal with it |
To clarify, I meant passing null to |
I see. This part has to be kept because it's not error handling but a valid use case. There are cases where C++'s null pointer is equivalent to Python's None, e.g. the method setParent() accepts a null pointer in C++ or None in Python to clear the parenthood.
|
Thank you. However it does not explain
Shall I add more cleanup patches to #12577 or open another one once it gets merged? |
@clytle374, could you test #12576 without PySide again, so this issue can be closed? I propose to continue in #12577 with remaining issues. |
ac6f991ba
I will test it out in a couple days as I can't get to the computer |
@clytle374 ping |
@clytle374 |
My apologies, life got in the way. The current source works properly with Pyside turned off. |
Fixed. |
Is there an existing issue for this?
Problem description
When clicking on Preferences under edit Freecad crashes with the following. This issue is a little old as I figured someone else would catch it and it wasn't really effecting me. Decided to finally report it as I was already reporting a different issue and was already in the mood to run git bisect.
Please let me know if I can provide more information, or assistance. Thanks!
Full version info
Subproject(s) affected?
None
Anything else?
No response
Code of Conduct
The text was updated successfully, but these errors were encountered: