brep export without extension crashes FreeCAD

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!
Post Reply
surfin_eddie
Posts: 39
Joined: Tue Nov 13, 2012 11:39 pm
Location: Leipzig
Contact:

brep export without extension crashes FreeCAD

Post by surfin_eddie »

In my v0.13-2041git the crash occurs if I start a new file; choose "Part" Workbench (or PartDesign); create (p.e.) a cube without any change; set the view axometric;
mark / activate box -> File/export -> choose "BREP Format (*.brep *.brp)" -> give any name without the ".brep" file suffix -> FreeCAD crashes.

I'm not shure if I've always tried to save without "file-extension" (respective have forgotten it) or if the crash also sometimes occurs even with full name given. As described it's reproducable.

If I try to save a new export with a new name without extension after a successful first try with extension in the same session with the same file and the same object no crash occurs.

In mantis I haven't found a relevant bug.

I've also tried a forum search for the topic, but I just got the message
The following words in your search query were ignored because they are too common words: brep crash export.
You must specify at least one word to search for. Each word must consist of at least 3 characters and must not contain more than 14 characters excluding wildcards.
This message appears often at my searches. If I'm wrong with my search any hints are welcome.

Thanks and best regards,

Ralf
wmayer
Founder
Posts: 20319
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: brep export without extension crashes FreeCAD

Post by wmayer »

What is your OS?
surfin_eddie
Posts: 39
Joined: Tue Nov 13, 2012 11:39 pm
Location: Leipzig
Contact:

Re: brep export without extension crashes FreeCAD

Post by surfin_eddie »

This one is Debian GNU/Linux , 6.0.7 is /etc/debian_version; Kernel used for this is 2.6.35.13 compiled for this box (Intel Pentium Mobile 4 2 GHz
wmayer
Founder
Posts: 20319
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: brep export without extension crashes FreeCAD

Post by wmayer »

Can you run this in the debugger to get the stack trace, please? I tried it with several versions under different OSes but didn't get a crash.
surfin_eddie
Posts: 39
Joined: Tue Nov 13, 2012 11:39 pm
Location: Leipzig
Contact:

Re: brep export without extension crashes FreeCAD

Post by surfin_eddie »

hopefully this is what you can use:

(gdb) run
Starting program: /usr/local/freecad/bin/FreeCAD
[Thread debugging using libthread_db enabled]
FreeCAD 0.13, Libs: 0.13R1695 (Git)
© Juergen Riegel, Werner Mayer, Yorik van Havre 2001-2011
##### #### ### ####
# # # # # #
# ## #### #### # # # # #
#### # # # # # # # ##### # #
# # #### #### # # # # #
# # # # # # # # # ## ## ##
# # #### #### ### # # #### ## ## ##

[New Thread 0xb07c5b70 (LWP 6788)]
matplotlib not found, Plot module will be disabled
pycollada not found, collada support will be disabled.
[New Thread 0xab67ab70 (LWP 6789)]
[New Thread 0xa7022b70 (LWP 6790)]
[New Thread 0xa6821b70 (LWP 6791)]
[New Thread 0xa457db70 (LWP 6796)]
[New Thread 0xa3d7cb70 (LWP 6797)]
[Thread 0xa457db70 (LWP 6796) exited]
[New Thread 0xa457db70 (LWP 6798)]
terminate called after throwing an instance of 'Base::Exception'

Program received signal SIGABRT, Aborted.
0xb7fe1424 in __kernel_vsyscall ()

gdb - command "bt" gives:


#0 0xb7fe1424 in __kernel_vsyscall ()
#1 0xb399b941 in raise () from /lib/i386-linux-gnu/i686/cmov/libc.so.6
#2 0xb399ed72 in abort () from /lib/i386-linux-gnu/i686/cmov/libc.so.6
#3 0xb3b6928d in __gnu_cxx::__verbose_terminate_handler() () from /usr/lib/i386-linux-gnu/libstdc++.so.6
#4 0xb3b66ef3 in ?? () from /usr/lib/i386-linux-gnu/libstdc++.so.6
#5 0xb3b66f2f in std::terminate() () from /usr/lib/i386-linux-gnu/libstdc++.so.6
#6 0xb3b671ce in __cxa_throw () from /usr/lib/i386-linux-gnu/libstdc++.so.6
#7 0xae5a7b8d in Part::TopoShape::write(char const*) const () from /usr/local/freecad/Mod/Part/Part.so
#8 0xae57e836 in exporter(_object*, _object*) () from /usr/local/freecad/Mod/Part/Part.so
#9 0xb6f8e6f2 in PyCFunction_Call () from /usr/lib/libpython2.6.so.1.0
#10 0xb6feed18 in PyEval_EvalFrameEx () from /usr/lib/libpython2.6.so.1.0
#11 0xb6ff060d in PyEval_EvalCodeEx () from /usr/lib/libpython2.6.so.1.0
#12 0xb6ff0723 in PyEval_EvalCode () from /usr/lib/libpython2.6.so.1.0
#13 0xb700db1e in PyRun_StringFlags () from /usr/lib/libpython2.6.so.1.0
#14 0xb726aba4 in Base::InterpreterSingleton::runString(char const*) () from /usr/local/freecad/lib/libFreeCADBase.so
#15 0xb78b9751 in Gui::Application::runPythonCode(char const*, bool, bool) () from /usr/local/freecad/lib/libFreeCADGui.so
#16 0xb78b489a in Gui::Application::exportTo(char const*, char const*, char const*) () from /usr/local/freecad/lib/libFreeCADGui.so
#17 0xb7932f34 in StdCmdExport::activated(int) () from /usr/local/freecad/lib/libFreeCADGui.so
#18 0xb792a7da in Gui::Command::invoke(int) () from /usr/local/freecad/lib/libFreeCADGui.so
#19 0xb79204e2 in Gui::Action::onActivated() () from /usr/local/freecad/lib/libFreeCADGui.so
#20 0xb79268ba in Gui::Action::qt_metacall(QMetaObject::Call, int, void**) () from /usr/local/freecad/lib/libFreeCADGui.so
#21 0xb3f607aa in QMetaObject::metacall(QObject*, QMetaObject::Call, int, void**) () from /usr/lib/libQtCore.so.4
#22 0xb3f6f1bb in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) () from /usr/lib/libQtCore.so.4
#23 0xb474fcc9 in QAction::triggered(bool) () from /usr/lib/libQtGui.so.4
#24 0xb4751ebc in QAction::activate(QAction::ActionEvent) () from /usr/lib/libQtGui.so.4
#25 0xb4bf30ff in ?? () from /usr/lib/libQtGui.so.4
#26 0xb4bf95ab in ?? () from /usr/lib/libQtGui.so.4
#27 0xb4bfa5f7 in QMenu::mouseReleaseEvent(QMouseEvent*) () from /usr/lib/libQtGui.so.4
#28 0xb47b47c8 in QWidget::event(QEvent*) () from /usr/lib/libQtGui.so.4
#29 0xb4bfbbfc in QMenu::event(QEvent*) () from /usr/lib/libQtGui.so.4
#30 0xb47565cc in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /usr/lib/libQtGui.so.4
#31 0xb475daf7 in QApplication::notify(QObject*, QEvent*) () from /usr/lib/libQtGui.so.4
#32 0xb78bf0d2 in Gui::GUIApplication::notify(QObject*, QEvent*) () from /usr/local/freecad/lib/libFreeCADGui.so
#33 0xb3f5b4cb in QCoreApplication::notifyInternal(QObject*, QEvent*) () from /usr/lib/libQtCore.so.4
#34 0xb475ca52 in QApplicationPrivate::sendMouseEvent(QWidget*, QMouseEvent*, QWidget*, QWidget*, QWidget**, QPointer<QWidget>&, bool) ()
from /usr/lib/libQtGui.so.4
#35 0xb47e8268 in ?? () from /usr/lib/libQtGui.so.4
#36 0xb47e7253 in QApplication::x11ProcessEvent(_XEvent*) () from /usr/lib/libQtGui.so.4
#37 0xb4815372 in ?? () from /usr/lib/libQtGui.so.4
#38 0xb2225305 in g_main_dispatch (context=0x813d8c0) at /build/buildd-glib2.0_2.24.2-1-i386-AScyie/glib2.0-2.24.2/glib/gmain.c:1960
#39 IA__g_main_context_dispatch (context=0x813d8c0) at /build/buildd-glib2.0_2.24.2-1-i386-AScyie/glib2.0-2.24.2/glib/gmain.c:2513
#40 0xb2228fe8 in g_main_context_iterate (context=0x813d8c0, block=<value optimized out>, dispatch=1, self=0x8117ea0)
at /build/buildd-glib2.0_2.24.2-1-i386-AScyie/glib2.0-2.24.2/glib/gmain.c:2591
#41 0xb22291c8 in IA__g_main_context_iteration (context=0x813d8c0, may_block=1)
at /build/buildd-glib2.0_2.24.2-1-i386-AScyie/glib2.0-2.24.2/glib/gmain.c:2654
#42 0xb3f87075 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#43 0xb4814ed5 in ?? () from /usr/lib/libQtGui.so.4
#44 0xb3f59ae9 in QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#45 0xb3f59f3a in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#46 0xb3f5f16f in QCoreApplication::exec() () from /usr/lib/libQtCore.so.4
#47 0xb4756667 in QApplication::exec() () from /usr/lib/libQtGui.so.4
#48 0xb78bb3f3 in Gui::Application::runApplication() () from /usr/local/freecad/lib/libFreeCADGui.so
#49 0x080503d4 in main ()




I was only able to run the gdb on this box: Debian GNU/Linux 6.06, Kernel 2.6.32-5 ; FreeCAD 0.13-1695 (Git)

FreeCAD was not respondig after the tried brep -export as described, rests of the FreeCAD window was still visible. The gdb output is above. If you need something different - I'm not familar with the gdb, I would need to know which command(s) to run.

Best Regards,

Ralf
wmayer
Founder
Posts: 20319
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: brep export without extension crashes FreeCAD

Post by wmayer »

hopefully this is what you can use:
Yes, this was very helpful. The point is that inside TopoShape::write() an exception is thrown if the file name has an unsupported extension (an empty extension is considered as unsupported). However, this exception wasn't handled in the calling instance. And the next calling instance is inside the Python runtime library and apparently under Linux the Python runtime doesn't forward the exception to next level of the call stack. So, this way the OS assumes that there is an unhandled exception and thus terminates the application.

However, this bug has been fixed for a few weeks in the 0.14 branch.
surfin_eddie
Posts: 39
Joined: Tue Nov 13, 2012 11:39 pm
Location: Leipzig
Contact:

Re: brep export without extension crashes FreeCAD

Post by surfin_eddie »

The explaination I don't really understand, but while saving "brep" with extension is possible it is not a very grave problem. I'm waiting curious for the 0.14 :)

Thanks, Ralf
Post Reply