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

[Bug] Crash after creating Sketch for Body #7628

Closed
2 tasks done
wwmayer opened this issue Oct 22, 2022 · 0 comments
Closed
2 tasks done

[Bug] Crash after creating Sketch for Body #7628

wwmayer opened this issue Oct 22, 2022 · 0 comments

Comments

@wwmayer
Copy link
Contributor

wwmayer commented Oct 22, 2022

Is there an existing issue for this?

  • I have searched the existing issues

Forums discussion

https://forum.freecadweb.org/viewtopic.php?f=3&t=72811

Version

0.20 (Release)

Full version info

OS: KDE Flatpak runtime (X-Cinnamon/cinnamon)
Word size of FreeCAD: 64-bit
Version: 0.20.1.29410 (Git)
Build type: Release
Branch: (HEAD detached at 0.20.1)
Hash: f5d13554ecc7a456fb6e970568ae5c74ba727563
Python 3.9.9, Qt 5.15.5, Coin 4.0.0, Vtk 8.2.0, OCC 7.6.2
Locale: English/United Kingdom (en_GB)

Subproject(s) affected?

Core

Issue description

This just came up and it's pretty frustrating. Creating sketches can make FreeCAD crash.

  • Steps to reproduce (100% reproducibility on my PC):
  • Download and open the attached project
  • In the Combo View, switch to the Model-tab
  • Create a Std_Part by clicking on the yellow stairs in one of your toolbars
  • In the Combo/Model view, move that new part into the active "KeyNrDependentObjects"-part by dragging it there
  • Switch to Part Design workbench
  • Click on the Create Body icon (the blue stairs) in your "Part Design Helper"-toolbar
  • In Model View -> Tasks click on "Create Sketch"
  • Click on any of the blue plains in your regular view
  • Crash

Anything else?

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
wwmayer added a commit that referenced this issue Oct 24, 2022
The problem is that inside Transaction::addObjectNew() a transaction object is deleted before removing it from the container. When deleting the corresponding transactional object (i.e. a DocumentObject or ViewProvider)
it can happen that it e.g. calls Transaction::addOrRemoveProperty() that now finds the dangling pointer in the container.

The safe way is to first remove the object from the container before deleting it.
@wwmayer wwmayer closed this as completed Oct 24, 2022
donovaly pushed a commit that referenced this issue Oct 25, 2022
The problem is that inside Transaction::addObjectNew() a transaction object is deleted before removing it from the container. When deleting the corresponding transactional object (i.e. a DocumentObject or ViewProvider)
it can happen that it e.g. calls Transaction::addOrRemoveProperty() that now finds the dangling pointer in the container.

The safe way is to first remove the object from the container before deleting it.
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

1 participant