← Back to team overview

kicad-developers team mailing list archive

Re: Wrong (external) boost pulled in?

 

On 11/18/2014 3:34 PM, Bernhard Stegmaier wrote:
> Hi,
> 
> I don’t know yet… maybe it is only OS X related, maybe not…
> 
> Some weeks ago Jean-Paul reported a weird “pcbnew crashes always on
> start” problem:
>   https://lists.launchpad.net/kicad-developers/msg14958.html
> I did look into that back then, but I didn’t get any clue… with that
> stack trace there is just nothing that could/should crash.
> 
> I always used KiCad internal boost, my machines didn’t have any other
> boost installed.
> No problems with that.
> For the recent avhttp tests I installed boost 1.56 via MacPorts and used
> this one since then (-DKICAD_SKIP_BOOST=ON, the MacPorts boost which is
> in /opt/local/… is found automatically, however this is done).
> No problems so far.
> Before posting my current changes for OS X building I also did test
> internal boost again.
> Builds fine, but I always get the same crash as Jean-Paul above when
> starting pcbnew (eeschema is fine…).
> 
> Since the stack trace didn’t provide anything useful I made a debug
> build and ran it through Xcode:
> If Xcode is right (I don’t always trust debuggers when it comes to deal
> with #if’s), then clearly the wrong #if branch is used… 1.56 is the
> version installed by MacPorts (that it shouldn't use), 1.54 would be the
> way to go.
> 
> I checked a sample compiler invocation when building pcbnew.cpp:
> [ 75%] Building CXX object pcbnew/CMakeFiles/pcbnew_kiface.dir/pcbnew.cpp.o
> cd /Volumes/OSXData/Users/bstegmaier/Temp/KiCad/build/pcbnew &&
> /usr/bin/clang++   -DHAVE_STDINT_H -DHAVE_SVN_VERSION -DKICAD_KEEPCASE
> -DPCBNEW -DUSE_WX_OVERLAY -DWXUSINGDLL -DWX_COMPATIBILITY
> -D_FILE_OFFSET_BITS=64 -D__WXMAC__ -D__WXOSX_COCOA__ -D__WXOSX__
> -Dpcbnew_kiface_EXPORTS -DBUILD_KIWAY_DLL -DCOMPILING_DLL -Wall  -fPIC
> -Wno-strict-aliasing -D__ASSERTMACROS__
> -I/Volumes/OSXData/Users/bstegmaier/Temp/KiCad/wx-3.0.2-10.5/include/wx-3.0
> -g3 -ggdb3 -DDEBUG -Wno-deprecated-declarations -isysroot
> /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk
> -mmacosx-version-min=10.5 -fPIC
> -I/Volumes/OSXData/Users/bstegmaier/Temp/KiCad/kicad-osxbuild/include
> -I/Volumes/OSXData/Users/bstegmaier/Temp/KiCad/kicad-osxbuild/pcbnew/.
> -I/Volumes/OSXData/Users/bstegmaier/Temp/KiCad/wx-3.0.2-10.5/lib/wx/include/osx_cocoa-unicode-3.0
> -I/Volumes/OSXData/Users/bstegmaier/Temp/KiCad/wx-3.0.2-10.5/include/wx-3.0
> -I/Volumes/OSXData/Users/bstegmaier/Temp/KiCad/kicad-osxbuild/pcbnew/./dialogs
> -I/Volumes/OSXData/Users/bstegmaier/Temp/KiCad/kicad-osxbuild/pcbnew/./autorouter
> -I/Volumes/OSXData/Users/bstegmaier/Temp/KiCad/kicad-osxbuild/pcbnew/../3d-viewer
> -I/Volumes/OSXData/Users/bstegmaier/Temp/KiCad/kicad-osxbuild/pcbnew/../common
> -I/Volumes/OSXData/Users/bstegmaier/Temp/KiCad/kicad-osxbuild/pcbnew/../polygon
> -I/Volumes/OSXData/Users/bstegmaier/Temp/KiCad/kicad-osxbuild/pcbnew/../common/dialogs
> -I/Volumes/OSXData/Users/bstegmaier/Temp/KiCad/kicad-osxbuild/pcbnew/./exporters
> -I/Volumes/OSXData/Users/bstegmaier/Temp/KiCad/kicad-osxbuild/pcbnew/../lib_dxf
> -I/Volumes/OSXData/Users/bstegmaier/Temp/KiCad/kicad-osxbuild/pcbnew/./import_dxf
> -I/Volumes/OSXData/Users/bstegmaier/Temp/KiCad/kicad-osxbuild/pcbnew/../utils/idftools
> -I/Volumes/OSXData/Users/bstegmaier/Temp/KiCad/kicad-osxbuild/boost_root/include-I/Volumes/OSXData/Users/bstegmaier/Temp/KiCad/build 
>   -o CMakeFiles/pcbnew_kiface.dir/pcbnew.cpp.o -c
> /Volumes/OSXData/Users/bstegmaier/Temp/KiCad/kicad-osxbuild/pcbnew/pcbnew.cpp
> This seems to point to the correct internal boost… I don’t know, though,
> if this is the same for all files.
> 
> Default search path of clang++ (from console) ...
> #include <...> search starts here:
>  /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1
>  /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/include
>  /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include
>  /usr/include
>  /System/Library/Frameworks (framework directory)
>  /Library/Frameworks (framework directory)
> End of search list.
> … also doesn’t contain anything pointing my 1.56 boost (it lives in
> /opt/local/…).
> 
> Next, I did uninstall MacPorts 1.56 boost, so I didn’t have any boost on
> the machine.
> Rebuilt KiCad (deleted .downloads_by_cmake and boost_root from source
> folder, wiped build folder, and reran cmake).
> Guess what… works like a charm.
> 
> I guess that Jean-Paul also resolved the problem by removing other boost
> installations from is machine?
> 
> Any ideas?
> I looked around a bit, but I have no idea why the external boost (at
> least, <boost/version.h> where BOOST_VERSION is defined) gets pulled in
> instead of the internal one.
> Maybe something wrong from external boost gets picked up during building
> the internal boost and then is used during building KiCad?

Did you do an entirely new build or change the configuration of an
existing build?  Avoid doing the latter.  It's possible that CMake got
confused during the reconfigure and was still pulling in the external
Boost context library but KiCad was compiled to use the Boost 1.54
context library which could cause this issue.  You can test this by
check the library dependency tree of the segfaulting Pcbnew.

> 
> 
> Regards,
> Bernhard
> 





Follow ups

References