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
Missing property Object1 or Object2 of fixed joint causing crash #13912
base: main
Are you sure you want to change the base?
Missing property Object1 or Object2 of fixed joint causing crash #13912
Conversation
FreeCAD is crashing if the 'Object' property of fixed joint (Assembly/Joints/Fixed/Joint Connector 1/Object1 or Assembly/Joints/Fixed/Joint Connector 2/Object2) is manually removed. Steps to reproduce: - make simple Assembly e.g. of two cubes with Fixed joint - Select Fixed joint in the tree and go-to property 'Data' tab - Select 'Object1' or 'Object2' of the 'Joint Connector 1' or 'Joint Connector 2' and remove this reference - click by your pointing device (mouse) to the arbitrary other property The FreeCAD will crash here because the call App::DocumentObject* obj = getObjFromNameProp(joint, propObjName, propPartName); will return NULL pointer. This problem is similar to the 4b5d079.
The warning message text is not describing two cases which can happen, but only one - property of specific joint.
There's no linked issue so I don't know on which OS the crash occurs but I can't reproduce it on Windows (with the AssemblyExample.FCStd file). Are you using Linux?
|
Yes please. My system is Gentoo Linux (with Sway tiling Wayland compositor) - almost HEAD. Based on your observation (inconsistency between platforms Windows/Linux) and the fact that the same In any case, this patch (pull request) is helping in my use case (Linux + Wayland compositor), is ensuring |
@PaddleStroke Can you have a look at this? |
I see no crash on my side either (windows) but the this PR can be merged as it just adds a protection it's totally acceptable. |
Similar problems: 07c6df6 and 4b5d079 were causing real crashes (Linux + Sway Wayland compositor) when Fixed joint type was used. This patch tries to avoid the same situation, but now for the rack pinion joint type. The returned pointer value (part1 and obj1) can get NULL pointer value and is used in the code: if (obj1->getNameInDocument() != part1->getNameInDocument()) { .... a few lines later.
I just pushed one more patch for the rack pinion joint where the crash could also occur. |
FreeCAD is crashing if the 'Object' property of fixed joint (Assembly/Joints/Fixed/Joint Connector 1/Object1 or Assembly/Joints/Fixed/Joint Connector 2/Object2) is manually removed.
Steps to reproduce:
and remove this reference
FreeCAD will crash here because the call App::DocumentObject* obj = getObjFromNameProp(joint, propObjName, propPartName); will return NULL pointer.
This problem is similar to the 4b5d079.