Build igotu2gpx on OS X Yosemite

Asked by Pierre Bernard on 2016-05-23

Hi!

I am trying to build igotu2gpx 0.30.0 on OS X Yosemite so that I can integrate a patch for the year 2016 bug.
I managed to create a build, but it crashes immediately.

I used Homebrew to install dependancies:

brew install qt
brew install homebrew/versions/gcc49
brew install boost --cc=gcc-4.9
brew uninstall libusb (could not get ld to find libusb, but it is happy with limbs-compat)
brew install libusb-compat
brew install pkg-config

I updated localconfig.pri like so:

macx:BOOSTROOT = /usr/local/include/boost/../..
macx:BOOSTINCLUDEDIR = $${BOOSTROOT}/include
macx:BOOSTLIBDIR = $${BOOSTROOT}/lib
macx:BOOSTPOLIB = boost_program_options-mt
macx:LIBUSBINCLUDEDIR = /usr/local/Cellar/libusb-compat/0.1.5/include

This is not good enough for the liker to fin libusb. Thus I also patched libusb.pri:

LIBS *= -L/usr/local/Cellar/libusb-compat/0.1.5/lib -lusb

Then I run:

qmake -spec macx-g++
make
sudo make install

The binary is installed at:
 /usr/local/bin/igotu2gpx
It links against:
 /usr/local/lib/libigotu.1.0.0.dylib (compatibility version 1.0.0, current version 1.0.0)
 /usr/local/opt/boost/lib/libboost_program_options-mt.dylib (compatibility version 0.0.0, current version 0.0.0)
 /usr/local/opt/qt/lib/QtCore.framework/Versions/4/QtCore (compatibility version 4.8.0, current version 4.8.7)
 /usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current version 104.1.0)
 /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1213.0.0)
 /usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current version 283.0.0)

Running the binary crashes:

/usr/local/bin/igotu2gpx -version
igotu2gpx(18099,0x7fff7671c300) malloc: *** error for object 0x7fff75403f50: pointer being freed was not allocated
*** set a breakpoint in malloc_error_break to debug
Abort trap: 6

I don’t expect this to be a code level bug since I am using the code distribution from https://launchpad.net/igotu2gpx/0.3/0.3.0/+download/igotu2gpx-0.3.0.tar.gz

Any suggestions appreciated.

Question information

Language:
English Edit question
Status:
Answered
For:
igotu2gpx Edit question
Assignee:
No assignee Edit question
Last query:
2016-05-23
Last reply:
2016-05-25
Michael Hofmann (mh21) said : #1

Hi,

can you get a backtrace for the crash? I don't really know how to do this in on OS X, on linux it would be sth like just running it in gdb or "gdb -c core ..." and "bt".

Cheers
  Michael

Hi Michael,

The backtrace is:

(gdb) bt
#0 0x00007fff92676286 in __pthread_kill ()
#1 0x00007fff9b8019f9 in pthread_kill ()
#2 0x00007fff8ed689ab in abort ()
#3 0x00007fff998361cb in free ()
#4 0x000000010012413f in boost::program_options::store ()
#5 0x0000000102420500 in ?? ()
Previous frame inner to this frame (gdb could not unwind past this frame)

The version of boost I got is 1.60.0_2

Pierre

Hi!

I managed to build igotu2gpx 0.3.0 on Mac OS X 10.6 Snow Leopard using the following procedure:

sudo port install qt4-mac
sudo port install boost
sudo port install libusb
sudo port install libusb-compat
sudo port install pkg-config

Copy localconfig-template.pri to localconfig.pri

Update:
macx:BOOSTROOT = /opt/local
macx:BOOSTINCLUDEDIR = $${BOOSTROOT}/include
macx:BOOSTLIBDIR = $${BOOSTROOT}/lib
macx:BOOSTPOLIB = boost_program_options-mt
macx:LIBUSBINCLUDEDIR = /opt/local/include

Patch libusb.pri:
LIBS *= -L/opt/local/lib/ -lusb

qmake -spec macx-g++
make
sudo make install

Pierre

Can you help with this problem?

Provide an answer of your own, or ask Pierre Bernard for more information if necessary.

To post a message you must log in.