Ticket #4164 - Crash when opening a document using "Recent files" without creating a new document before

Post here for help on using FreeCAD's graphical user interface (GUI).
Forum rules
and Helpful information
IMPORTANT: Please click here and read this first, before asking for help

Also, be nice to others! Read the FreeCAD code of conduct!
tom
Posts: 165
Joined: Sun Mar 29, 2015 9:20 pm

Ticket #4164 - Crash when opening a document using "Recent files" without creating a new document before

Post by tom »

Hi,

I'm running the latest 0.19 version on a MacBook Air with Intel Graphics. This FC version always crashes, if I try opening a document immediately after starting the application, i.e. there is no active document yet. The crash does NOT happen, if I create a document using the "Create new empty document" button first. So, it seems that some initialisation is missing in case of opening a document instead of creating one.

MacOS creates following bug report including the stack traces:

Code: Select all

Process:               FreeCAD [48776]
Path:                  /Applications/FreeCAD.app/Contents/Resources/bin/FreeCAD
Identifier:            ???
Version:               ??? (0.19-18353)
Code Type:             X86-64 (Native)
Parent Process:        ??? [48772]
Responsible:           FreeCAD [48776]
User ID:               501

Date/Time:             2019-10-05 10:19:19.157 +0200
OS Version:            Mac OS X 10.13.6 (17G8030)
Report Version:        12
Anonymous UUID:        00D0AAE4-4FA2-1AA2-1DC3-429829F4143B

Sleep/Wake UUID:       BA375C4F-FFA3-4461-A42C-1F0A6061887C

Time Awake Since Boot: 90000 seconds
Time Since Wake:       550 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 0x0000000000000000
Exception Note:        EXC_CORPSE_NOTIFY

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

VM Regions Near 0:
--> 
    __TEXT                 000000010e27b000-000000010e283000 [   32K] r-x/rwx SM=COW  h [/Applications/FreeCAD.app/Contents/Resources/bin/FreeCAD]

Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0   libsystem_c.dylib             	0x00007fff7e6842f0 strncpy + 112
1   libCoin.80.dylib              	0x0000000110c0b759 cc_glglue_instance + 521
2   libCoin.80.dylib              	0x0000000110a7f601 SoGLRenderActionP::render(SoNode*) + 225
3   libCoin.80.dylib              	0x0000000110a7f4c5 SoGLRenderAction::beginTraversal(SoNode*) + 693
4   libCoin.80.dylib              	0x0000000110a7a136 SoAction::apply(SoNode*) + 374
5   libFreeCADGui.dylib           	0x000000010e5bacaa Gui::SoBoxSelectionRenderAction::apply(SoNode*) + 42
6   libFreeCADGui.dylib           	0x000000010e67f2e2 Gui::View3DInventorViewer::renderScene() + 322
7   libFreeCADGui.dylib           	0x000000010e642a65 SIM::Coin3D::Quarter::QuarterWidget::paintEvent(QPaintEvent*) + 293
8   libFreeCADGui.dylib           	0x000000010e64a352 SIM::Coin3D::Quarter::SoQTQuarterAdaptor::paintEvent(QPaintEvent*) + 66
9   libQt5Widgets.5.12.5.dylib    	0x000000010fc6c562 QWidget::event(QEvent*) + 1794
10  libQt5Widgets.5.12.5.dylib    	0x000000010fcdcad5 QFrame::event(QEvent*) + 37

Thread 1:
0   libsystem_kernel.dylib        	0x00007fff7e78528a __workq_kernreturn + 10
1   libsystem_pthread.dylib       	0x00007fff7e94c20e _pthread_wqthread + 1552
2   libsystem_pthread.dylib       	0x00007fff7e94bbe9 start_wqthread + 13

Thread 2:
0   libsystem_kernel.dylib        	0x00007fff7e78528a __workq_kernreturn + 10
1   libsystem_pthread.dylib       	0x00007fff7e94c009 _pthread_wqthread + 1035
2   libsystem_pthread.dylib       	0x00007fff7e94bbe9 start_wqthread + 13

Thread 3:: com.apple.CFSocket.private
0   libsystem_kernel.dylib        	0x00007fff7e784cf2 __select + 10
1   com.apple.CoreFoundation      	0x00007fff5673f40b __CFSocketManager + 635
2   libsystem_pthread.dylib       	0x00007fff7e94c661 _pthread_body + 340
3   libsystem_pthread.dylib       	0x00007fff7e94c50d _pthread_start + 377
4   libsystem_pthread.dylib       	0x00007fff7e94bbf9 thread_start + 13

Thread 4:: com.apple.NSEventThread
0   libsystem_kernel.dylib        	0x00007fff7e77b20a mach_msg_trap + 10
1   libsystem_kernel.dylib        	0x00007fff7e77a724 mach_msg + 60
2   com.apple.CoreFoundation      	0x00007fff567052c5 __CFRunLoopServiceMachPort + 341
3   com.apple.CoreFoundation      	0x00007fff56704617 __CFRunLoopRun + 1783
4   com.apple.CoreFoundation      	0x00007fff56703c93 CFRunLoopRunSpecific + 483
5   com.apple.AppKit              	0x00007fff53ddbfc4 _NSEventThread + 184
6   libsystem_pthread.dylib       	0x00007fff7e94c661 _pthread_body + 340
7   libsystem_pthread.dylib       	0x00007fff7e94c50d _pthread_start + 377
8   libsystem_pthread.dylib       	0x00007fff7e94bbf9 thread_start + 13

Thread 5:
0   libsystem_kernel.dylib        	0x00007fff7e784a16 __psynch_cvwait + 10
1   libsystem_pthread.dylib       	0x00007fff7e94d589 _pthread_cond_wait + 732
2   libopenblasp-r0.3.7.dylib     	0x0000000124b909fb blas_thread_server + 603
3   libsystem_pthread.dylib       	0x00007fff7e94c661 _pthread_body + 340
4   libsystem_pthread.dylib       	0x00007fff7e94c50d _pthread_start + 377
5   libsystem_pthread.dylib       	0x00007fff7e94bbf9 thread_start + 13

Thread 6:
0   libsystem_pthread.dylib       	0x00007fff7e94bbdc start_wqthread + 0
1   ???                           	0x0003000200030002 0 + 844433520263170

Thread 0 crashed with X86 Thread State (64-bit):
  rax: 0x0000000000000000  rbx: 0x00007ffee197abd0  rcx: 0x000000000000000f  rdx: 0x00000000000000ff
  rdi: 0x00007ffee197abd0  rsi: 0x0000000000000000  rbp: 0x00007ffee197ad00  rsp: 0x00007ffee197ab78
   r8: 0x00007ffee197abd0   r9: 0x00000000ffffffef  r10: 0x00007fd075ad8328  r11: 0x00007fff6009de53
  r12: 0x0000000000000001  r13: 0x0000000000000001  r14: 0x00007fd077247de0  r15: 0x00007fd0733ff600
  rip: 0x00007fff7e6842f0  rfl: 0x0000000000010207  cr2: 0x0000000000000000
  
Logical CPU:     2
Error Code:      0x00000004
Trap Number:     14


Binary Images:
...

External Modification Summary:
  Calls made by other processes targeting this process:
    task_for_pid: 19
    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: 16651740
    thread_create: 0
    thread_set_state: 0

VM Region Summary:
ReadOnly portion of Libraries: Total=760.3M resident=0K(0%) swapped_out_or_unallocated=760.3M(100%)
Writable regions: Total=243.6M written=0K(0%) resident=0K(0%) swapped_out=0K(0%) unallocated=243.6M(100%)
 
                                VIRTUAL   REGION 
REGION TYPE                        SIZE    COUNT (non-coalesced) 
===========                     =======  ======= 
Accelerate framework               256K        3 
Activity Tracing                   256K        2 
CG backing stores                 5772K        7 
CG image                           480K        9 
CoreAnimation                       48K        9 
CoreGraphics                         8K        2 
CoreImage                           36K        7 
CoreUI image data                 1564K       15 
CoreUI image file                  180K        4 
Dispatch continuations            8192K        2 
Foundation                           4K        2 
Kernel Alloc Once                    8K        2 
MALLOC                           181.4M       81 
MALLOC guard page                   48K       12 
MALLOC_LARGE (reserved)            512K        3         reserved VM address space (unallocated)
Memory Tag 242                      12K        2 
PROTECTED_MEMORY                     4K        2 
STACK GUARD                       56.0M        8 
Stack                             11.0M        8 
VM_ALLOCATE                        120K       19 
VM_ALLOCATE (reserved)            32.0M        2         reserved VM address space (unallocated)
__DATA                            43.8M      502 
__FONT_DATA                          4K        2 
__GLSLBUILTINS                    2588K        2 
__LINKEDIT                       246.9M      162 
__TEXT                           513.4M      454 
__UNICODE                          560K        2 
mapped file                      405.9M       62 
shared memory                      872K       15 
===========                     =======  ======= 
TOTAL                              1.5G     1373 
TOTAL, minus reserved VM space     1.4G     1373 

Model: MacBookAir7,2, BootROM 188.0.0.0.0, 2 processors, Intel Core i7, 2,2 GHz, 8 GB, SMC 2.27f2
Graphics: Intel HD Graphics 6000, Intel HD Graphics 6000, Built-In
Memory Module: BANK 0/DIMM0, 4 GB, DDR3, 1600 MHz, 0x80AD, 0x483943434E4E4E424A544D4C41522D4E5544
Memory Module: BANK 1/DIMM0, 4 GB, DDR3, 1600 MHz, 0x80AD, 0x483943434E4E4E424A544D4C41522D4E5544
AirPort: spairport_wireless_card_type_airport_extreme (0x14E4, 0x117), Broadcom BCM43xx 1.0 (7.77.37.32.1a1)
Bluetooth: Version 6.0.7f15, 3 services, 27 devices, 1 incoming serial ports
Network Service: Wi-Fi, AirPort, en0
Serial ATA Device: APPLE SSD SM0512G, 500,28 GB
USB Device: USB 3.0 Bus
USB Device: BRCM20702 Hub
USB Device: Bluetooth USB Host Controller
Thunderbolt Bus: MacBook Air, Apple Inc., 27.2
Can anybody confirm the behaviour?

Best regards,
Thomas

Code: Select all

OS: macOS High Sierra (10.13)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.18353 (Git)
Build type: Release
Branch: master
Hash: 5de6763ed5889bfec76994e77d9c71b362448790
Python version: 3.7.3
Qt version: 5.12.5
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: English/Germany (en_DE)
Last edited by Kunda1 on Sun Oct 13, 2019 4:59 pm, edited 2 times in total.
Reason: Added ticket number to thread title
User avatar
pl7i92LCNC
Posts: 208
Joined: Tue Mar 12, 2019 3:03 pm
Location: RLP DE

Re: Crash when opening a document without creating a new document before

Post by pl7i92LCNC »

what happens if you
make a new PART save it
close all down
reopen the FreeCAD
open last file your part
tom
Posts: 165
Joined: Sun Mar 29, 2015 9:20 pm

Re: Crash when opening a document without creating a new document before

Post by tom »

The same crash occurs. BUT I observed an important detail: The crash only happens, if I open the document using the "Recent files" menu. FC does not crash, if I use the "Open..." menu or the "Open a document or import files" button.

BR Thomas
tom
Posts: 165
Joined: Sun Mar 29, 2015 9:20 pm

Re: Crash when opening a document using "Recent files" without creating a new document before

Post by tom »

Nobody can confirm the crash?
chrisb
Veteran
Posts: 53919
Joined: Tue Mar 17, 2015 9:14 am

Re: Crash when opening a document using "Recent files" without creating a new document before

Post by chrisb »

I cannot confirm with one of these versions, please retry with the latter. You may try resetting your config.

OS: macOS High Sierra (10.13)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.18260 (Git)
Build type: Release
Branch: master
Hash: dbf0644b60c35273525985fa13859ad39b0c10df
Python version: 3.7.3
Qt version: 5.12.1
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: English/Germany (en_DE)

OS: macOS High Sierra (10.13)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.18403 (Git)
Build type: Release
Branch: master
Hash: 0717b4fc23ef1db70964c3977d25e2fe46a739d1
Python version: 3.7.3
Qt version: 5.12.5
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: English/Germany (en_DE)
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
wmayer
Founder
Posts: 20241
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: Crash when opening a document using "Recent files" without creating a new document before

Post by wmayer »

1 libCoin.80.dylib 0x0000000110c0b759 cc_glglue_instance + 521
Does anybody know what exactly the 521 means?
kisolre
Veteran
Posts: 4162
Joined: Wed Nov 21, 2018 1:13 pm

Re: Crash when opening a document using "Recent files" without creating a new document before

Post by kisolre »

Cant confirm here also

OS: Windows 8.1 (6.3)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.18408 (Git)
Build type: Release
Branch: master
Hash: 6663d625a97f350c421a26a605abe6b59676b7fd
Python version: 3.6.8
Qt version: 5.12.1
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: Bulgarian/Bulgaria (bg_BG)

Opening file from recent files after start works as expected.
tom
Posts: 165
Joined: Sun Mar 29, 2015 9:20 pm

Re: Crash when opening a document using "Recent files" without creating a new document before

Post by tom »

wmayer wrote: Mon Oct 07, 2019 8:34 am
1 libCoin.80.dylib 0x0000000110c0b759 cc_glglue_instance + 521
Does anybody know what exactly the 521 means?
It is the offset relative to the symbol cc_glglue_instance, where the next function (strncpy) is called from, i.e. the call to strncpy() is located 521 bytes after the entry point of cc_glglue_instance.

BR Thomas
tom
Posts: 165
Joined: Sun Mar 29, 2015 9:20 pm

Re: Crash when opening a document using "Recent files" without creating a new document before

Post by tom »

OK, I tried it on another Mac:

Code: Select all

OS: macOS High Sierra (10.13)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.18403 (Git)
Build type: Release
Branch: master
Hash: 0717b4fc23ef1db70964c3977d25e2fe46a739d1
Python version: 3.7.3
Qt version: 5.12.5
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: English/Germany (en_DE)
The crash happens here too.

BUT, I found another important detail for reproducing the crash: In my preferences the auto load module after start up is set to "Part Design". The crash does not happen, if the auto load module is set to "Start".

BR Thomas
wmayer
Founder
Posts: 20241
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: Crash when opening a document using "Recent files" without creating a new document before

Post by wmayer »

tom wrote: Mon Oct 07, 2019 4:56 pm
wmayer wrote: Mon Oct 07, 2019 8:34 am
1 libCoin.80.dylib 0x0000000110c0b759 cc_glglue_instance + 521
Does anybody know what exactly the 521 means?
It is the offset relative to the symbol cc_glglue_instance, where the next function (strncpy) is called from, i.e. the call to strncpy() is located 521 bytes after the entry point of cc_glglue_instance.

BR Thomas
This is what I have guessed too but the only problem is that strncpy doesn't occur inside c_glglue_instance. It's used inside the function glglue_set_glVersion() which is invoked from within c_glglue_instance but then in the call stack glglue_set_glVersion() should occur, too.
Post Reply