To start remote debugging go to File > Attach of the running winpdb application and enter the requested password. At the top of the script add
Code: Select all
import rpdb2
rpdb2.start_embedded_debugger(password)
Code: Select all
import rpdb2
rpdb2.start_embedded_debugger(password)
This is curiousWorkplane comes somewhere from the Draft module. But you said you get a crash. Is it really a crash, i.e. you get a segmentation fault or something similar or is only an exception raised but FreeCAD is still working?
Code: Select all
#test.py
#this is a test routine to get run freecad entirely from the eric4 ide
import sys
# This is the standard location for the libraries in ubuntu.
#sys.path.append("/usr/lib/freecad/lib/")
#jonas thomas has his debug libraries here.
sys.path.append("/home/jonas/freecad/qtcreator-build/lib/")
# jrheinlaender has his debug libary here.
#sys.path.append(".../freecad-build-dbg/lib")
import FreeCADGui
FreeCADGui.showMainWindow()
FreeCADGui.exec_loop()
Code: Select all
jonas@jonas-laptop:~/freecad$ cd teststuff
jonas@jonas-laptop:~/freecad/teststuff$ ls
test.py
jonas@jonas-laptop:~/freecad/teststuff$ gdb python
GNU gdb (GDB) 7.1-ubuntu
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /usr/bin/python...(no debugging symbols found)...done.
(gdb) r test.py
Starting program: /usr/bin/python test.py
[Thread debugging using libthread_db enabled]
FreeCAD 0.13, Libs: 0.13R1801 (Git)
Attach observer 0xc3a620
Attach observer 0xc46290
Attach observer 0xcae210
Attach observer 0xc67258
Attach observer 0xdb8388
Attach observer 0xdb8388
Attach observer 0xdc5e00
Attach observer 0xde7d80
[New Thread 0x7fffddf91700 (LWP 2100)]
matplotlib not found, Plot module will be disabled
Program received signal SIGSEGV, Segmentation fault.
0x00007fffef0347c4 in __cxa_allocate_exception () from /usr/lib/libstdc++.so.6
(gdb) bt
#0 0x00007fffef0347c4 in __cxa_allocate_exception ()
from /usr/lib/libstdc++.so.6
#1 0x00007ffff5fd0654 in Py::PythonExtension<Gui::OutputStdout>::getattr_methods (this=0xdbde90, _name=0x553043 "softspace")
at /home/jonas/freecad/free-cad/src/CXX/Python2/ExtensionOldType.hxx:173
#2 0x00007ffff5fd01cb in Py::PythonExtension<Gui::OutputStdout>::getattr (
this=0xdbde90, name=0x553043 "softspace")
at /home/jonas/freecad/free-cad/src/CXX/Python2/ExtensionOldType.hxx:69
#3 0x00007ffff5183120 in getattr_handler (self=0xdbde98,
name=0x553043 "softspace")
at /home/jonas/freecad/free-cad/src/CXX/Python2/cxx_extensions.cxx:690
#4 0x000000000043576d in PyFile_SoftSpace ()
#5 0x00000000004a3c6f in PyEval_EvalFrameEx ()
#6 0x00000000004a9811 in PyEval_EvalCodeEx ()
#7 0x00000000004a98e2 in PyEval_EvalCode ()
#8 0x00000000004bc18e in PyImport_ExecCodeModuleEx ()
#9 0x00000000004be0fe in ?? ()
#10 0x00000000004bef33 in ?? ()
#11 0x00000000004bf1af in ?? ()
#12 0x00000000004bf86b in ?? ()
#13 0x00000000004bfdb4 in PyImport_ImportModuleLevel ()
#14 0x00000000004a184b in ?? ()
#15 0x000000000041f227 in PyObject_Call ()
---Type <return> to continue, or q <return> to quit---
#16 0x00000000004a240f in ?? ()
#17 0x00000000004a579c in PyEval_EvalFrameEx ()
#18 0x00000000004a9811 in PyEval_EvalCodeEx ()
#19 0x00000000004a98e2 in PyEval_EvalCode ()
#20 0x00000000004bc18e in PyImport_ExecCodeModuleEx ()
#21 0x00000000004be0fe in ?? ()
#22 0x00000000004bef33 in ?? ()
#23 0x00000000004bf1af in ?? ()
#24 0x00000000004bf86b in ?? ()
#25 0x00000000004bfdb4 in PyImport_ImportModuleLevel ()
#26 0x00000000004a184b in ?? ()
#27 0x000000000041f227 in PyObject_Call ()
#28 0x00000000004a240f in ?? ()
#29 0x00000000004a579c in PyEval_EvalFrameEx ()
#30 0x00000000004a9811 in PyEval_EvalCodeEx ()
#31 0x00000000004a98e2 in PyEval_EvalCode ()
#32 0x00000000004bc18e in PyImport_ExecCodeModuleEx ()
#33 0x00000000004be0fe in ?? ()
#34 0x00000000004bef33 in ?? ()
#35 0x00000000004bf1af in ?? ()
#36 0x00000000004bf86b in ?? ()
#37 0x00000000004bfdb4 in PyImport_ImportModuleLevel ()
#38 0x00000000004a184b in ?? ()
---Type <return> to continue, or q <return> to quit---
#39 0x000000000041f227 in PyObject_Call ()
#40 0x00000000004a240f in ?? ()
#41 0x00000000004a579c in PyEval_EvalFrameEx ()
#42 0x00000000004a9811 in PyEval_EvalCodeEx ()
#43 0x00000000004a98e2 in PyEval_EvalCode ()
#44 0x00000000004bc18e in PyImport_ExecCodeModuleEx ()
#45 0x00000000004be0fe in ?? ()
#46 0x00000000004bef33 in ?? ()
#47 0x00000000004bf1af in ?? ()
#48 0x00000000004bf86b in ?? ()
#49 0x00000000004bfdb4 in PyImport_ImportModuleLevel ()
#50 0x00000000004a184b in ?? ()
#51 0x000000000041f227 in PyObject_Call ()
#52 0x00000000004a240f in ?? ()
#53 0x00000000004a579c in PyEval_EvalFrameEx ()
#54 0x00000000004a9811 in PyEval_EvalCodeEx ()
#55 0x00000000004a98e2 in PyEval_EvalCode ()
#56 0x00000000004c9bae in PyRun_FileExFlags ()
#57 0x00000000004a0dd7 in ?? ()
#58 0x00000000004a7dfe in PyEval_EvalFrameEx ()
#59 0x00000000004a86f0 in PyEval_EvalFrameEx ()
#60 0x00000000004a9811 in PyEval_EvalCodeEx ()
#61 0x00000000004a98e2 in PyEval_EvalCode ()
---Type <return> to continue, or q <return> to quit---
#62 0x00000000004ca62b in PyRun_StringFlags ()
#63 0x00007ffff51b090f in Base::InterpreterSingleton::runString (
this=0x951290,
sCmd=0x7ffff61db760 "# FreeCAD gui init module\n# (c) 2003 J\374rgen Riegel\n#\n# Gathering all the information to start FreeCAD\n# This is the second one of three init scripts, the third one\n# runs when the gui is up\n\n#********"...) at /home/jonas/freecad/free-cad/src/Base/Interpreter.cpp:148
#64 0x00007ffff67b12e6 in setupMainWindow ()
at /home/jonas/freecad/free-cad/src/Main/FreeCADGuiPy.cpp:270
#65 0x00007ffff67b0953 in FreeCADGui_showMainWindow (args=0x7ffff7f8f050)
at /home/jonas/freecad/free-cad/src/Main/FreeCADGuiPy.cpp:119
#66 0x00000000004a7dfe in PyEval_EvalFrameEx ()
#67 0x00000000004a9811 in PyEval_EvalCodeEx ()
#68 0x00000000004a98e2 in PyEval_EvalCode ()
#69 0x00000000004c9bae in PyRun_FileExFlags ()
#70 0x00000000004c9dc4 in PyRun_SimpleFileExFlags ()
#71 0x000000000041a95f in Py_Main ()
#72 0x00007ffff69d4c4d in __libc_start_main () from /lib/libc.so.6
#73 0x0000000000419b39 in _start ()
(gdb)
(gdb)
I get a similar crash when using git version 0ebffa930ac0e68ecfb52e2f1d5d98673df65c22 or older. The strack trace is quite similar but on top it says it's an unhandled exception -- not a segmentation fault. And this also only happens when FreeCAD was built using cmake, using automake everything is fine.So I guess the problem is a segmentation fault.
I'm pretty sure I was already on the current source tree, but I'm going to clean the project, re-run cmake and recompile.. (This is going to take a while.)So, my tip is to update your git source tree and try again...
Code: Select all
jonas@jonas-laptop:~/freecad/free-cad$ git pull origin master
From git://free-cad.git.sourceforge.net/gitroot/free-cad/free-cad
* branch master -> FETCH_HEAD
Already up-to-date.
jonas@jonas-laptop:~/freecad/free-cad$ git checkout master
M src/Mod/Sketcher/Gui/SoDatumLabel.cpp
M src/Mod/Sketcher/Gui/SoDatumLabel.h
Already on 'master'
Your branch is ahead of 'jtGitHubOrigin/master' by 567 commits.
jonas@jonas-laptop:~/freecad/free-cad$
There is a difference between running FreeCAD as application (running from QtCreator or menu or terminal) or as Python extension module. Theoretically, this shouldn't make a difference but it does.The strange thing is when I run from qt-creator I don't crash.
I cleaned, ran cmake, I'm still getting the exact same error same spot.wmayer wrote:There is a difference between running FreeCAD as application (running from QtCreator or menu or terminal) or as Python extension module. Theoretically, this shouldn't make a difference but it does.The strange thing is when I run from qt-creator I don't crash.
And strange is also that the binaries built with automake and cmake don't behave identically.
Code: Select all
[New Thread 0x7fffddf91700 (LWP 11748)]
matplotlib not found, Plot module will be disabled
Program received signal SIGSEGV, Segmentation fault.
0x00007fffef0347c4 in __cxa_allocate_exception () from /usr/lib/libstdc++.so.6
(gdb) bt
#0 0x00007fffef0347c4 in __cxa_allocate_exception ()
from /usr/lib/libstdc++.so.6
#1 0x00007ffff5fd0654 in Py::PythonExtension<Gui::OutputStdout>::getattr_methods (this=0xdbe2f0, _name=0x553043 "softspace")
at /home/jonas/freecad/free-cad/src/CXX/Python2/ExtensionOldType.hxx:173
#2 0x00007ffff5fd01cb in Py::PythonExtension<Gui::OutputStdout>::getattr (
this=0xdbe2f0, name=0x553043 "softspace")
at /home/jonas/freecad/free-cad/src/CXX/Python2/ExtensionOldType.hxx:69
#3 0x00007ffff5183120 in getattr_handler (self=0xdbe2f8,
name=0x553043 "softspace")
at /home/jonas/freecad/free-cad/src/CXX/Python2/cxx_extensions.cxx:690
Code: Select all
#test.py
#this is a test routine to get run freecad entirely from the eric4 ide
import sys
# This is the standard location for the libraries in ubuntu.
#sys.path.append("/usr/lib/freecad/lib/")
#jonas thomas has his debug libraries here.
sys.path.append("/home/jonasthomas/freecad/qtcreator-build/lib/")
# jrheinlaender has his debug libary here.
#sys.path.append(".../freecad-build-dbg/lib")
import FreeCADGui
FreeCADGui.showMainWindow()
sys.path.append("/home/jonasthomas/freecad/FreeCADPyCode/")
import mywidgetold
FreeCADGui.exec_loop()