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

Changing a named reference constraint crashes FreeCAD #387

Closed
papamat opened this issue Dec 21, 2020 · 4 comments
Closed

Changing a named reference constraint crashes FreeCAD #387

papamat opened this issue Dec 21, 2020 · 4 comments
Labels

Comments

@papamat
Copy link

papamat commented Dec 21, 2020

I can constantly recreate this issue following this procedure.

  • New File
  • New Body
  • New Sketch
  • Add an arbitrary line
  • Add a constraint in (length) and make it reference
  • Name the constraint
  • Try to change the length of the line using the mouse freezes FreeCAD

If the constraint is unnamed there is no problem
Tried to recreate this in the "official" 0.19 AppImage and doesn't crashes
I run the following version:

OS: Fedora 32 (Workstation Edition) (GNOME/gnome)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 2020.12.17.23076 +3024 (Git) AppImage
Build type: Release
Branch: LinkStage3
Hash: 560eb2c4645cd548b6f718c645c7af70384ff54c
Python version: 3.8.6
Qt version: 5.12.9
Coin version: 4.0.0
OCC version: 7.4.0
Locale: English/United States (en_US)

@realthunder
Copy link
Owner

I can't reproduce it. How do you change the length using mouse? By dragging the line?

Also, did it freeze or crash? If it crashes, please start the AppImage using command line in a terminal, and post the call stack dump when it crashes? If it freezes, please find out the running FreeCADLink process ID. You can use the task manager on your system. And then kill the process by typing the following command in a terminal, and post the dump here.

kill -SIGSEGV <ProcessID>

@papamat
Copy link
Author

papamat commented Dec 22, 2020

Sorry for the wrong term, it freezes FreeCAD it doesn't crashing it.
Trying to recreate today spotted a very weird behavior, so first is the gif that shows how is happening,
Peek 2020-12-22 09-31

And next is the same procedure with the only difference being that I press OK button without marking the constraint as reference and then reopen it again and making it reference. This doesn't freezes the app.
Peek 2020-12-22 09-35

I killed FreeCAD with -SIGSEGV but I have no idea where core is dumped (is not on the working directory), I can imagine that AppImages are dropping dumps in their "virtual space" or something? This is the console output
/tmp/.mount_FreeCAUsUmMq/AppRun: line 32: 360732 Bus error (core dumped) "$PREFIX/bin/$name"Link "$@"

realthunder added a commit to realthunder/FreeCAD that referenced this issue Dec 23, 2020
realthunder added a commit to realthunder/FreeCAD that referenced this issue Dec 23, 2020
realthunder added a commit to realthunder/FreeCAD that referenced this issue Dec 23, 2020
abdullahtahiriyo added a commit to abdullahtahiriyo/FreeCAD_sf_master that referenced this issue Dec 24, 2020
========================================

Report:
FreeCAD#4183
realthunder/FreeCAD_assembly3#387

Problem:
renameConstraint() previously implemented exclusively in SketchObjectPyImp.cpp,
will change the Constraints property without updating the solver. A prospective
drag operation would rely on a deleted pointer constraint which leads to the
crash.

Solution:
make renameConstraint function update the solver so that

Bonus:
move the core of the function to SketchObject.cpp so that input data validity
check on constraint change is inhibited.
abdullahtahiriyo added a commit to abdullahtahiriyo/FreeCAD_sf_master that referenced this issue Dec 27, 2020
========================================

Report:
FreeCAD#4183
realthunder/FreeCAD_assembly3#387

Problem:
renameConstraint() previously implemented exclusively in SketchObjectPyImp.cpp,
will change the Constraints property without updating the solver. A prospective
drag operation would rely on a deleted pointer constraint which leads to the
crash.

Solution:
make renameConstraint function update the solver so that

Bonus:
move the core of the function to SketchObject.cpp so that input data validity
check on constraint change is inhibited.
abdullahtahiriyo added a commit to abdullahtahiriyo/FreeCAD_sf_master that referenced this issue Dec 27, 2020
========================================

Report:
FreeCAD#4183
realthunder/FreeCAD_assembly3#387

Problem:
renameConstraint() previously implemented exclusively in SketchObjectPyImp.cpp,
will change the Constraints property without updating the solver. A prospective
drag operation would rely on a deleted pointer constraint which leads to the
crash.

Solution:
make renameConstraint function update the solver so that

Bonus:
move the core of the function to SketchObject.cpp so that input data validity
check on constraint change is inhibited.
abdullahtahiriyo added a commit to abdullahtahiriyo/FreeCAD_sf_master that referenced this issue Dec 27, 2020
========================================

Report:
FreeCAD#4183
realthunder/FreeCAD_assembly3#387

Problem:
renameConstraint() previously implemented exclusively in SketchObjectPyImp.cpp,
will change the Constraints property without updating the solver. A prospective
drag operation would rely on a deleted pointer constraint which leads to the
crash.

Solution:
- mark the solver status as needing an update
- leverage new through sketchobject r/w interface to ensure solver is synchronised
before the temporary move operation starts

Bonus:
move the core of the function to SketchObject.cpp so that input data validity
check on constraint change is inhibited.
abdullahtahiriyo added a commit to abdullahtahiriyo/FreeCAD_sf_master that referenced this issue Dec 27, 2020
========================================

Report:
FreeCAD#4183
realthunder/FreeCAD_assembly3#387

Problem:
renameConstraint() previously implemented exclusively in SketchObjectPyImp.cpp,
will change the Constraints property without updating the solver. A prospective
drag operation would rely on a deleted pointer constraint which leads to the
crash.

Solution:
- mark the solver status as needing an update
- leverage new through sketchobject r/w interface to ensure solver is synchronised
before the temporary move operation starts

Bonus:
move the core of the function to SketchObject.cpp so that input data validity
check on constraint change is inhibited.
abdullahtahiriyo added a commit to abdullahtahiriyo/FreeCAD_sf_master that referenced this issue Dec 27, 2020
========================================

Report:
FreeCAD#4183
realthunder/FreeCAD_assembly3#387

Problem:
renameConstraint() previously implemented exclusively in SketchObjectPyImp.cpp,
will change the Constraints property without updating the solver. A prospective
drag operation would rely on a deleted pointer constraint which leads to the
crash.

Solution:
- mark the solver status as needing an update
- leverage new through sketchobject r/w interface to ensure solver is synchronised
before the temporary move operation starts

Bonus:
move the core of the function to SketchObject.cpp so that input data validity
check on constraint change is inhibited.
abdullahtahiriyo added a commit to abdullahtahiriyo/FreeCAD_sf_master that referenced this issue Dec 27, 2020
========================================

Report:
FreeCAD#4183
realthunder/FreeCAD_assembly3#387

Problem:
renameConstraint() previously implemented exclusively in SketchObjectPyImp.cpp,
will change the Constraints property without updating the solver. A prospective
drag operation would rely on a deleted pointer constraint which leads to the
crash.

Solution:
- mark the solver status as needing an update
- leverage new through sketchobject r/w interface to ensure solver is synchronised
before the temporary move operation starts

Bonus:
move the core of the function to SketchObject.cpp so that input data validity
check on constraint change is inhibited.
abdullahtahiriyo added a commit to abdullahtahiriyo/FreeCAD_sf_master that referenced this issue Dec 27, 2020
========================================

Report:
FreeCAD#4183
realthunder/FreeCAD_assembly3#387

Problem:
renameConstraint() previously implemented exclusively in SketchObjectPyImp.cpp,
will change the Constraints property without updating the solver. A prospective
drag operation would rely on a deleted pointer constraint which leads to the
crash.

Solution:
- mark the solver status as needing an update
- leverage new through sketchobject r/w interface to ensure solver is synchronised
before the temporary move operation starts

Bonus:
move the core of the function to SketchObject.cpp so that input data validity
check on constraint change is inhibited.
abdullahtahiriyo added a commit to FreeCAD/FreeCAD that referenced this issue Dec 27, 2020
========================================

Report:
#4183
realthunder/FreeCAD_assembly3#387

Problem:
renameConstraint() previously implemented exclusively in SketchObjectPyImp.cpp,
will change the Constraints property without updating the solver. A prospective
drag operation would rely on a deleted pointer constraint which leads to the
crash.

Solution:
- mark the solver status as needing an update
- leverage new through sketchobject r/w interface to ensure solver is synchronised
before the temporary move operation starts

Bonus:
move the core of the function to SketchObject.cpp so that input data validity
check on constraint change is inhibited.
@Shkolik
Copy link

Shkolik commented Jul 13, 2021

Tested on:

OS: Windows 10 Version 2009
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 2021.614.24301 +3747 (Git)
Build type: Release
Branch: LinkDaily
Hash: ecbfba008c481db4cb17bf8bd514b2d12690a8e5
Python version: 3.8.6+
Qt version: 5.15.2
Coin version: 4.0.1
OCC version: 7.5.0
Locale: English/United States (en_US)

No issue found.

@luzpaz
Copy link
Collaborator

luzpaz commented Jul 13, 2021

Closing ticket

@luzpaz luzpaz closed this as completed Jul 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants