I statically compiled Imagemagick. Converting images works well so far. But when I run identify -list delegate it shows my delegates, but then exits with "Aborted (core dumped)".

Here is the strace -f https://gist.github.com/kvz/9385813

What could I have done wrong?

  • 2
    more interesting that an strace would be a backtrace – umläute Mar 6 '14 at 9:38
  • Thanks for the suggestion, I added a backtrace here now gist.github.com/kvz/9385813/#comment-1185658. It mentions gvFreeContext, so possibly a graphviz issue..? – kvz Mar 6 '14 at 10:28
  • @kvz That isn't really a backtrace, it's just the frame it crashed on. You need to run the bt command after it segfaults to get the backtrace – Michael Mrozek Mar 6 '14 at 15:30

Thanks to @umläute's comment I used gdb for enhanced debugging. Here's how I backtraced ./target/bin/identify -list delegate:

$ gdb ./target/bin/identify
GNU gdb (Ubuntu/Linaro 7.4-2012.04-0ubuntu2.1) 7.4-2012.04
Copyright (C) 2012 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 "x86_64-linux-gnu".
For bug reporting instructions, please see:
Reading symbols from /usr/src/imagemagick-static/target/bin/identify...done.
(gdb) run -list delegate

This generated much more useful output than strace did:

Program received signal SIGSEGV, Segmentation fault.
0x000000000072eaa5 in gvFreeContext ()

Googling for gvFreeContext allowed me to narrow down further debugging on Graphviz.

Michael Mrozek suggested to then type

(gdb) bt

That gives the full backtrace:

#0  0x000000000094ce21 in gvFreeContext ()
#1  0x000000000049fe4f in UnregisterDOTImage ()
#2  0x0000000000452e5c in UnregisterStaticModules ()
#3  0x0000000000423013 in MagickCoreTerminus ()
#4  0x000000000040cc38 in IdentifyMain ()
#5  0x000000000040cc64 in main ()

I haven't solved my segfault just yet, but gdb backtraces seem the way to debug them when nor stderr nor dmesg nor kern.log contain good clues.

  • If you're going to debug it, you need to build with debug symbols (-g) or not strip them out (make sure install doesn't have the -s option). The GDB would actually give a backtrace, to the particular line of code... – derobert Mar 6 '14 at 22:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.