[fixed by wmayer] FreeCAD crash upon close (Attacher/extension/python related)

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!
User avatar
DeepSOIC
Posts: 6639
Joined: Fri Aug 29, 2014 12:45 am
Location: Saint-Petersburg, Russia

[fixed by wmayer] FreeCAD crash upon close (Attacher/extension/python related)

Postby DeepSOIC » Wed Jan 18, 2017 2:35 pm

Hi!
1. Part Cube
2. Draft Clone the cube.
3. Close FreeCAD by clicking X button on window. In save pop-up dialog, click Discard. After that, FreeCAD crashes.

In Qt's Application output, i get this:

Code: Select all

Starting T:\_vt\dev\PC\Qt\FreeCAD\build-debug\bin\FreeCAD_d.exe...
FreeCAD 0.17, Libs: 0.17R9677 (Git)
В© Juergen Riegel, Werner Mayer, Yorik van Havre 2001-2016
  #####                 ####  ###   ####  
  #                    #      # #   #   # 
  #     ##  #### ####  #     #   #  #   # 
  ####  # # #  # #  #  #     #####  #   # 
  #     #   #### ####  #    #     # #   # 
  #     #   #    #     #    #     # #   #  ##  ##  ##
  #     #   #### ####   ### #     # ####   ##  ##  ##

Attach observer 000001CE27FFB7F0
Attach observer 000001CE27FFB0F0
Attach observer 000001CE28DF8550
Attach observer 000001CE29127318
Attach observer 000001CE28FFEA28
Attach observer 000001CE28FFEA28
Attach observer 000001CE28FFEAF0
Wizard shaft module cannot be loaded
Fatal Python error: PyThreadState_Get: no current thread
Fatal Python error: PyThreadState_Get: no current thread
The program has unexpectedly finished.
T:\_vt\dev\PC\Qt\FreeCAD\build-debug\bin\FreeCAD_d.exe crashed
OS: Windows 10
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.17.9677 (Git)
Build type: Debug
Branch: (HEAD detached at FC/master)
Hash: c0ec75eb5a9dc5a4f70012864da6b30e7f17d54d
Python version: 2.7.8
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 7.0.0

--
A few thoughts.
The key to the crash seems to be a python feature with attach extension. Clone has AttachExtensionPython. I haven't yet tried any other extension.
C++ features with extensions (e.g. Part Cube) don't cause trouble.
User avatar
DeepSOIC
Posts: 6639
Joined: Fri Aug 29, 2014 12:45 am
Location: Saint-Petersburg, Russia

Re: FreeCAD crash upon close (Attacher/extension/python related)

Postby DeepSOIC » Wed Jan 18, 2017 2:42 pm

Update. Adding Lattice Attached Placement doesn't cause a crash on close. So it's something special about Clone.

EDIT: No trouble with this:

Code: Select all

f = App.ActiveDocument.addObject( "Part::FeaturePython", "test")
f.addExtension("Part::AttachExtensionPython", None)
User avatar
DeepSOIC
Posts: 6639
Joined: Fri Aug 29, 2014 12:45 am
Location: Saint-Petersburg, Russia

Re: FreeCAD crash upon close (Attacher/extension/python related)

Postby DeepSOIC » Wed Jan 18, 2017 2:50 pm

Backtrace.
Brief:

Code: Select all

0	DebugBreak	KERNELBASE		0x7fffe29c6142	
1	Py_FatalError	pythonrun.c	1701	0x1e27688d	
2	PyThreadState_Get	pystate.c	332	0x1e254fca	
3	dict_dealloc	dictobject.c	1005	0x1e138dc6	
4	_Py_Dealloc	object.c	2263	0x1e182b0e	
5	App::FeaturePythonPyT<Part::PartFeaturePy>::~FeaturePythonPyT<Part::PartFeaturePy>	FeaturePythonPyImp.inl	93	0x7fffa74ea5af	
6	App::FeaturePythonPyT<Part::PartFeaturePy>::`scalar deleting destructor'	Part_d		0x7fffa74ebd6c	
7	Base::PyObjectBase::PyDestructor	PyObjectBase.h	193	0x7fffc1fecba0	
8	_Py_Dealloc	object.c	2263	0x1e182b0e	
9	Py::_XDECREF	IndirectPythonInterface.cxx	564	0x7fffc1fd80a6	
10	Py::Object::release	Objects.hxx	173	0x7fffc1fd3f1c	
11	Py::Object::~Object	Objects.hxx	216	0x7fffc1fc38f7	
12	App::DocumentObject::~DocumentObject	DocumentObject.cpp	72	0x7fffab3bf47c	
13	App::GeoFeature::~GeoFeature	GeoFeature.cpp	48	0x7fffab463954	
14	Part::Feature::~Feature	PartFeature.cpp	73	0x7fffa74e3055	
15	App::FeaturePythonT<Part::Feature>::~FeaturePythonT<Part::Feature>	FeaturePython.h	77	0x7fffa74ea6df	
16	App::FeaturePythonT<Part::Feature>::`vector deleting destructor'	Part_d		0x7fffa74ebb4d	
17	App::Document::~Document	Document.cpp	1074	0x7fffab291a73	
18	App::Document::`vector deleting destructor'	FreeCADApp_d		0x7fffab35c44d	
19	std::default_delete<App::Document>::operator()	memory	1200	0x7fffab58d544	
20	std::unique_ptr<App::Document,std::default_delete<App::Document>>::~unique_ptr<App::Document,std::default_delete<App::Document>>	memory	1449	0x7fffab5881b3	
21	App::Application::closeDocument	Application.cpp	382	0x7fffab5551c5	
22	Gui::Application::tryClose	Application.cpp	912	0x7fffab9cb469	
23	Gui::MainWindow::closeEvent	MainWindow.cpp	964	0x7fffac09f84b	
24	QAbstractItemView::qt_metacast	QtGuid4		0x625cdd42	
25	QAbstractItemView::qt_metacast	QtGuid4		0x62c712eb	
26	Gui::MainWindow::event	MainWindow.cpp	636	0x7fffac0a0785	
27	QAbstractItemView::qt_metacast	QtGuid4		0x6252bbf6	
28	QAbstractItemView::qt_metacast	QtGuid4		0x62528fdc	
29	Gui::GUIApplication::notify	GuiApplication.cpp	91	0x7fffabb086c2	
30	QBuffer::qt_static_metacall	QtCored4		0x6217a1ca	
31	QBuffer::qt_static_metacall	QtCored4		0x62243a6c	
32	QAbstractItemView::qt_metacast	QtGuid4		0x625d76d8	
33	QAbstractItemView::qt_metacast	QtGuid4		0x62619ba5	
34	QAbstractItemView::qt_metacast	QtGuid4		0x626152c9	
35	CallWindowProcW	USER32		0x7fffe5c91c24	
36	CallWindowProcW	USER32		0x7fffe5c91917	
37	MapWindowPoints	USER32		0x7fffe5ca2563	
38	KiUserCallbackDispatcher	ntdll		0x7fffe6499c54	
39	NtUserMessageCall	win32u		0x7fffe28e1184	
40	GetWindowTextW	USER32		0x7fffe5c8ee4d	
41	GetWindowTextW	USER32		0x7fffe5c8e982	
42	IsThemeActive	uxtheme		0x7fffe0ffc5ea	
43	IsThemeActive	uxtheme		0x7fffe0ffc262	
44	DrawThemeBackground	uxtheme		0x7fffe0ff1e15	
45	DrawThemeBackground	uxtheme		0x7fffe0ff06d1	
46	GetWindowTextW	USER32		0x7fffe5c8eb7d	
47	QAbstractItemView::qt_metacast	QtGuid4		0x62f40158	
48	QAbstractItemView::qt_metacast	QtGuid4		0x62617094	
49	CallWindowProcW	USER32		0x7fffe5c91c24	
50	CallWindowProcW	USER32		0x7fffe5c91917	
51	MapWindowPoints	USER32		0x7fffe5ca2563	
52	KiUserCallbackDispatcher	ntdll		0x7fffe6499c54	
53	NtUserMessageCall	win32u		0x7fffe28e1184	
54	GetWindowTextW	USER32		0x7fffe5c8ee4d	
55	GetWindowTextW	USER32		0x7fffe5c8e982	
56	IsThemeActive	uxtheme		0x7fffe0ffc5ea	
57	IsThemeActive	uxtheme		0x7fffe0ffc207	
58	DrawThemeBackground	uxtheme		0x7fffe0ff1e15	
59	DrawThemeBackground	uxtheme		0x7fffe0ff06d1	
60	GetWindowTextW	USER32		0x7fffe5c8eb7d	
61	QAbstractItemView::qt_metacast	QtGuid4		0x62f40158	
62	QAbstractItemView::qt_metacast	QtGuid4		0x62617094	
63	CallWindowProcW	USER32		0x7fffe5c91c24	
64	DispatchMessageW	USER32		0x7fffe5c9156c	
65	QBuffer::qt_static_metacall	QtCored4		0x621ceef8	
66	QAbstractItemView::qt_metacast	QtGuid4		0x6261c875	
67	QBuffer::qt_static_metacall	QtCored4		0x62175f24	
68	QBuffer::qt_static_metacall	QtCored4		0x62176207	
69	QBuffer::qt_static_metacall	QtCored4		0x6217824c	
70	QAbstractItemView::qt_metacast	QtGuid4		0x625261c8	
71	Gui::Application::runApplication	Application.cpp	1738	0x7fffab9cadc7	
72	main	MainGui.cpp	238	0x7ff753f035ca	
73	WinMain	FreeCAD_d		0x7ff753f132d1	
74	__tmainCRTStartup	crtexe.c	618	0x7ff753f11391	
75	WinMainCRTStartup	crtexe.c	466	0x7ff753f1110e	
76	BaseThreadInitThunk	KERNEL32		0x7fffe6348364	
77	RtlUserThreadStart	ntdll		0x7fffe64570d1	
Extensive:

Code: Select all

.  0  Id: 345c.2240 Suspend: 1 Teb: 000000ee`bbd06000 Unfrozen
Child-SP          RetAddr           Call Site
000000ee`bbef4cc8 00000000`1e27688d KERNELBASE!DebugBreak+0x2
000000ee`bbef4cd0 00000000`1e254fca python27_d!Py_FatalError(char * msg = 0x00000000`1e36c3d8 "PyThreadState_Get: no current thread")+0xfd [e:\clbundler\workspace\build_vc12_x64\python-2.7.8\python\pythonrun.c @ 1701]
000000ee`bbef4d70 00000000`1e138dc6 python27_d!PyThreadState_Get(void)+0x1a [e:\clbundler\workspace\build_vc12_x64\python-2.7.8\python\pystate.c @ 332]
000000ee`bbef4da0 00000000`1e182b0e python27_d!dict_dealloc(struct _dictobject * mp = 0x00000212`34c0be18)+0x26 [e:\clbundler\workspace\build_vc12_x64\python-2.7.8\objects\dictobject.c @ 1005]
000000ee`bbef4e00 00007fff`a74ea5af python27_d!_Py_Dealloc(struct _object * op = 0x00000212`34c0be18)+0x2e [e:\clbundler\workspace\build_vc12_x64\python-2.7.8\objects\object.c @ 2263]
000000ee`bbef4e40 00007fff`a74ebd6c Part_d!App::FeaturePythonPyT<Part::PartFeaturePy>::~FeaturePythonPyT<Part::PartFeaturePy>(void)+0xaf [t:\_vt\dev\pc\qt\freecad\freecad-ellipse\src\app\featurepythonpyimp.inl @ 93]
000000ee`bbef4e80 00007fff`c1fecba0 Part_d!App::FeaturePythonPyT<Part::PartFeaturePy>::`scalar deleting destructor'(void)+0x2c
000000ee`bbef4eb0 00000000`1e182b0e FreeCADBase_d!Base::PyObjectBase::PyDestructor(struct _object * P = 0x00000212`39d6c3b8)+0x70 [t:\_vt\dev\pc\qt\freecad\freecad-ellipse\src\base\pyobjectbase.h @ 193]
000000ee`bbef4f00 00007fff`c1fd80a6 python27_d!_Py_Dealloc(struct _object * op = 0x00000212`39d6c3b8)+0x2e [e:\clbundler\workspace\build_vc12_x64\python-2.7.8\objects\object.c @ 2263]
000000ee`bbef4f40 00007fff`c1fd3f1c FreeCADBase_d!Py::_XDECREF(struct _object * op = 0x00000212`39d6c3b8)+0x96 [t:\_vt\dev\pc\qt\freecad\freecad-ellipse\src\cxx\indirectpythoninterface.cxx @ 564]
000000ee`bbef4f80 00007fff`c1fc38f7 FreeCADBase_d!Py::Object::release(void)+0x2c [t:\_vt\dev\pc\qt\freecad\freecad-ellipse\src\cxx\python2\objects.hxx @ 173]
000000ee`bbef4fb0 00007fff`ab3bf47c FreeCADBase_d!Py::Object::~Object(void)+0x37 [t:\_vt\dev\pc\qt\freecad\freecad-ellipse\src\cxx\python2\objects.hxx @ 216]
000000ee`bbef4fe0 00007fff`ab463954 FreeCADApp_d!App::DocumentObject::~DocumentObject(void)+0x10c [t:\_vt\dev\pc\qt\freecad\freecad-ellipse\src\app\documentobject.cpp @ 72]
000000ee`bbef5030 00007fff`a74e3055 FreeCADApp_d!App::GeoFeature::~GeoFeature(void)+0x54 [t:\_vt\dev\pc\qt\freecad\freecad-ellipse\src\app\geofeature.cpp @ 48]
000000ee`bbef5070 00007fff`a74ea6df Part_d!Part::Feature::~Feature(void)+0x55 [t:\_vt\dev\pc\qt\freecad\freecad-ellipse\src\mod\part\app\partfeature.cpp @ 73]
000000ee`bbef50b0 00007fff`a74ebb4d Part_d!App::FeaturePythonT<Part::Feature>::~FeaturePythonT<Part::Feature>(void)+0xdf [t:\_vt\dev\pc\qt\freecad\freecad-ellipse\src\app\featurepython.h @ 77]
000000ee`bbef5120 00007fff`ab291a73 Part_d!App::FeaturePythonT<Part::Feature>::`vector deleting destructor'(void)+0x7d
000000ee`bbef5150 00007fff`ab35c44d FreeCADApp_d!App::Document::~Document(void)+0x1a3 [t:\_vt\dev\pc\qt\freecad\freecad-ellipse\src\app\document.cpp @ 1074]
000000ee`bbef52a0 00007fff`ab58d544 FreeCADApp_d!App::Document::`vector deleting destructor'(void)+0x7d
000000ee`bbef52d0 00007fff`ab5881b3 FreeCADApp_d!std::default_delete<App::Document>::operator()(class App::Document * _Ptr = 0x00000212`33bd4150)+0x54 [c:\qt\msvc12rip\vc\include\memory @ 1200]
000000ee`bbef5320 00007fff`ab5551c5 FreeCADApp_d!std::unique_ptr<App::Document,std::default_delete<App::Document> >::~unique_ptr<App::Document,std::default_delete<App::Document> >(void)+0x43 [c:\qt\msvc12rip\vc\include\memory @ 1449]
*** WARNING: Unable to verify checksum for T:\_vt\dev\PC\Qt\FreeCAD\build-debug\bin\FreeCADGui_d.dll
000000ee`bbef5350 00007fff`ab9cb469 FreeCADApp_d!App::Application::closeDocument(char * name = 0x00000212`3383ea78 "???")+0x1f5 [t:\_vt\dev\pc\qt\freecad\freecad-ellipse\src\app\application.cpp @ 382]
000000ee`bbef5480 00007fff`ac09f84b FreeCADGui_d!Gui::Application::tryClose(class QCloseEvent * e = 0x000000ee`bbef6bb8)+0x4c9 [t:\_vt\dev\pc\qt\freecad\freecad-ellipse\src\gui\application.cpp @ 912]
*** WARNING: Unable to verify checksum for T:\_vt\dev\PC\Qt\FreeCAD\build-debug\bin\QtGuid4.dll
*** ERROR: Symbol file could not be found.  Defaulted to export symbols for T:\_vt\dev\PC\Qt\FreeCAD\build-debug\bin\QtGuid4.dll - 
000000ee`bbef5690 00000000`625cdd42 FreeCADGui_d!Gui::MainWindow::closeEvent(class QCloseEvent * e = 0x000000ee`bbef6bb8)+0x5b [t:\_vt\dev\pc\qt\freecad\freecad-ellipse\src\gui\mainwindow.cpp @ 964]
000000ee`bbef5880 00000000`62c712eb QtGuid4!QAbstractItemView::qt_metacast+0xec958
000000ee`bbef5c00 00007fff`ac0a0785 QtGuid4!QAbstractItemView::qt_metacast+0x78ff01
000000ee`bbef5cf0 00000000`6252bbf6 FreeCADGui_d!Gui::MainWindow::event(class QEvent * e = 0x000000ee`bbef6bb8)+0x6b5 [t:\_vt\dev\pc\qt\freecad\freecad-ellipse\src\gui\mainwindow.cpp @ 636]
000000ee`bbef5f50 00000000`62528fdc QtGuid4!QAbstractItemView::qt_metacast+0x4a80c
000000ee`bbef5fa0 00007fff`abb086c2 QtGuid4!QAbstractItemView::qt_metacast+0x47bf2
000000ee`bbef6720 00000000`6217a1ca FreeCADGui_d!Gui::GUIApplication::notify(class QObject * receiver = 0x000000ee`bbefd9a8, class QEvent * event = 0x000000ee`bbef6bb8)+0x142 [t:\_vt\dev\pc\qt\freecad\freecad-ellipse\src\gui\guiapplication.cpp @ 91]
000000ee`bbef6ab0 00000000`62243a6c QtCored4!QBuffer::qt_static_metacall+0x2496a3
000000ee`bbef6b20 00000000`625d76d8 QtCored4!QBuffer::qt_static_metacall+0x312f45
000000ee`bbef6b60 00000000`62619ba5 QtGuid4!QAbstractItemView::qt_metacast+0xf62ee
000000ee`bbef6bf0 00000000`626152c9 QtGuid4!QAbstractItemView::qt_metacast+0x1387bb
*** ERROR: Symbol file could not be found.  Defaulted to export symbols for C:\WINDOWS\System32\USER32.dll - 
000000ee`bbef6c20 00007fff`e5c91c24 QtGuid4!QAbstractItemView::qt_metacast+0x133edf
000000ee`bbef7760 00007fff`e5c91917 USER32!CallWindowProcW+0x4f4
000000ee`bbef78c0 00007fff`e5ca2563 USER32!CallWindowProcW+0x1e7
000000ee`bbef7920 00007fff`e6499c54 USER32!MapWindowPoints+0x533
000000ee`bbef7980 00007fff`e28e1184 ntdll!KiUserCallbackDispatcher+0x24
*** ERROR: Symbol file could not be found.  Defaulted to export symbols for C:\WINDOWS\System32\win32u.dll - 
000000ee`bbef7a08 00007fff`e5c8ee4d win32u!NtUserMessageCall+0x14
000000ee`bbef7a10 00007fff`e5c8e982 USER32!GetWindowTextW+0x88d
*** ERROR: Symbol file could not be found.  Defaulted to export symbols for C:\WINDOWS\system32\uxtheme.dll - 
000000ee`bbef7b00 00007fff`e0ffc5ea USER32!GetWindowTextW+0x3c2
000000ee`bbef7b40 00007fff`e0ffc262 uxtheme!IsThemeActive+0xe5a
000000ee`bbef7b80 00007fff`e0ff1e15 uxtheme!IsThemeActive+0xad2
000000ee`bbef7bb0 00007fff`e0ff06d1 uxtheme!DrawThemeBackground+0x5b45
000000ee`bbef7d20 00007fff`e5c8eb7d uxtheme!DrawThemeBackground+0x4401
000000ee`bbef7d60 00000000`62f40158 USER32!GetWindowTextW+0x5bd
000000ee`bbef7dd0 00000000`62617094 QtGuid4!QAbstractItemView::qt_metacast+0xa5ed6e
000000ee`bbef7e20 00007fff`e5c91c24 QtGuid4!QAbstractItemView::qt_metacast+0x135caa
000000ee`bbef8960 00007fff`e5c91917 USER32!CallWindowProcW+0x4f4
000000ee`bbef8ac0 00007fff`e5ca2563 USER32!CallWindowProcW+0x1e7
000000ee`bbef8b20 00007fff`e6499c54 USER32!MapWindowPoints+0x533
000000ee`bbef8b80 00007fff`e28e1184 ntdll!KiUserCallbackDispatcher+0x24
000000ee`bbef8c08 00007fff`e5c8ee4d win32u!NtUserMessageCall+0x14
000000ee`bbef8c10 00007fff`e5c8e982 USER32!GetWindowTextW+0x88d
000000ee`bbef8d00 00007fff`e0ffc5ea USER32!GetWindowTextW+0x3c2
000000ee`bbef8d40 00007fff`e0ffc207 uxtheme!IsThemeActive+0xe5a
000000ee`bbef8d80 00007fff`e0ff1e15 uxtheme!IsThemeActive+0xa77
000000ee`bbef8dc0 00007fff`e0ff06d1 uxtheme!DrawThemeBackground+0x5b45
000000ee`bbef8f30 00007fff`e5c8eb7d uxtheme!DrawThemeBackground+0x4401
000000ee`bbef8f70 00000000`62f40158 USER32!GetWindowTextW+0x5bd
000000ee`bbef8fe0 00000000`62617094 QtGuid4!QAbstractItemView::qt_metacast+0xa5ed6e
000000ee`bbef9030 00007fff`e5c91c24 QtGuid4!QAbstractItemView::qt_metacast+0x135caa
000000ee`bbef9b70 00007fff`e5c9156c USER32!CallWindowProcW+0x4f4
000000ee`bbef9cd0 00000000`621ceef8 USER32!DispatchMessageW+0x1bc
000000ee`bbef9d50 00000000`6261c875 QtCored4!QBuffer::qt_static_metacall+0x29e3d1
000000ee`bbefd0f0 00000000`62175f24 QtGuid4!QAbstractItemView::qt_metacast+0x13b48b
000000ee`bbefd130 00000000`62176207 QtCored4!QBuffer::qt_static_metacall+0x2453fd
000000ee`bbefd190 00000000`6217824c QtCored4!QBuffer::qt_static_metacall+0x2456e0
000000ee`bbefd240 00000000`625261c8 QtCored4!QBuffer::qt_static_metacall+0x247725
000000ee`bbefd2b0 00007fff`ab9cadc7 QtGuid4!QAbstractItemView::qt_metacast+0x44dde
*** WARNING: Unable to verify checksum for FreeCAD_d.exe
000000ee`bbefd2e0 00007ff7`53f035ca FreeCADGui_d!Gui::Application::runApplication(void)+0x24c7 [t:\_vt\dev\pc\qt\freecad\freecad-ellipse\src\gui\application.cpp @ 1738]
000000ee`bbefe9c0 00007ff7`53f132d1 FreeCAD_d!main(int argc = 0n1, char ** argv = 0x00000212`2b995630)+0x9aa [t:\_vt\dev\pc\qt\freecad\freecad-ellipse\src\main\maingui.cpp @ 238]
000000ee`bbeff780 00007ff7`53f11391 FreeCAD_d!WinMain+0xb1
000000ee`bbeff7f0 00007ff7`53f1110e FreeCAD_d!__tmainCRTStartup(void)+0x271 [f:\dd\vctools\crt\crtw32\dllstuff\crtexe.c @ 618]
*** ERROR: Symbol file could not be found.  Defaulted to export symbols for C:\WINDOWS\System32\KERNEL32.DLL - 
000000ee`bbeff870 00007fff`e6348364 FreeCAD_d!WinMainCRTStartup(void)+0xe [f:\dd\vctools\crt\crtw32\dllstuff\crtexe.c @ 466]
000000ee`bbeff8a0 00007fff`e64570d1 KERNEL32!BaseThreadInitThunk+0x14
000000ee`bbeff8d0 00000000`00000000 ntdll!RtlUserThreadStart+0x21

   1  Id: 345c.a7c Suspend: 1 Teb: 000000ee`bbd08000 Unfrozen
Child-SP          RetAddr           Call Site
000000ee`bbfff408 00007fff`e642352e ntdll!NtWaitForWorkViaWorkerFactory+0x14
000000ee`bbfff410 00007fff`e6348364 ntdll!RtlReleaseSRWLockExclusive+0x1ade
000000ee`bbfff810 00007fff`e64570d1 KERNEL32!BaseThreadInitThunk+0x14
000000ee`bbfff840 00000000`00000000 ntdll!RtlUserThreadStart+0x21

   2  Id: 345c.3ad8 Suspend: 1 Teb: 000000ee`bbd0a000 Unfrozen
Child-SP          RetAddr           Call Site
000000ee`bc0ff408 00007fff`e642352e ntdll!NtWaitForWorkViaWorkerFactory+0x14
000000ee`bc0ff410 00007fff`e6348364 ntdll!RtlReleaseSRWLockExclusive+0x1ade
000000ee`bc0ff810 00007fff`e64570d1 KERNEL32!BaseThreadInitThunk+0x14
000000ee`bc0ff840 00000000`00000000 ntdll!RtlUserThreadStart+0x21

   3  Id: 345c.3e24 Suspend: 1 Teb: 000000ee`bbd0c000 Unfrozen
Child-SP          RetAddr           Call Site
000000ee`bc1ff708 00007fff`e642352e ntdll!NtWaitForWorkViaWorkerFactory+0x14
000000ee`bc1ff710 00007fff`e6348364 ntdll!RtlReleaseSRWLockExclusive+0x1ade
000000ee`bc1ffb10 00007fff`e64570d1 KERNEL32!BaseThreadInitThunk+0x14
000000ee`bc1ffb40 00000000`00000000 ntdll!RtlUserThreadStart+0x21

   4  Id: 345c.a9c Suspend: 1 Teb: 000000ee`bbd0e000 Unfrozen "QThread"
Child-SP          RetAddr           Call Site
000000ee`bc2fc348 00007fff`e294c2cf ntdll!ZwWaitForMultipleObjects+0x14
000000ee`bc2fc350 00007fff`e5c9e1fb KERNELBASE!WaitForMultipleObjectsEx+0xef
000000ee`bc2fc650 00000000`621cf071 USER32!MsgWaitForMultipleObjectsEx+0x15b
000000ee`bc2fc730 00000000`62175f24 QtCored4!QBuffer::qt_static_metacall+0x29e54a
000000ee`bc2ffad0 00000000`62176207 QtCored4!QBuffer::qt_static_metacall+0x2453fd
000000ee`bc2ffb30 00000000`61f9e395 QtCored4!QBuffer::qt_static_metacall+0x2456e0
000000ee`bc2ffbe0 00000000`61f9e2c3 QtCored4!QBuffer::qt_static_metacall+0x6d86e
000000ee`bc2ffc60 00000000`61fa404f QtCored4!QBuffer::qt_static_metacall+0x6d79c
000000ee`bc2ffc90 00007fff`c6daa105 QtCored4!QBuffer::qt_static_metacall+0x73528
000000ee`bc2ffd10 00007fff`c6daa357 MSVCR120D!_callthreadstartex(void)+0x25 [f:\dd\vctools\crt\crtw32\startup\threadex.c @ 376]
000000ee`bc2ffd60 00007fff`e6348364 MSVCR120D!_threadstartex(void * ptd = 0x00000212`2e0e0270)+0xe7 [f:\dd\vctools\crt\crtw32\startup\threadex.c @ 359]
000000ee`bc2ffda0 00007fff`e64570d1 KERNEL32!BaseThreadInitThunk+0x14
000000ee`bc2ffdd0 00000000`00000000 ntdll!RtlUserThreadStart+0x21

   5  Id: 345c.1ddc Suspend: 1 Teb: 000000ee`bbd28000 Unfrozen
Child-SP          RetAddr           Call Site
000000ee`bcfffb28 00007fff`e08328c0 ntdll!ZwWaitForMultipleObjects+0x14
000000ee`bcfffb30 00007fff`e6348364 WINMM!PlaySoundW+0xfc0
000000ee`bcfffcb0 00007fff`e64570d1 KERNEL32!BaseThreadInitThunk+0x14
000000ee`bcfffce0 00000000`00000000 ntdll!RtlUserThreadStart+0x21

   6  Id: 345c.3830 Suspend: 1 Teb: 000000ee`bbd2a000 Unfrozen
Child-SP          RetAddr           Call Site
000000ee`bd0ff7a8 00007fff`e642352e ntdll!NtWaitForWorkViaWorkerFactory+0x14
000000ee`bd0ff7b0 00007fff`e6348364 ntdll!RtlReleaseSRWLockExclusive+0x1ade
000000ee`bd0ffbb0 00007fff`e64570d1 KERNEL32!BaseThreadInitThunk+0x14
000000ee`bd0ffbe0 00000000`00000000 ntdll!RtlUserThreadStart+0x21

   7  Id: 345c.22f4 Suspend: 1 Teb: 000000ee`bbd2c000 Unfrozen
Child-SP          RetAddr           Call Site
000000ee`bd1ff7e8 00007fff`e642352e ntdll!NtWaitForWorkViaWorkerFactory+0x14
000000ee`bd1ff7f0 00007fff`e6348364 ntdll!RtlReleaseSRWLockExclusive+0x1ade
000000ee`bd1ffbf0 00007fff`e64570d1 KERNEL32!BaseThreadInitThunk+0x14
000000ee`bd1ffc20 00000000`00000000 ntdll!RtlUserThreadStart+0x21

   8  Id: 345c.6c0 Suspend: 1 Teb: 000000ee`bbd2e000 Unfrozen
Child-SP          RetAddr           Call Site
000000ee`bd2ff1e8 00007fff`e294c2cf ntdll!ZwWaitForMultipleObjects+0x14
*** ERROR: Symbol file could not be found.  Defaulted to export symbols for C:\WINDOWS\System32\combase.dll - 
000000ee`bd2ff1f0 00007fff`e5f347c3 KERNELBASE!WaitForMultipleObjectsEx+0xef
000000ee`bd2ff4f0 00007fff`e5f65550 combase!CoUnmarshalInterface+0x3f3
000000ee`bd2ff780 00007fff`e5f34691 combase!GetHGlobalFromStream+0x250
000000ee`bd2ff7d0 00007fff`e5f65f8c combase!CoUnmarshalInterface+0x2c1
000000ee`bd2ff830 00007fff`e6348364 combase!IsErrorPropagationEnabled+0x87c
000000ee`bd2ff860 00007fff`e64570d1 KERNEL32!BaseThreadInitThunk+0x14
000000ee`bd2ff890 00000000`00000000 ntdll!RtlUserThreadStart+0x21

   9  Id: 345c.39ac Suspend: 1 Teb: 000000ee`bbd32000 Unfrozen
Child-SP          RetAddr           Call Site
000000ee`bd4ff7b8 00007fff`e642352e ntdll!NtWaitForWorkViaWorkerFactory+0x14
000000ee`bd4ff7c0 00007fff`e6348364 ntdll!RtlReleaseSRWLockExclusive+0x1ade
000000ee`bd4ffbc0 00007fff`e64570d1 KERNEL32!BaseThreadInitThunk+0x14
000000ee`bd4ffbf0 00000000`00000000 ntdll!RtlUserThreadStart+0x21

  10  Id: 345c.1c44 Suspend: 1 Teb: 000000ee`bbd34000 Unfrozen
Child-SP          RetAddr           Call Site
000000ee`bd5ff488 00007fff`e642352e ntdll!NtWaitForWorkViaWorkerFactory+0x14
000000ee`bd5ff490 00007fff`e6348364 ntdll!RtlReleaseSRWLockExclusive+0x1ade
000000ee`bd5ff890 00007fff`e64570d1 KERNEL32!BaseThreadInitThunk+0x14
000000ee`bd5ff8c0 00000000`00000000 ntdll!RtlUserThreadStart+0x21

  11  Id: 345c.413c Suspend: 1 Teb: 000000ee`bbd30000 Unfrozen
Child-SP          RetAddr           Call Site
000000ee`bd3ff638 00007fff`e642352e ntdll!NtWaitForWorkViaWorkerFactory+0x14
000000ee`bd3ff640 00007fff`e6348364 ntdll!RtlReleaseSRWLockExclusive+0x1ade
000000ee`bd3ffa40 00007fff`e64570d1 KERNEL32!BaseThreadInitThunk+0x14
000000ee`bd3ffa70 00000000`00000000 ntdll!RtlUserThreadStart+0x21

  12  Id: 345c.408 Suspend: 1 Teb: 000000ee`bbd36000 Unfrozen
Child-SP          RetAddr           Call Site
000000ee`bd6ff9e8 00007fff`e642352e ntdll!NtWaitForWorkViaWorkerFactory+0x14
000000ee`bd6ff9f0 00007fff`e6348364 ntdll!RtlReleaseSRWLockExclusive+0x1ade
000000ee`bd6ffdf0 00007fff`e64570d1 KERNEL32!BaseThreadInitThunk+0x14
000000ee`bd6ffe20 00000000`00000000 ntdll!RtlUserThreadStart+0x21			
User avatar
DeepSOIC
Posts: 6639
Joined: Fri Aug 29, 2014 12:45 am
Location: Saint-Petersburg, Russia

Re: FreeCAD crash upon close (Attacher/extension/python related)

Postby DeepSOIC » Wed Jan 18, 2017 3:17 pm

Getting stranger. I tried commenting out the addition of AttachExtensionPython to Clone, and now I get a straight crash when creating clone... because positionBySupport is called somehow! :shock:

I can't find the reason why the clone has positionBySupport method, even though no extension is added to it.
User avatar
DeepSOIC
Posts: 6639
Joined: Fri Aug 29, 2014 12:45 am
Location: Saint-Petersburg, Russia

Re: FreeCAD crash upon close (Attacher/extension/python related)

Postby DeepSOIC » Wed Jan 18, 2017 3:44 pm

The reason of crsah seems to be much deeper than I thought.
I narrowed it down a little bit:

Code: Select all

import Part
if not App.ActiveDocument:
    App.newDocument()

App.ActiveDocument.addObject("Part::Box","box")
f = App.ActiveDocument.addObject( "Part::FeaturePython", "test")
f.positionBySupport() #Should be: "f has no attribute 'positionBySupport'". Result: crash.
User avatar
DeepSOIC
Posts: 6639
Joined: Fri Aug 29, 2014 12:45 am
Location: Saint-Petersburg, Russia

Re: FreeCAD crash upon close (Attacher/extension/python related)

Postby DeepSOIC » Wed Jan 18, 2017 4:13 pm

:oops: Should have done a clean build before reporting. Rebuilding now to see...
User avatar
DeepSOIC
Posts: 6639
Joined: Fri Aug 29, 2014 12:45 am
Location: Saint-Petersburg, Russia

Re: FreeCAD crash upon close (Attacher/extension/python related)

Postby DeepSOIC » Wed Jan 18, 2017 5:36 pm

Problem comfirmed in a clean build.
User avatar
bejant
Posts: 5712
Joined: Thu Jul 11, 2013 3:06 pm

Re: FreeCAD crash upon close (Attacher/extension/python related)

Postby bejant » Wed Jan 18, 2017 7:22 pm

DeepSOIC wrote:3. Close FreeCAD by clicking X button on window.
On the the tab at the bottom of the 3D view? If yes:
DeepSOIC wrote:In save pop-up dialog, click Discard
For me the button reads Close without Saving.

If I followed your steps correctly, no problem here using

OS: Ubuntu 16.04.1 LTS
Word size of OS: 32-bit
Word size of FreeCAD: 32-bit
Version: 0.17.9613 (Git)
Build type: None
Branch: master
Hash: 0c34f1b749fbb116058caa54754961c6dcb4f92a
Python version: 2.7.12
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 6.8.0.oce-0.17
User avatar
DeepSOIC
Posts: 6639
Joined: Fri Aug 29, 2014 12:45 am
Location: Saint-Petersburg, Russia

Re: FreeCAD crash upon close (Attacher/extension/python related)

Postby DeepSOIC » Wed Jan 18, 2017 7:30 pm

bejant wrote:
DeepSOIC wrote:3. Close FreeCAD by clicking X button on window.
On the the tab at the bottom of the 3D view? If yes:
No, I meant you should close whole FreeCAD.

Have you tried the console snippet?
User avatar
bejant
Posts: 5712
Joined: Thu Jul 11, 2013 3:06 pm

Re: FreeCAD crash upon close (Attacher/extension/python related)

Postby bejant » Wed Jan 18, 2017 7:45 pm

DeepSOIC wrote:No, I meant you should close whole FreeCAD.
I tried that before I posted last time and no problem that way either.
DeepSOIC wrote:Have you tried the console snippet?
This:

Code: Select all

import Part
if not App.ActiveDocument:
    App.newDocument()

App.ActiveDocument.addObject("Part::Box","box")
f = App.ActiveDocument.addObject( "Part::FeaturePython", "test")
f.positionBySupport() #Should be: "f has no attribute 'positionBySupport'". Result: crash.
crashed FreeCAD if I press Enter after running the code. No crash if I run the snippet and click on the Recompute button afterwards, instead of hitting the Enter key.