[solved] Segfault when save a document with content

Having trouble installing or compiling FreeCAD? Get help here.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Post Reply
User avatar
Gift
Posts: 769
Joined: Tue Aug 18, 2015 10:08 am
Location: Germany, Sauerland

[solved] Segfault when save a document with content

Post by Gift »

Because looo is too slow, I compiled FreeCAD self for arm64. **duck down** :-D

If I save an empty document, all is fine. If I add e.g. cube to the document and save, then FreeCAD crashed. I do not know if it is a bug (e.g. serialization) or is it trouble with some library. Thank you for your help and support.

Code: Select all

Process:               FreeCAD [33895]
Path:                  /opt/homebrew/*/FreeCAD.app/Contents/MacOS/FreeCAD
Identifier:            ???
Version:               0.20.0 (0.20.0)
Code Type:             ARM-64 (Native)
Parent Process:        ??? [1]
Responsible:           FreeCAD [33895]
User ID:               502

Date/Time:             2021-07-31 15:54:38.132 +0200
OS Version:            macOS 11.5.1 (20G80)
Report Version:        12
Anonymous UUID:        1955793E-D58F-E2B2-2D26-67FE6BF99EAA

Sleep/Wake UUID:       DB3F1465-166E-44B1-82D6-842D0D07ADCE

Time Awake Since Boot: 26000 seconds
Time Since Wake:       4900 seconds

System Integrity Protection: enabled

Crashed Thread:        0  Dispatch queue: com.apple.main-thread

Exception Type:        EXC_BAD_ACCESS (SIGSEGV)
Exception Codes:       KERN_INVALID_ADDRESS at 0x0000000000000028
Exception Note:        EXC_CORPSE_NOTIFY

Termination Signal:    Segmentation fault: 11
Termination Reason:    Namespace SIGNAL, Code 0xb
Terminating Process:   exc handler [33895]

VM Regions Near 0x28:
--> 
    __TEXT                      1008dc000-1008ec000    [   64K] r-x/r-x SM=COW  /opt/homebrew/*/FreeCAD.app/Contents/MacOS/FreeCAD

Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0   libc++.1.dylib                	0x000000010629a048 std::__1::istreambuf_iterator<char, std::__1::char_traits<char> > std::__1::num_get<char, std::__1::istreambuf_iterator<char, std::__1::char_traits<char> > >::__do_get_signed<long>(std::__1::istreambuf_iterator<char, std::__1::char_traits<char> >, std::__1::istreambuf_iterator<char, std::__1::char_traits<char> >, std::__1::ios_base&, unsigned int&, long&) const + 68
1   libc++.1.dylib                	0x0000000199bd7c3c std::__1::basic_ostream<char, std::__1::char_traits<char> >::operator<<(int) + 348
2   libc++.1.dylib                	0x0000000199bd7c3c std::__1::basic_ostream<char, std::__1::char_traits<char> >::operator<<(int) + 348
3   libTKBRep.7.dylib             	0x000000014f3e2040 TopTools_ShapeSet::Write(TopoDS_Shape const&, std::__1::basic_ostream<char, std::__1::char_traits<char> >&) const + 120
4   Part.so                       	0x0000000148eec75c Part::PropertyPartShape::SaveDocFile(Base::Writer&) const + 404
5   libFreeCADBase.dylib          	0x0000000100acc838 Base::ZipWriter::writeFiles() + 108
6   libFreeCADApp.dylib           	0x0000000101d1bbb4 App::Document::saveToFile(char const*) const + 912
7   libFreeCADApp.dylib           	0x0000000101d1b3a0 App::Document::save() + 328
8   libFreeCADApp.dylib           	0x0000000101d1b00c App::Document::saveAs(char const*) + 284
9   libFreeCADApp.dylib           	0x0000000101daf4a0 App::DocumentPy::saveAs(_object*) + 112
10  libFreeCADApp.dylib           	0x0000000101daa3f4 App::DocumentPy::staticCallback_saveAs(_object*, _object*) + 92
11  Python                        	0x00000001024bbdd4 cfunction_call + 168
12  Python                        	0x0000000102487388 _PyObject_MakeTpCall + 308
13  Python                        	0x00000001025343d0 call_function + 512
14  Python                        	0x0000000102531b80 _PyEval_EvalFrameDefault + 23920
15  Python                        	0x0000000102534e74 _PyEval_EvalCode + 1944
16  Python                        	0x000000010252bd48 PyEval_EvalCode + 80
17  Python                        	0x0000000102564e60 run_eval_code_obj + 116
18  Python                        	0x00000001025640ec run_mod + 116
19  Python                        	0x0000000102563028 PyRun_StringFlags + 152
20  libFreeCADBase.dylib          	0x0000000100a76fb0 Base::InterpreterSingleton::runString(char const*) + 80
21  libFreeCADGui.dylib           	0x0000000100e76450 Gui::Command::_runCommand(char const*, int, Gui::Command::DoCmd_Type, char const*) + 168
22  libFreeCADGui.dylib           	0x0000000100e7622c Gui::Command::_doCommand(char const*, int, Gui::Command::DoCmd_Type, char const*, ...) + 96
23  libFreeCADGui.dylib           	0x0000000100e21a90 Gui::Document::saveAs() + 1000
24  libFreeCADGui.dylib           	0x00000001010d1a30 Gui::View3DInventor::onMsg(char const*, char const**) + 1192
25  libFreeCADGui.dylib           	0x0000000100dd4620 Gui::Application::sendMsgToActiveView(char const*, char const**) + 52
26  libFreeCADGui.dylib           	0x0000000100df392c Gui::Application::sSendActiveView(_object*, _object*) + 96
27  Python                        	0x00000001024bbdd4 cfunction_call + 168
28  Python                        	0x0000000102487388 _PyObject_MakeTpCall + 308
29  Python                        	0x00000001025343d0 call_function + 512
30  Python                        	0x0000000102531b80 _PyEval_EvalFrameDefault + 23920
31  Python                        	0x0000000102534e74 _PyEval_EvalCode + 1944
32  Python                        	0x000000010252bd48 PyEval_EvalCode + 80
33  Python                        	0x0000000102564e60 run_eval_code_obj + 116
34  Python                        	0x00000001025640ec run_mod + 116
35  Python                        	0x0000000102563028 PyRun_StringFlags + 152
36  libFreeCADBase.dylib          	0x0000000100a76fb0 Base::InterpreterSingleton::runString(char const*) + 80
37  libFreeCADGui.dylib           	0x0000000100e76450 Gui::Command::_runCommand(char const*, int, Gui::Command::DoCmd_Type, char const*) + 168
38  libFreeCADGui.dylib           	0x0000000100e7622c Gui::Command::_doCommand(char const*, int, Gui::Command::DoCmd_Type, char const*, ...) + 96
39  libFreeCADGui.dylib           	0x0000000100e754e8 Gui::Command::_invoke(int, bool) + 504
40  libFreeCADGui.dylib           	0x0000000100e752b0 Gui::Command::invoke(int, Gui::Command::TriggerSource) + 328
41  QtCore                        	0x0000000105e586d8 0x105c54000 + 2115288
42  QtWidgets                     	0x000000010514ac6c QAction::activate(QAction::ActionEvent) + 308
43  QtCore                        	0x0000000105e509e0 QObject::event(QEvent*) + 620
44  QtWidgets                     	0x0000000105153e24 QApplicationPrivate::notify_helper(QObject*, QEvent*) + 292
45  QtWidgets                     	0x00000001051551ac QApplication::notify(QObject*, QEvent*) + 548
46  libFreeCADGui.dylib           	0x0000000100e5445c Gui::GUIApplication::notify(QObject*, QEvent*) + 164
47  QtCore                        	0x0000000105e28454 QCoreApplication::notifyInternal2(QObject*, QEvent*) + 208
48  QtCore                        	0x0000000105e296d0 QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) + 764
49  libqcocoa.dylib               	0x0000000108ee7f1c 0x108eb0000 + 229148
50  libqcocoa.dylib               	0x0000000108ee85ec 0x108eb0000 + 230892
51  com.apple.CoreFoundation      	0x0000000199d72a84 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 28
52  com.apple.CoreFoundation      	0x0000000199d729d0 __CFRunLoopDoSource0 + 208
53  com.apple.CoreFoundation      	0x0000000199d72728 __CFRunLoopDoSources0 + 376
54  com.apple.CoreFoundation      	0x0000000199d71044 __CFRunLoopRun + 820
55  com.apple.CoreFoundation      	0x0000000199d70598 CFRunLoopRunSpecific + 600
56  com.apple.HIToolbox           	0x00000001a1c93280 RunCurrentEventLoopInMode + 292
57  com.apple.HIToolbox           	0x00000001a1c92f0c ReceiveNextEventCommon + 320
58  com.apple.HIToolbox           	0x00000001a1c92db4 _BlockUntilNextEventMatchingListInModeWithFilter + 72
59  com.apple.AppKit              	0x000000019c561a64 _DPSNextEvent + 836
60  com.apple.AppKit              	0x000000019c560404 -[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 1292
61  com.apple.AppKit              	0x000000019c552290 -[NSApplication run] + 596
62  libqcocoa.dylib               	0x0000000108ee7374 0x108eb0000 + 226164
63  QtCore                        	0x0000000105e245b8 QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) + 524
64  QtCore                        	0x0000000105e28a84 QCoreApplication::exec() + 132
65  libFreeCADGui.dylib           	0x0000000100dd9fc8 Gui::Application::runApplication() + 7256
66                                	0x00000001008e92f8 main + 2416
67  libdyld.dylib                 	0x0000000199c91430 start + 4

Thread 1:
0   libsystem_pthread.dylib       	0x0000000199c6e5cc start_wqthread + 0

Thread 2:
0   libsystem_pthread.dylib       	0x0000000199c6e5cc start_wqthread + 0

Thread 3:
0   libsystem_pthread.dylib       	0x0000000199c6e5cc start_wqthread + 0

Thread 4:: com.apple.CFSocket.private
0   libsystem_kernel.dylib        	0x0000000199c431ec __select + 8
1   com.apple.CoreFoundation      	0x0000000199d9c280 __CFSocketManager + 624
2   libsystem_pthread.dylib       	0x0000000199c73878 _pthread_start + 320
3   libsystem_pthread.dylib       	0x0000000199c6e5e0 thread_start + 8

Thread 5:
0   libsystem_kernel.dylib        	0x0000000199c3c548 __psynch_cvwait + 8
1   libsystem_pthread.dylib       	0x0000000199c73dac _pthread_cond_wait + 1248
2   libgomp.1.dylib               	0x00000001233ae754 gomp_sem_wait + 52
3   libgomp.1.dylib               	0x00000001233ae988 gomp_barrier_wait_end + 104
4   libgomp.1.dylib               	0x00000001233ac950 gomp_thread_start + 272
5   libsystem_pthread.dylib       	0x0000000199c73878 _pthread_start + 320
6   libsystem_pthread.dylib       	0x0000000199c6e5e0 thread_start + 8

Thread 6:
0   libsystem_kernel.dylib        	0x0000000199c3c548 __psynch_cvwait + 8
1   libsystem_pthread.dylib       	0x0000000199c73dac _pthread_cond_wait + 1248
2   libgomp.1.dylib               	0x00000001233ae754 gomp_sem_wait + 52
3   libgomp.1.dylib               	0x00000001233ae988 gomp_barrier_wait_end + 104
4   libgomp.1.dylib               	0x00000001233ac950 gomp_thread_start + 272
5   libsystem_pthread.dylib       	0x0000000199c73878 _pthread_start + 320
6   libsystem_pthread.dylib       	0x0000000199c6e5e0 thread_start + 8

Thread 7:
0   libsystem_pthread.dylib       	0x0000000199c6e5cc start_wqthread + 0

Thread 8:: com.apple.NSEventThread
0   libsystem_kernel.dylib        	0x0000000199c38dd4 mach_msg_trap + 8
1   libsystem_kernel.dylib        	0x0000000199c39184 mach_msg + 76
2   com.apple.CoreFoundation      	0x0000000199d72d00 __CFRunLoopServiceMachPort + 372
3   com.apple.CoreFoundation      	0x0000000199d711cc __CFRunLoopRun + 1212
4   com.apple.CoreFoundation      	0x0000000199d70598 CFRunLoopRunSpecific + 600
5   com.apple.AppKit              	0x000000019c6e0738 _NSEventThread + 196
6   libsystem_pthread.dylib       	0x0000000199c73878 _pthread_start + 320
7   libsystem_pthread.dylib       	0x0000000199c6e5e0 thread_start + 8

Thread 9:
0   libsystem_pthread.dylib       	0x0000000199c6e5cc start_wqthread + 0

Thread 10:
0   libsystem_pthread.dylib       	0x0000000199c6e5cc start_wqthread + 0

Thread 11:
0   libsystem_pthread.dylib       	0x0000000199c6e5cc start_wqthread + 0

Thread 0 crashed with ARM Thread State (64-bit):
    x0: 0x0000000000000020   x1: 0x000000014ffe1410   x2: 0x000000016f51fe38   x3: 0x0000000000000020
    x4: 0x0000000000000001   x5: 0x0000000000000020   x6: 0x000000000000002b   x7: 0x0000000199c336b0
    x8: 0x1f1fee1f2d3b009c   x9: 0x000000010629a000  x10: 0x000000014f3e12fc  x11: 0x0000000000000000
   x12: 0x0000000000000010  x13: 0x0000000000000000  x14: 0x0000000000000010  x15: 0x000000000000001e
   x16: 0x0000000199bf31a4  x17: 0x000000000000d3ed  x18: 0x0000000150d8b940  x19: 0x000000014ffe1410
   x20: 0x0000000000000001  x21: 0x000000016f51fe38  x22: 0x000000016f51fe38  x23: 0x000000014ffe1410
   x24: 0x0000000000000020  x25: 0x0000000000001006  x26: 0x000000014fec2690  x27: 0x000000014fec4610
   x28: 0x0000000000000001   fp: 0x000000016f51f320   lr: 0x0000000199bd7c3c
    sp: 0x000000016f51f190   pc: 0x000000010629a048 cpsr: 0x80000000
   far: 0x0000000000000028  esr: 0x92000006


...

External Modification Summary:
  Calls made by other processes targeting this process:
    task_for_pid: 0
    thread_create: 0
    thread_set_state: 0
  Calls made by this process:
    task_for_pid: 0
    thread_create: 0
    thread_set_state: 0
  Calls made by all processes on this machine:
    task_for_pid: 0
    thread_create: 0
    thread_set_state: 0

VM Region Summary:
ReadOnly portion of Libraries: Total=919.5M resident=0K(0%) swapped_out_or_unallocated=919.5M(100%)
Writable regions: Total=2.0G written=0K(0%) resident=0K(0%) swapped_out=0K(0%) unallocated=2.0G(100%)
 
                                VIRTUAL   REGION 
REGION TYPE                        SIZE    COUNT (non-coalesced) 
===========                     =======  ======= 
Accelerate framework               768K        6 
Activity Tracing                   256K        1 
CG backing stores                 3264K        6 
CG image                          1904K       13 
CG raster data                    1648K        1 
CoreAnimation                     10.0M       28 
CoreGraphics                        32K        2 
CoreUI image data                 2816K       21 
Foundation                          16K        1 
Kernel Alloc Once                   32K        1 
MALLOC                           344.4M       64 
MALLOC guard page                  192K       10 
MALLOC_MEDIUM (reserved)         936.0M        8         reserved VM address space (unallocated)
MALLOC_NANO (reserved)           384.0M        1         reserved VM address space (unallocated)
OpenGL GLSL                        256K        3 
STACK GUARD                       56.2M       12 
Stack                             16.8M       12 
VM_ALLOCATE                      133.5M      164 
VM_ALLOCATE (reserved)           192.0M        3         reserved VM address space (unallocated)
__AUTH                             695K      168 
__AUTH_CONST                      10.5M      328 
__DATA                            12.0M      476 
__DATA_CONST                      14.8M      459 
__DATA_DIRTY                       896K      119 
__FONT_DATA                          4K        1 
__GLSLBUILTINS                    5176K        1 
__LINKEDIT                       538.2M      146 
__OBJC_CONST                      1656K      142 
__OBJC_RO                         75.1M        1 
__OBJC_RW                         2576K        1 
__TEXT                           381.3M      482 
__UNICODE                          588K        1 
mapped file                      553.0M       39 
shared memory                      848K       12 
===========                     =======  ======= 
TOTAL                              3.6G     2733 
TOTAL, minus reserved VM space     2.1G     2733 

Model: MacBookPro17,1, BootROM 6723.140.2, proc 8:4:4 processors, 16 GB, SMC 
Graphics: kHW_AppleM1Item, Apple M1, spdisplays_builtin
Memory Module: LPDDR4
AirPort: spairport_wireless_card_type_airport_extreme, wl0: Jul  7 2021 00:48:27 version 18.50.40.10.7.8.121 FWID 01-f5ad2691
Bluetooth: Version 8.0.5d7, 3 services, 27 devices, 1 incoming serial ports
Network Service: Wi-Fi, AirPort, en0
USB Device: USB 3.1 Bus
USB Device: USB 3.1 Bus
Thunderbolt Bus: MacBook Pro, Apple Inc.
Thunderbolt Bus: MacBook Pro, Apple Inc.

Code: Select all

OS: macOS 11.5
Word size of FreeCAD: 64-bit
Version: 0.20.25351 (Git)
Build type: Release
Branch: master
Hash: a03eb6b9625ba88d41e876699e9352206887d6fb
Python version: 3.9.0
Qt version: 5.15.2
Coin version: 4.0.0
OCC version: 7.5.0
Locale: English/Germany (en_DE)
Last edited by Gift on Sun Aug 01, 2021 1:22 pm, edited 1 time in total.
User avatar
onekk
Veteran
Posts: 6094
Joined: Sat Jan 17, 2015 7:48 am
Contact:

Re: Segfault when save a document with content

Post by onekk »

Maybe:

https://github.com/FreeCAD/homebrew-freecad/issues/177

This could be the same bahviour?

Regards

Carlo D.
GitHub page: https://github.com/onekk/freecad-doc.
- In deep articles on FreeCAD.
- Learning how to model with scripting.
- Various other stuffs.

Blog: https://okkmkblog.wordpress.com/
User avatar
Gift
Posts: 769
Joined: Tue Aug 18, 2015 10:08 am
Location: Germany, Sauerland

Re: Segfault when save a document with content

Post by Gift »

onekk wrote: Sat Jul 31, 2021 3:20 pm Maybe:

https://github.com/FreeCAD/homebrew-freecad/issues/177

This could be the same bahviour?

Regards

Carlo D.
Thank you very much for the link.
User avatar
Gift
Posts: 769
Joined: Tue Aug 18, 2015 10:08 am
Location: Germany, Sauerland

Re: Segfault when save a document with content

Post by Gift »

ipatch wrote:Ping
Hey ipatch, which version of llvm do you use? I compiled llvm (12.0.1), but that doesn't help.
User avatar
Gift
Posts: 769
Joined: Tue Aug 18, 2015 10:08 am
Location: Germany, Sauerland

Re: Segfault when save a document with content

Post by Gift »

With llvm@11 all is fine. :)
User avatar
ipatch
Posts: 112
Joined: Wed Apr 08, 2020 3:40 pm
Location: dfw
Contact:

Re: [solved] Segfault when save a document with content

Post by ipatch »

that's good to know.

i compiled the latest upstream yesterday on mojave and did not run into this issue.

however when i compiled sometime last week, i was running into this issue. even made a little screen recording about the issue, just never uploaded it.
Post Reply