Help

Having trouble installing or compiling FreeCAD? Get help here.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Ken Cline

Help

Post by Ken Cline »

I'd like to build a FreeCAD executable that doesn't dump core as soon as I click the "new" icon. Any advice? So far no luck on OS X, Ubuntu 9.10, or Ubuntu 10.4. I'm currently trying to follow the build on unix instructions as best as I can.

Thanks
User avatar
jriegel
Founder
Posts: 3369
Joined: Sun Feb 15, 2009 5:29 pm
Location: Ulm, Germany
Contact:

Re: Help

Post by jriegel »

We need a little bit more information in order to help you.... ;-)

FreeCAD normally is running on all these platforms.
For Ubuntu 9.10 you can use the prebuild packages.
For Ubuntu 10.4 is allready a package for FreeCAD in universe.
Just start synaptic and type FreeCad.....

If you really want to compile give us more information, what is the exeption
saying or better the Log file. What do you use to build cMake or autotools?
Stop whining - start coding!
Ken Cline

Re: Help

Post by Ken Cline »

Apt-get install FreeCAD worked on Ubuntu 10.4, but it dumped core. I figured I'd try building a debug version so I could see what was going on in the sources. Following the CompileOnUnix instruction worked without incident, using libxerces-c2-dev and without needing to install python2.5-dev (I assume the build is using 2.6 or 3).

It looks like FreeCAD installed into ~/FreeCAD. When I start FreeCAD, close the tooltips window, and click on the File/New menu item, it crashes. Here's the stack trace (ubuntu 10.4):

Code: Select all

GNU gdb (GDB) 7.0-ubuntu
Copyright (C) 2009 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 "i486-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /home/cline/FreeCAD/bin/FreeCAD...done.
(gdb) run
Starting program: /home/cline/FreeCAD/bin/FreeCAD 
[Thread debugging using libthread_db enabled]
FreeCAD 0.10, Libs: 0.10R2687
(c) Juergen Riegel, Werner Mayer 2001-2009
  #####                 ####  ###   ####  
  #                    #      # #   #   # 
  #     ##  #### ####  #     #   #  #   # 
  ####  # # #  # #  #  #     #####  #   # 
  #     #   #### ####  #    #     # #   # 
  #     #   #    #     #    #     # #   #  ##  ##  ##
  #     #   #### ####   ### #     # ####   ##  ##  ##

[New Thread 0xb67edb70 (LWP 2225)]
[New Thread 0xb48bdb70 (LWP 2226)]
[New Thread 0xb40bdb70 (LWP 2227)]

Program received signal SIGSEGV, Segmentation fault.
0x04a19326 in glGetString () from /usr/lib/libGL.so.1
(gdb) where
#0  0x04a19326 in glGetString () from /usr/lib/libGL.so.1
#1  0x00442936 in ?? () from /usr/lib/libQtOpenGL.so.4
#2  0x004a090d in ?? () from /usr/lib/libQtOpenGL.so.4
#3  0x0043dfb7 in ?? () from /usr/lib/libQtOpenGL.so.4
#4  0x0049dd26 in ?? () from /usr/lib/libQtOpenGL.so.4
#5  0x00443b1f in QGLWidget::QGLWidget(QGLFormat const&, QWidget*, char const*, QGLWidget const*, QFlags<Qt::WindowType>) () from /usr/lib/libQtOpenGL.so.4
#6  0x024258f9 in SoQtGLArea::SoQtGLArea(QGLFormat*, QWidget*, QGLWidget const*, char const*) () from /usr/lib/libSoQt4.so.20
#7  0x023cf32c in SoQtGLWidgetP::buildGLWidget() ()
   from /usr/lib/libSoQt4.so.20
#8  0x023d06aa in SoQtGLWidget::buildWidget(QWidget*) ()
   from /usr/lib/libSoQt4.so.20
#9  0x023d6686 in SoQtRenderArea::buildWidget(QWidget*) ()
   from /usr/lib/libSoQt4.so.20
#10 0x02419c08 in SoQtViewer::SoQtViewer(QWidget*, char const*, int, SoQtViewer::Type, int) () from /usr/lib/libSoQt4.so.20
#11 0x074cbd45 in View3DInventorViewer (this=0x8ff31b0, parent=0x8ff2330, 
    name=0x0, embed=1, type=SoQtViewer::BROWSER, build=1)
    at View3DInventorViewer.cpp:128
#12 0x074c490f in View3DInventor (this=0x8ff2330, pcDocument=0x8fca838, 
    parent=0xbffff894, wflags=...) at View3DInventor.cpp:91
#13 0x073df205 in Gui::Document::createView (this=0x8fca838, 
    sType=0x75a8071 "View3DIv") at Document.cpp:683
#14 0x0732892c in Gui::Application::slotNewDocument (this=0xbffff7d8, Doc=...)
    at Application.cpp:406
#15 0x073317e4 in boost::_mfi::mf1<void, Gui::Application, App::Document const&>::operator() (function_obj_ptr=..., a0=...)
    at /usr/include/boost/bind/mem_fn_template.hpp:162
#16 operator()<boost::_mfi::mf1<void, Gui::Application, const App::Document&>, boost::_bi::list1<const App::Document&> > (function_obj_ptr=..., a0=...)
    at /usr/include/boost/bind/bind.hpp:306
#17 operator()<App::Document> (function_obj_ptr=..., a0=...)
    at /usr/include/boost/bind/bind_template.hpp:47
#18 boost::detail::function::void_function_obj_invoker1<boost::_bi::bind_t<void, boost::_mfi::mf1<void, Gui::Application, App::Document const&>, boost::_bi::list2<boost::_bi::value<Gui::Application*>, boost::arg<1> > >, void, App::Document const&>::invoke (function_obj_ptr=..., a0=...)
    at /usr/include/boost/function/function_template.hpp:153
#19 0x016e3027 in boost::signal1<void, App::Document const&, boost::last_value<void>, int, std::less<int>, boost::function<void ()(App::Document const&)> >::operator()(App::Document const&) ()
   from /home/cline/FreeCAD/lib/libFreeCADApp.so.2
#20 0x016c9a28 in App::Application::newDocument (this=0x8116b80, Name=0x0, 
    UserName=0x0) at Application.cpp:267
#21 0x016e412e in App::Application::sNewDocument (args=0xb694602c)
    at ApplicationPy.cpp:157
#22 0x0181e3b2 in PyCFunction_Call () from /usr/lib/libpython2.6.so.1.0
#23 0x0187cb38 in PyEval_EvalFrameEx () from /usr/lib/libpython2.6.so.1.0
#24 0x0187e349 in PyEval_EvalCodeEx () from /usr/lib/libpython2.6.so.1.0
#25 0x0187e453 in PyEval_EvalCode () from /usr/lib/libpython2.6.so.1.0
#26 0x0189b8ce in PyRun_StringFlags () from /usr/lib/libpython2.6.so.1.0
#27 0x008c07c5 in Base::InterpreterSingleton::runString (this=0x8089830, 
    sCmd=0x8fc6038 "App.newDocument()") at Interpreter.cpp:116
#28 0x0734c23b in Gui::Command::doCommand (eType=Gui::Command::Doc, 
    sCmd=0x75b2482 "App.newDocument()") at Command.cpp:420
#29 0x07350288 in StdCmdNew::activated (this=0x8177de0, iMsg=0)
    at CommandDoc.cpp:279
#30 0x0734ac3c in Gui::Command::invoke (this=0x8177de0, i=0)
    at Command.cpp:294
#31 0x0731da18 in Gui::Action::onActivated (this=0x8b9ce10) at Action.cpp:83
#32 0x0731da71 in Gui::Action::qt_metacall (this=0x8b9ce10, 
    _c=QMetaObject::InvokeMetaMethod, _id=4, _a=0xbfffe6d8)
    at moc_Action.cpp:73
#33 0x00af495a in QMetaObject::metacall(QObject*, QMetaObject::Call, int, void**) () from /usr/lib/libQtCore.so.4
#34 0x00b030db in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) () from /usr/lib/libQtCore.so.4
#35 0x00d33ab9 in QAction::triggered(bool) () from /usr/lib/libQtGui.so.4
#36 0x00d35c0c in QAction::activate(QAction::ActionEvent) ()
   from /usr/lib/libQtGui.so.4
#37 0x011d3f4c in ?? () from /usr/lib/libQtGui.so.4
#38 0x011da23b in ?? () from /usr/lib/libQtGui.so.4
#39 0x011db277 in QMenu::mouseReleaseEvent(QMouseEvent*) ()
   from /usr/lib/libQtGui.so.4
#40 0x00d96f6e in QWidget::event(QEvent*) () from /usr/lib/libQtGui.so.4
#41 0x011dc904 in QMenu::event(QEvent*) () from /usr/lib/libQtGui.so.4
#42 0x00d3a1dc in QApplicationPrivate::notify_helper(QObject*, QEvent*) ()
   from /usr/lib/libQtGui.so.4
#43 0x00d417ab in QApplication::notify(QObject*, QEvent*) ()
   from /usr/lib/libQtGui.so.4
#44 0x07333775 in Gui::GUIApplication::notify (this=0xbffff8c8, 
    receiver=0x8260530, event=0xbfffef20) at Application.cpp:1196
#45 0x00aef6fb in QCoreApplication::notifyInternal(QObject*, QEvent*) ()
   from /usr/lib/libQtCore.so.4
#46 0x00d40762 in QApplicationPrivate::sendMouseEvent(QWidget*, QMouseEvent*, QWidget*, QWidget*, QWidget**, QPointer<QWidget>&, bool) ()
   from /usr/lib/libQtGui.so.4
#47 0x00dca1a7 in ?? () from /usr/lib/libQtGui.so.4
#48 0x00dc91b1 in QApplication::x11ProcessEvent(_XEvent*) ()
   from /usr/lib/libQtGui.so.4
#49 0x00df807a in ?? () from /usr/lib/libQtGui.so.4
#50 0x0683dfd8 in g_main_context_dispatch () from /lib/libglib-2.0.so.0
#51 0x06841880 in ?? () from /lib/libglib-2.0.so.0
#52 0x068419b3 in g_main_context_iteration () from /lib/libglib-2.0.so.0
#53 0x00b1b3f5 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#54 0x00df7ba5 in ?? () from /usr/lib/libQtGui.so.4
#55 0x00aedd19 in QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#56 0x00aee16a in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) ()
   from /usr/lib/libQtCore.so.4
#57 0x00af235f in QCoreApplication::exec() () from /usr/lib/libQtCore.so.4
#58 0x00d3a277 in QApplication::exec() () from /usr/lib/libQtGui.so.4
#59 0x07330ceb in Gui::Application::runApplication () at Application.cpp:1351
#60 0x0804af61 in main (argc=1, argv=0xbffffc44) at MainGui.cpp:224
(gdb) cline@cline-desktop:~$ 
I'm a little concerned that FreeCAD is reporting itself as "FreeCAD 0.10, Libs: 0.10R2687". Revision.m4 says 0.9.2706
User avatar
jriegel
Founder
Posts: 3369
Joined: Sun Feb 15, 2009 5:29 pm
Location: Ulm, Germany
Contact:

Re: Help

Post by jriegel »

Ahh,
looks like a OpenGL problem. It crash in the first call to OpenGL.
Do you have other programs installed which use OpenGL? e.g. Blender?

We have a lot trouble with the Graphic driver on Linux......

The trunk version in the repository is 0.10. I think Werner was busy with Debian release of 0.9 and did not update the
Version tag on autotools.. The Release for Ubuntu 10.4 will be FreeCAD 0.10. On Debian Squeeze 0.9 I think....

Jürgen
Stop whining - start coding!
Ken Cline

Re: Help

Post by Ken Cline »

Thanks!

No. I did not have any OpenGL programs. Blender reported
"intern/ghost/intern/GHOST_WindowX11.cpp:177: X11 glxChooseVisual() failed for OpenGL, verify working openGL system!"

I was running the GUI on another computer, which seems to break OpenGL support. Running FreeCAD on the local display gives much better results. Two of the MeshTestsApp tests fail, but I'm happy to have a running program.

I am confused about the version I built. It was checked out from the trunk fork of the SVN source tree and the Help/About FreeCAD screen has a picture with the string "FreeCAD 0.9" in the middle, but the text below reads: "FreeCAD (c) Juergen Riegel, Werner Mayer 2001-2009" "Version 0.10" "Revision number 2687" "Release date 2009/12/01 10:44:15".

Should I report the OpenGL failure as a bug? If so, let me know how.
User avatar
jriegel
Founder
Posts: 3369
Joined: Sun Feb 15, 2009 5:29 pm
Location: Ulm, Germany
Contact:

Re: Help

Post by jriegel »

To send OpenGl over the network to an other X-Server is a special thing. I did it 10 years ago on SGI workstations...
I never did it again. Its the GLX protocol. Its not in the range of the aplication, its done by the system. And since
Blender crash ( Blender makes also heavy use of OpenGL) I think your system dont suport Glx. What it is, the X-Server,
the grapic driver or something else is hard to say.....
Would be a bug request to Ubuntu.....

Jürgen
Stop whining - start coding!
Ken Cline

Re: Help

Post by Ken Cline »

The bug I meant is the segmentation fault. I'm not looking for cross-platform X windows OpenGL support, just better error reporting. Shouldn't FreeCAD offer the same sort of advice that Blender gives ("verify working OpenGL system!")?
User avatar
yorik
Founder
Posts: 13665
Joined: Tue Feb 17, 2009 9:16 pm
Location: Brussels
Contact:

Re: Help

Post by yorik »

That's a good idea! Many linux users installing Freecad from the repo might have a not working opengl setup...
User avatar
jriegel
Founder
Posts: 3369
Joined: Sun Feb 15, 2009 5:29 pm
Location: Ulm, Germany
Contact:

Re: Help

Post by jriegel »

Mhhhhh,
you are right. The segfault is an error!

But unfortunately the most OpenGL errors we see is a little bit complicated. Nowadays every distro has OpenGl support. If not
by hardware they do it with Mesa by software. So the errors are mostly because of broken hardware support.

Jürgen
Stop whining - start coding!
wmayer
Founder
Posts: 20317
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: Help

Post by wmayer »

Hi Ken,

don't worry about the version number mismatch. The file revision.m4 is not under version control and gets created when starting the script autogen.sh. The number 0.9 is hard-coded and only the revision number is extracted from the svn repo. The version number you'll see in the console or About dialog is taken from another file. We actually only sync both numbers when making a new release. Maybe we should implement some mechanism to sync them all the time...

To your OpenGL problem: in src/Gui/Application.cpp, line 1271ff we have a check for OpenGL. Doesn't this work for you?

Today I managed to use FreeCAD by using a remote X server.
My configuration:
* Windows Vista host
* Debian Squeeze as guest in VirtualBox (network connect is host interface to communicate with the host)
* cygwin+X server+GL(U) packages installed under Windows

Start a cygwin bash and from there start the X server with startx. In the upcoming X window type xhost + to allow to connect from any remote system. Start Debian Squeeze and open a terminal window. Do a "export DISPLAY=<host_ip_address>:0.0" and start FreeCAD. The FreeCAD window then appears in the X server of cygwin. The OpenGL stuff is a little bit slow but it works...


Cheers,
Werner
Post Reply