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

[Problem] Crash on Object Adjustment in Techdraw #12524

Closed
2 tasks done
frank-trampe opened this issue Feb 20, 2024 · 8 comments
Closed
2 tasks done

[Problem] Crash on Object Adjustment in Techdraw #12524

frank-trampe opened this issue Feb 20, 2024 · 8 comments
Labels
Missing: confirmation Missing confirmation from other testers WB TechDraw Related to the TechDraw Workbench

Comments

@frank-trampe
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Problem description

Changing the position of a view in Techdraw when the object has many dimensions and several section views attached causes a crash even if it is the first action after opening the file. Possibly related to #10919. The installation is from snap.

#0  0x00007efbd071e609 in Standard_Transient::DecrementRefCounter() const ()
   from target:/snap/freecad/908/usr/lib/libTKernel.so.7
#1  0x00007efb5c472406 in TopoDS_Shape::~TopoDS_Shape() ()
   from target:/snap/freecad/908/usr/lib/TechDraw.so
#2  0x00007efb5c58c2cb in TechDraw::GeometryObject::projectShape(TopoDS_Shape const&, gp_Ax2 const&) () from target:/snap/freecad/908/usr/lib/TechDraw.so
#3  0x00007efb5c4eb635 in non-virtual thunk to QtConcurrent::RunFunctionTask<void>::run() () from target:/snap/freecad/908/usr/lib/TechDraw.so
#4  0x00007efc1c1f18f2 in ?? ()
   from target:/snap/freecad/908/kf5/usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#5  0x00007efc1c1ee5a3 in ?? ()
   from target:/snap/freecad/908/kf5/usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#6  0x00007efc1b361609 in start_thread ()
   from target:/snap/freecad/908/lib/x86_64-linux-gnu/libpthread.so.0
#7  0x00007efc1be01353 in clone () from target:/lib/x86_64-linux-gnu/libc.so.6

Full version info

[code]
OS: Ubuntu Core 20 (ubuntu:GNOME/ubuntu)
Word size of FreeCAD: 64-bit
Version: 0.21.2.33771 (Git) Snap 908
Build type: Release
Branch: tag: 0.21.2
Hash: b9bfa5c5507506e4515816414cd27f4851d00489
Python 3.8.10, Qt 5.15.7, Coin 4.0.0, Vtk 7.1.1, OCC 7.6.3
Locale: English/United States (en_US)
Installed mods: 
  * fasteners 0.4.15
  * dodo 1.0.0
  * BIM 2021.12.0
  * sheetmetal 0.4.0
[/code]

Subproject(s) affected?

Techdraw

Anything else?

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
@maxwxyz maxwxyz added WB TechDraw Related to the TechDraw Workbench Missing: confirmation Missing confirmation from other testers labels Feb 20, 2024
@maxwxyz
Copy link
Collaborator

maxwxyz commented Feb 20, 2024

I cannot reproduce, do you have a demo file? Could you try this with the current weekly builds https://github.com/FreeCAD/FreeCAD-Bundle/releases/tag/weekly-builds

@frank-trampe
Copy link
Author

I have attached a copy of the project files. The machine on which I am making these drawings does not have enough free storage for me to build from source. I will do so on another computer if you cannot reproduce. Select View025 on Page007. Change Y from 8.25 to 8.125, and wait for the change to propagate. I have tried this many times many ways (right after saving, right after recomputing, et cetera), and it always causes a crash for me.

Base_Framing_2_29_Package_1.zip

@frank-trampe
Copy link
Author

The crash does not happen with version information as follows, but there are also a lot of objects that may not have loaded correctly, judging from the report view view contents pasted below, so it is possible that the geometry causing the crash is not loading properly. There are preceding errors about missing the fastener workbench, but the broken sketches do not reference fasteners. The error messages reference only one side of the reference, so I am unable to explore them in depth.

OS: Ubuntu 20.04.6 LTS (ubuntu:GNOME/ubuntu)
Word size of FreeCAD: 64-bit
Version: 0.22.0dev.36082 (Git) AppImage
Build type: Release
Branch: main
Hash: 7a025e4e60a607bdbdd1599627ce13bb8eeda071
Python 3.10.13, Qt 5.15.8, Coin 4.0.2, Vtk 9.2.6, OCC 7.6.3
Locale: English/United States (en_US)
20:56:39  3.8e-08 <App> Document.cpp(2146): Failed to restore Base_Framing_2_29#Sketch188.ExpressionEngine: Reference constraint from this sketch cannot be used in this expression.
20:56:39  0.0148102 <App> Document.cpp(2146): Failed to restore Base_Framing_2_29#Sketch249.ExpressionEngine: Reference constraint from this sketch cannot be used in this expression.
20:56:39  0.0615039 <App> Document.cpp(2146): Failed to restore Base_Framing_2_29#Sketch294.ExpressionEngine: Reference constraint from this sketch cannot be used in this expression.
20:56:39  0.200217 <App> Document.cpp(2146): Failed to restore Base_Framing_2_29#Sketch475.ExpressionEngine: Reference constraint from this sketch cannot be used in this expression.
20:56:39  0.201672 <App> Document.cpp(2146): Failed to restore Base_Framing_2_29#Sketch480.ExpressionEngine: Reference constraint from this sketch cannot be used in this expression.
20:56:39  0.243651 <App> Document.cpp(2146): Failed to restore Base_Framing_2_29#Sketch556.ExpressionEngine: Reference constraint from this sketch cannot be used in this expression.
20:56:39  DVS: SectionOrigin doesn't intersect part in SectionView021
20:56:39  DVS: SectionOrigin doesn't intersect part in SectionView023
20:56:39  DVS: SectionOrigin doesn't intersect part in SectionView025
20:56:39  DVS: SectionOrigin doesn't intersect part in SectionView027
20:56:39  DVS: SectionOrigin doesn't intersect part in SectionView028
20:56:39  DVS: SectionOrigin doesn't intersect part in SectionView029
20:56:39  DVS: SectionOrigin doesn't intersect part in SectionView031
20:56:39  DVS: SectionOrigin doesn't intersect part in SectionView032
20:56:39  DVS: SectionOrigin doesn't intersect part in SectionView033
20:56:39  DVS: SectionOrigin doesn't intersect part in SectionView034
20:56:39  DVS: SectionOrigin doesn't intersect part in SectionView035
20:56:39  DVS: SectionOrigin doesn't intersect part in SectionView036
20:56:39  DVS: SectionOrigin doesn't intersect part in SectionView037
20:56:39  DVS: SectionOrigin doesn't intersect part in SectionView038
20:56:39  DVS: SectionOrigin doesn't intersect part in SectionView041
20:56:39  DVS: SectionOrigin doesn't intersect part in SectionView042
20:56:39  DVS: SectionOrigin doesn't intersect part in SectionView043
20:56:39  DVS: SectionOrigin doesn't intersect part in SectionView044
20:56:39  DVS: SectionOrigin doesn't intersect part in SectionView045
20:56:39  DVS: SectionOrigin doesn't intersect part in SectionView046
20:56:39  DVS: SectionOrigin doesn't intersect part in SectionView047
20:56:39  DVS: SectionOrigin doesn't intersect part in SectionView048
20:56:39  DVS::makeSectionCut - prism & input don't intersect - Section E - E
20:56:41  DVS::prepareShape - failed to build shape SectionView048 - Bnd_Box is void **
20:56:41  DVS: SectionOrigin doesn't intersect part in SectionView023
20:56:43  <Exception> Dimension Reference has null geometry
20:56:43  <Exception> Dimension Reference has null geometry
20:56:43  DVP::getGeomByIndex(42) - invalid index - size: 37
20:56:43  CL::calcEndPoints2Lines - no geom for index: 42
20:56:43  DVP::getGeomByIndex(43) - invalid index - size: 37
20:56:43  CL::calcEndPoints2Lines - no geom for index: 43
20:56:43  CL::calcEndPoints2Lines - wrong number of edges: 0!
20:56:43  CL::scaledGeometry - failed to calculate endpoints!
20:56:43  CE::addCenterLinesToGeom - scaledGeometry is null
20:56:43  <Exception> Dimension Reference has null geometry
21:01:30  DVS: SectionOrigin doesn't intersect part in SectionView025
21:01:30  DVS: SectionOrigin doesn't intersect part in SectionView027

@maxwxyz
Copy link
Collaborator

maxwxyz commented Feb 24, 2024

@WandererFan could you help out here? The crash seems to be fixed in the dev builds but other errors occur.

@frank-trampe
Copy link
Author

I am now having this problem on a second view on a different page. One thing I noticed is that repositioning the object by dragging it does not lead to a crash, but setting it numerically (as is necessary to align the many views properly) does. In both cases, the change causes a crash 100% of the time with the originally reported FreeCAD version. Might the best path forward be to report the errors that appear in the weekly build in a separate issue and then recheck this issue when those are fixed?

@frank-trampe
Copy link
Author

I am now getting a possibly related crash consistently when trying to add a caption to a particular view in TechDraw in the snap version. I will test in the AppImage version tomorrow. If present in the weekly build, I will file this in a new issue. If it does not occur in the weekly build, I will try to churn through the weekly-build-specific errors to see whether they suppress the offending geometry somehow.

#0  0x00007fa0532f55f4 in Standard_Transient::IncrementRefCounter() const ()
   from target:/snap/freecad/908/usr/lib/libTKernel.so.7
#1  0x00007fa05364cd5a in TopLoc_SListOfItemLocation::Assign(TopLoc_SListOfItemLocation const&) () from target:/snap/freecad/908/usr/lib/libTKMath.so.7
#2  0x00007f9fdfb95900 in TopoDS_Shape::operator=(TopoDS_Shape const&) ()
   from target:/snap/freecad/908/usr/lib/TechDraw.so
#3  0x00007f9fdfb9b248 in TechDraw::GeometryObject::extractGeometry(TechDraw::edgeClass, bool) () from target:/snap/freecad/908/usr/lib/TechDraw.so
#4  0x00007f9fdfb9b36e in TechDraw::GeometryObject::makeTDGeometry() ()
   from target:/snap/freecad/908/usr/lib/TechDraw.so
#5  0x00007f9fdfb9ce95 in TechDraw::GeometryObject::projectShape(TopoDS_Shape const&, gp_Ax2 const&) () from target:/snap/freecad/908/usr/lib/TechDraw.so
#6  0x00007f9fdfafb635 in non-virtual thunk to QtConcurrent::RunFunctionTask<void>::run() () from target:/snap/freecad/908/usr/lib/TechDraw.so
#7  0x00007fa09edc98f2 in ?? ()
   from target:/snap/freecad/908/kf5/usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#8  0x00007fa09edc65a3 in ?? ()
   from target:/snap/freecad/908/kf5/usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#9  0x00007fa09df39609 in start_thread ()
   from target:/snap/freecad/908/lib/x86_64-linux-gnu/libpthread.so.0
#10 0x00007fa09e9d9353 in clone () from target:/lib/x86_64-linux-gnu/libc.so.6

@frank-trampe
Copy link
Author

I have not tested the second error in the weekly build yet, but it seems like the best way forward is to get the recent code working rather than trying to patch old code, so I filed #12655 on the sketch expression problem that arises when importing the project into the weekly build. I will check whether this issue occurs on a fresh build once that is fixed.

@frank-trampe
Copy link
Author

#12655 remains under discussion. I patched a recent binary to skip the reference constraint check. I get no geometry errors, and both previously crash-prone operations now complete successfully. This is good enough to unstall my project pending a permanent fix to the reference constraint issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Missing: confirmation Missing confirmation from other testers WB TechDraw Related to the TechDraw Workbench
Projects
None yet
Development

No branches or pull requests

2 participants