Seg fault on Mac OS 10.6.2

Bug #483950 reported by Tax Man
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Cuneiform for Linux
New
Undecided
Unassigned

Bug Description

Hi, cuneiform builds nicely on Mac OS, but on running it with the basic command line
cuneiform -o 0001.txt 0001.jpg
for an image with English text fails with only the error Segmentation fault.
I could try attaching an image, but it does the same thing with various image formats, tiff, jpg, and the included test bmp's.
I built with a debug build type, but I still don't get any more information. Let me know if there is anything I can do to provide more information.

Also a small separate note. On Debian and Debian derived Linux distributions, the needed ImageMagick libraries are in a separate package from ImageMagick. It would be good to note in the readme that libmagick++-dev needs to be installed as well.

Revision history for this message
Tax Man (taxman457f) wrote :

Oh, I get the same behavior after building the same version - 0.8.0 - on Ubuntu. Just shoot me if it's user error.

Revision history for this message
Tax Man (taxman457f) wrote :

Jason said: "I would suggest rebuilding it with debugging symbols and running it in gdb to get a backtrace for the developers."
So I did that on my Ubuntu and Mac systems and attached the results, they are both in the file. Sorry I'm not really familiar with GDB and coding, but I can supply any information that someone gives me some hints on how to obtain.

It gives no debug information available errors for the Mac build even though I built both of them with the
cmake -DCMAKE_BUILD_TYPE=debug ..
config option.

Revision history for this message
Yury V. Zaytsev (zyv) wrote :

This is correct, sorry I've just noticed that I replied to Jason directly instead of posting to the bug. The backtrace does not look particularly helpfull, maybe you can do a full backtrace (I guess it's bf or something like this) and also run it through strace...

Revision history for this message
Tax Man (taxman457f) wrote :

Sure. I've attached the full gdb backtrace along with some extra stuff suggested here: https://wiki.ubuntu.com/Backtrace in case it's helpful. I'll also attach the strace output, but it seems I can't attach two files at once, so I'll do that in a second.

Revision history for this message
Tax Man (taxman457f) wrote :
Revision history for this message
Tax Man (taxman457f) wrote :

Now I've had a chance to grab the full backtrace on the Mac. Let me know if you want to see the dtrace output on the Mac, and if so, what options.

Revision history for this message
Yury V. Zaytsev (zyv) wrote :

Wow, that looks funny. Thanks! Hopefully Jussi can look into this.

Revision history for this message
Jussi Pakkanen (jpakkane) wrote :

Snow Leopard by default builds 64 bit binaries. Can you try building 32-bit version and seeing if it crashes too? Unfortunately I don't remember the switches you need for that, you have to search Apple's documentation.

Revision history for this message
Yury V. Zaytsev (zyv) wrote :

Didn't Apple guys strip all the supporting 32-bit binaries from Snow Leopard?

Revision history for this message
Jussi Pakkanen (jpakkane) wrote :

No, because that would mean that every 32 bit binary (which is to say roughly 99% of all third party applications ever produced for OS X) would break.

Revision history for this message
Tax Man (taxman457f) wrote :

I'm not sure I did enough, but I put -arch i386 in the following places in CMakeCache.txt. It was indicated by this: http://developer.apple.com/mac/library/documentation/Darwin/Conceptual/64bitPorting/building/building.html

//Flags used by the compiler during all build types.
CMAKE_CXX_FLAGS:STRING=-arch i386

//Flags used by the compiler during all build types.
CMAKE_C_FLAGS:STRING=-arch i386

However, http://boomswaggerboom.wordpress.com/2009/08/27/building-32-bit-firefox-on-mac-os-x-10-6/ seems to imply there needs to be more of a crossbuild. Maybe that is specific to that project.

Anyway, I still get the seg fault. Do you want to see the backtrace?

Also, the linux build I tested on above is a 32 bit Ubuntu 9.04 machine and it is also seg faulting.

Revision history for this message
Jussi Pakkanen (jpakkane) wrote :

Please attach the image. Also post all the exact commands you execute to build and run Cuneiform starting from checking out the source.

Revision history for this message
inye (avanie) wrote :

Just experienced same issue on OS X 10.6.2. Overcame it with 32bit gcc-4.0 from 10.5 compatibity layer:

CXX=g++-4.0 CC=gcc-4.0 cmake -DCMAKE_BUILD_TYPE=Debug ..

works perfect.

Revision history for this message
Cosimo Lupo (lupocos) wrote :

Hello everybody,
It seems that @inye at least managed to compile and run cuneiform on Mac.
However I’m still getting the segmentation fault...
I don’t know how to build Cuneiform from source, therefore I have installed it via MacPorts

# sudo port install cuneiform

Now, whenever I run it, I get "Segmentation fault" error:

# cuneiform -f hocr test.html test.tif
# Cuneiform for Linux 1.0.0
# Segmentation fault

I’ve got XCode and all the tools in order to build the application from its source files, but I don’t know how to do...
By the way, I’m using the latest 13" MacBook Air with OS X 10.6.7 — could anybody tell me how I can compile Cuneifrom?
Or better, if it is possible, send me his/her binary builds?

Thank you in advance,
Best wishes.

Cosimo Lupo

Revision history for this message
tristank (tristank) wrote :

http://www.aboutdebian.com/compile.htm

$ ./configure
$ make
$ sudo make install

It's as simple as that. Worked for me at Lion.

Revision history for this message
Yury V. Zaytsev (zyv) wrote :

Where did you get the ./configure thing from? Cuneiform build system is generated using CMake, your instructions are arbitrary. See example in the README file.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.