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

Fillet of Part workbench crash in debug mode (visual studio 2015) #26

Closed
print21 opened this issue Nov 29, 2019 · 1 comment
Closed

Comments

@print21
Copy link

print21 commented Nov 29, 2019

I build the latest freecad code of the LinkStage3 branch with VS2015 and libpack of FreeCADLibs_12.1.3_x64_VC15.

The crash happens when fillet operation in Part workbench and in debug mode.
微信截图_20191129112233

Same operation performed in release mode and report view shows error of "PyEval_EvalFrameEx returned a result with an error set".

I debug the code and found that: when set the value of fillet “Edges”, the crash happened.
In "PropertyFilletEdges::getPyValue()" function, the “PyObject *item” is a list not a tuple, so python exception throw. the "PropertyListsT::setPyObject()" function dose not handle the python exception.

So i did some tests.

First i changed the code in "PropertyFilletEdges::getPyValue()". i checked the type of “PyObject *item”, when it was not a tuple, a Base::ValueError exception trowed. Then the crash aforementioned did not happen.
微信截图_20191129105257

Second, i restored the code in "PropertyFilletEdges::getPyValue()". i modified the code of "PropertyListsT::setPyObject()" in catch scope. When “Py::Exception" caught, i cleared the python exception. Then the crash aforementioned did not happen too.
微信截图_20191129104940

So i guess that the assert was triggered caused by “Py::Exception" and crash happened.
and i suggest the first modification to fix this problem because the include file of “Py::Exception" will be included in “Property.h” with the second change.
微信截图_20191129105006

@realthunder
Copy link
Owner

PropertyListT::getPyValue() is not supposed to throw any Py::Exception. It is supposed to catch and translate the exception to various Base::Exception. I have fixed this now. Thanks for digging in!

print21 pushed a commit to print21/FreeCAD that referenced this issue Dec 5, 2019
Fixes realthunder#26

# Conflicts:
#	src/Mod/Part/App/PropertyTopoShape.cpp
@yahbluez yahbluez mentioned this issue Jan 18, 2024
2 tasks
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