Bug 1102621 - FreeCAD fails to start properly due to undefined symbol
Summary: FreeCAD fails to start properly due to undefined symbol
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: freecad
Version: 20
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Richard Shaw
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-05-29 10:27 UTC by Neil Darlow
Modified: 2014-07-20 18:00 UTC (History)
3 users (show)

Fixed In Version: smesh-5.1.2.2-10.svn55.el6
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-06-10 03:06:56 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Neil Darlow 2014-05-29 10:27:51 UTC
Description of problem:
FreeCAD fails to start properly due to an undefined symbol.

Version-Release number of selected component (if applicable):
freecad-0.13-6 (updates-testing)

How reproducible:
Every time.

Steps to Reproduce:
1. Attempt to update freecad. Actually requires de-installation of existing package and installation of replacement.
2. Start FreeCAD
3. Observe undefined symbol error in applications status line.

Actual results:
From a terminal window we get -

[neil@corona ~]$ cd /usr/lib64/freecad
[neil@corona freecad]$ FreeCAD
FreeCAD 0.13, Libs: 0.13R$WCREV$
© Juergen Riegel, Werner Mayer, Yorik van Havre 2001-2011
  #####                 ####  ###   ####  
  #                    #      # #   #   # 
  #     ##  #### ####  #     #   #  #   # 
  ####  # # #  # #  #  #     #####  #   # 
  #     #   #### ####  #    #     # #   # 
  #     #   #    #     #    #     # #   #  ##  ##  ##
  #     #   #### ####   ### #     # ####   ##  ##  ##

/usr/lib64/freecad/lib/Part.so: undefined symbol: _ZN4Part29BRepOffsetAPI_MakePipeShellPy3addEP7_object

Expected results:
FreeCAD should start cleanly without throwing this error.

Additional info:
You are not able to update existing FreeCAD package installations from rpmfusion. There are conflicts which prevent this from happening and they will need to be resolved before this is pushed to updates.

Comment 1 Richard Shaw 2014-05-29 13:03:45 UTC
Great... I noticed this in Fedora-review  but I haven't had any problems running freecad locally.

Getting the human readable name:
$ c++filt "_ZN4Part29BRepOffsetAPI_MakePipeShellPy3addEP7_object"
Part::BRepOffsetAPI_MakePipeShellPy::add(_object*)

Looking for where it's defined:
$ grep -r "BRepOffsetAPI_MakePipeShellPy::add"
src/Mod/Part/App/BRepOffsetAPI_MakePipeShellPyImp.cpp.oce_015:PyObject* BRepOffsetAPI_MakePipeShellPy::add(PyObject *args)
src/Mod/Part/App/BRepOffsetAPI_MakePipeShellPyImp.cpp:PyObject* BRepOffsetAPI_MakePipeShellPy::add(PyObject *args)

I'm far from an expert here but it looks like Part.so should be providing the symbol, but pehaps through the python library?

For posterity, here's the full list which we'll likely run into even if this one is fixed:
]$ rpmlint freecad | grep undefined-non-weak-symbol
freecad.x86_64: W: undefined-non-weak-symbol /usr/lib64/freecad/lib/ReverseEngineering.so Part::BRepOffsetAPI_MakePipeShellPy::add(_object*)
freecad.x86_64: W: undefined-non-weak-symbol /usr/lib64/freecad/lib/Sketcher.so Part::BRepOffsetAPI_MakePipeShellPy::add(_object*)
freecad.x86_64: W: undefined-non-weak-symbol /usr/lib64/freecad/lib/Raytracing.so Part::BRepOffsetAPI_MakePipeShellPy::add(_object*)
freecad.x86_64: W: undefined-non-weak-symbol /usr/lib64/freecad/lib/MeshPartGui.so Part::BRepOffsetAPI_MakePipeShellPy::add(_object*)
freecad.x86_64: W: undefined-non-weak-symbol /usr/lib64/freecad/lib/Part.so Part::BRepOffsetAPI_MakePipeShellPy::add(_object*)
freecad.x86_64: W: undefined-non-weak-symbol /usr/lib64/freecad/lib/DrawingGui.so Part::BRepOffsetAPI_MakePipeShellPy::add(_object*)
freecad.x86_64: W: undefined-non-weak-symbol /usr/lib64/freecad/lib/FemGui.so TColgp_Array1OfXYZ::Destroy()
freecad.x86_64: W: undefined-non-weak-symbol /usr/lib64/freecad/lib/FemGui.so TColgp_Array1OfXYZ::TColgp_Array1OfXYZ(int, int)
freecad.x86_64: W: undefined-non-weak-symbol /usr/lib64/freecad/lib/FemGui.so TColgp_Array1OfXYZ::TColgp_Array1OfXYZ(int, int)
freecad.x86_64: W: undefined-non-weak-symbol /usr/lib64/freecad/lib/FemGui.so TColgp_Array1OfVec::TColgp_Array1OfVec(int, int)
freecad.x86_64: W: undefined-non-weak-symbol /usr/lib64/freecad/lib/FemGui.so MeshVS_HArray1OfSequenceOfInteger::MeshVS_HArray1OfSequenceOfInteger(int, int)
freecad.x86_64: W: undefined-non-weak-symbol /usr/lib64/freecad/lib/FemGui.so TColgp_Array1OfXYZ::Destroy()
freecad.x86_64: W: undefined-non-weak-symbol /usr/lib64/freecad/lib/FemGui.so Expr_Array1OfNamedUnknown::Expr_Array1OfNamedUnknown(int, int)
freecad.x86_64: W: undefined-non-weak-symbol /usr/lib64/freecad/lib/FemGui.so TColgp_HArray1OfVec::TColgp_HArray1OfVec(int, int)
freecad.x86_64: W: undefined-non-weak-symbol /usr/lib64/freecad/lib/FemGui.so Part::BRepOffsetAPI_MakePipeShellPy::add(_object*)
freecad.x86_64: W: undefined-non-weak-symbol /usr/lib64/freecad/lib/PartGui.so Part::BRepOffsetAPI_MakePipeShellPy::add(_object*)
freecad.x86_64: W: undefined-non-weak-symbol /usr/lib64/freecad/lib/Fem.so TColgp_Array1OfXYZ::Destroy()
freecad.x86_64: W: undefined-non-weak-symbol /usr/lib64/freecad/lib/Fem.so TColgp_Array1OfXYZ::TColgp_Array1OfXYZ(int, int)
freecad.x86_64: W: undefined-non-weak-symbol /usr/lib64/freecad/lib/Fem.so TColgp_Array1OfXYZ::TColgp_Array1OfXYZ(int, int)
freecad.x86_64: W: undefined-non-weak-symbol /usr/lib64/freecad/lib/Fem.so TColgp_Array1OfVec::TColgp_Array1OfVec(int, int)
freecad.x86_64: W: undefined-non-weak-symbol /usr/lib64/freecad/lib/Fem.so MeshVS_HArray1OfSequenceOfInteger::MeshVS_HArray1OfSequenceOfInteger(int, int)
freecad.x86_64: W: undefined-non-weak-symbol /usr/lib64/freecad/lib/Fem.so TColgp_Array1OfXYZ::Destroy()
freecad.x86_64: W: undefined-non-weak-symbol /usr/lib64/freecad/lib/Fem.so Expr_Array1OfNamedUnknown::Expr_Array1OfNamedUnknown(int, int)
freecad.x86_64: W: undefined-non-weak-symbol /usr/lib64/freecad/lib/Fem.so TColgp_HArray1OfVec::TColgp_HArray1OfVec(int, int)
freecad.x86_64: W: undefined-non-weak-symbol /usr/lib64/freecad/lib/Fem.so Part::BRepOffsetAPI_MakePipeShellPy::add(_object*)
freecad.x86_64: W: undefined-non-weak-symbol /usr/lib64/freecad/lib/SketcherGui.so Part::BRepOffsetAPI_MakePipeShellPy::add(_object*)
freecad.x86_64: W: undefined-non-weak-symbol /usr/lib64/freecad/lib/MeshPart.so TColgp_Array1OfXYZ::Destroy()
freecad.x86_64: W: undefined-non-weak-symbol /usr/lib64/freecad/lib/MeshPart.so TColgp_Array1OfXYZ::TColgp_Array1OfXYZ(int, int)
freecad.x86_64: W: undefined-non-weak-symbol /usr/lib64/freecad/lib/MeshPart.so TColgp_Array1OfXYZ::TColgp_Array1OfXYZ(int, int)
freecad.x86_64: W: undefined-non-weak-symbol /usr/lib64/freecad/lib/MeshPart.so TColgp_Array1OfVec::TColgp_Array1OfVec(int, int)
freecad.x86_64: W: undefined-non-weak-symbol /usr/lib64/freecad/lib/MeshPart.so MeshVS_HArray1OfSequenceOfInteger::MeshVS_HArray1OfSequenceOfInteger(int, int)
freecad.x86_64: W: undefined-non-weak-symbol /usr/lib64/freecad/lib/MeshPart.so TColgp_Array1OfXYZ::Destroy()
freecad.x86_64: W: undefined-non-weak-symbol /usr/lib64/freecad/lib/MeshPart.so Expr_Array1OfNamedUnknown::Expr_Array1OfNamedUnknown(int, int)
freecad.x86_64: W: undefined-non-weak-symbol /usr/lib64/freecad/lib/MeshPart.so TColgp_HArray1OfVec::TColgp_HArray1OfVec(int, int)
freecad.x86_64: W: undefined-non-weak-symbol /usr/lib64/freecad/lib/MeshPart.so Part::BRepOffsetAPI_MakePipeShellPy::add(_object*)
freecad.x86_64: W: undefined-non-weak-symbol /usr/lib64/freecad/lib/RobotGui.so Part::BRepOffsetAPI_MakePipeShellPy::add(_object*)
freecad.x86_64: W: undefined-non-weak-symbol /usr/lib64/freecad/lib/ImportGui.so Part::BRepOffsetAPI_MakePipeShellPy::add(_object*)
freecad.x86_64: W: undefined-non-weak-symbol /usr/lib64/freecad/lib/InspectionGui.so Part::BRepOffsetAPI_MakePipeShellPy::add(_object*)
freecad.x86_64: W: undefined-non-weak-symbol /usr/lib64/freecad/lib/Robot.so Part::BRepOffsetAPI_MakePipeShellPy::add(_object*)
freecad.x86_64: W: undefined-non-weak-symbol /usr/lib64/freecad/lib/RaytracingGui.so Part::BRepOffsetAPI_MakePipeShellPy::add(_object*)
freecad.x86_64: W: undefined-non-weak-symbol /usr/lib64/freecad/lib/Inspection.so Part::BRepOffsetAPI_MakePipeShellPy::add(_object*)
freecad.x86_64: W: undefined-non-weak-symbol /usr/lib64/freecad/lib/Drawing.so Part::BRepOffsetAPI_MakePipeShellPy::add(_object*)

The question is, what changed? I haven't changed the way freecad is building... I am building against a newer version of OCE (0.15) than what I think is on RPM Fusion but I've been running it locally for some time without issue.

Comment 2 Neil Darlow 2014-05-29 17:33:20 UTC
Could it be buildsystem differences between RPM Fusion and Fedora?

I suppose you might try migrating the existing freecad-0.13-4 into Fedora and see if the build fails in a similar fashion (assuming you didn't start out this way).

The only other thing I could possibly suggest is that it could be a C++ namespace issue but that's clutching at straws.

Comment 3 Richard Shaw 2014-05-29 18:02:57 UTC
Ok, now I'm even more confused... When I look through the build logs[1] I see this:

Linking CXX shared library ../../../../Mod/Part/Part.so
cd /builddir/build/BUILD/freecad-0.13.1830/build/src/Mod/Part/App && /usr/bin/cmake -E cmake_link_script CMakeFiles/Part.dir/link.txt --verbose=1
/usr/bin/c++  -fPIC -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches  -m64 -mtune=generic  -D_OCC64  -Wl,--as-needed -shared -Wl,-soname,Part.so -o ../../../../Mod/Part/Part.so
[SNIP]
CMakeFiles/Part.dir/BRepOffsetAPI_MakePipeShellPyImp.cpp.o
[SNIP]

Ok, So this file here includes the generated file and header, BRepOffsetAPI_MakePipeShellPy.{h,cpp} which is built into the Part.so library

[1] https://kojipkgs.fedoraproject.org//packages/freecad/0.13/6.fc20/data/logs/x86_64/build.log

Comment 4 Richard Shaw 2014-05-29 20:20:24 UTC
I've dorked around with this all day (at work no less) and I'm completely confused. We need the help of an actual programmer.

Comment 5 Kevin Kofler 2014-05-29 22:16:29 UTC
Try building the package with:
%cmake … -DBUILD_SHARED_LIBS:BOOL=OFF
so that unspecified libraries get built as static. Some CMakeLists.txt setups expect that, i.e., they just use add_library without specifying STATIC and expect it to be a static library by default (whereas others expect users to use BUILD_SHARED_LIBS to decide whether to build static or shared libraries for their public libraries).

Comment 6 Richard Shaw 2014-05-30 00:02:44 UTC
Tried a suggestion from the freecad forums first, adding -Wl,--no-undefined and got this, not sure if it helps though:

CMakeFiles/Part.dir/BRepOffsetAPI_MakePipeShellPyImp.cpp.o: In function `Part::BRepOffsetAPI_MakePipeShellPy::staticCallback_add(_object*, _object*)':
/home/build/rpmbuild/freecad/BUILD/freecad-0.13.1830/build/src/Mod/Part/App/BRepOffsetAPI_MakePipeShellPy.cpp:568: undefined reference to `Part::BRepOffsetAPI_MakePipeShellPy::add(_object*)'

Comment 7 Richard Shaw 2014-05-30 00:33:29 UTC
Ack! I think I found it... 

the patch to be compatible had the #endif in the wrong place so "BRepOffsetAPI_MakePipeShellPy::add" was actually getting skipped!

I'm not sure how this happened (or why it ever worked) since I used the patch I was given from upstream which was creating right out of a git commit...

Comment 8 Kevin Kofler 2014-05-30 01:45:44 UTC
I guess that:
1. the context lines around the added #endif are not unique in that source file and
2. upstream changed some code elsewhere in the file that added or removed lines
and thus the #endif got inserted in the wrong location.

Comment 9 Fedora Update System 2014-05-30 02:21:56 UTC
freecad-0.13-7.el6, smesh-5.1.2.2-10.svn55.el6, OCE-0.15-3.el6.1 has been submitted as an update for Fedora EPEL 6.
https://admin.fedoraproject.org/updates/FEDORA-EPEL-2014-1524/freecad-0.13-7.el6,smesh-5.1.2.2-10.svn55.el6,OCE-0.15-3.el6.1

Comment 10 Fedora Update System 2014-05-30 02:52:33 UTC
freecad-0.13-7.fc20, OCE-0.15-3.fc20.1, smesh-5.1.2.2-10.svn55.fc20 has been submitted as an update for Fedora 20.
https://admin.fedoraproject.org/updates/FEDORA-2014-6805/OCE-0.15-3.fc20.1,smesh-5.1.2.2-10.svn55.fc20,freecad-0.13-7.fc20

Comment 11 Richard Shaw 2014-05-30 02:53:44 UTC
I think we got it. Thanks Kevin for responding so quickly.

Comment 12 Neil Darlow 2014-05-30 09:16:32 UTC
Yes, FreeCAD starts correctly now.

A broken upstream patch... who'd have thought? It reminds me of ad old adage often quoted by one of my ex-employers viz. "In God we trust... In humans we check!".

Any thoughts on the upgrade path? A "yum update" will bail out and suggest using --skip-broken. I had to deinstall and then install freecad.

Comment 13 Richard Shaw 2014-05-30 14:18:10 UTC
I've setup the new update but it hasn't been pushed into testing yet. This bug should be updated when it does and then a yum update (with the testing repo enabled) should work fine.

Comment 14 Fedora Update System 2014-05-30 17:05:30 UTC
freecad-0.13-7.el6, smesh-5.1.2.2-10.svn55.el6, OCE-0.15-3.el6.1 has been pushed to the Fedora EPEL 6 testing repository.

Comment 15 Fedora Update System 2014-06-10 03:06:56 UTC
freecad-0.13-7.fc20, OCE-0.15-3.fc20.1, smesh-5.1.2.2-10.svn55.fc20 has been pushed to the Fedora 20 stable repository.

Comment 16 Fedora Update System 2014-07-20 18:00:49 UTC
smesh-5.1.2.2-10.svn55.el6, OCE-0.15-3.el6.1 has been pushed to the Fedora EPEL 6 stable repository.


Note You need to log in before you can comment on or make changes to this bug.