Compiling on Centos 7

Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
Post Reply
bigzed
Posts: 8
Joined: 2014-11-03T08:30:07-07:00
Authentication code: 6789

Compiling on Centos 7

Post by bigzed »

Hello guys,

compiling ImageMagick 6.8.9-6 to ImageMagick 6.8.9-10 compiles on Centos 7 but this happens:

Code: Select all

$ ./configure --with-webp=no
(..)
$ make 
(..)
$ make install
(..)
$ mogrify
Illegal instruction (core dumped)
$ dmesg
[15542.947751] traps: mogrify[30971] trap invalid opcode ip:7f1755bbee8e sp:7fff69024440 error:0 in libMagickCore-6.Q16.so.2.0.0[7f17559ee000+395000]


Do you need more information about this?

best,
Steve
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Compiling on Centos 7

Post by magick »

We tried compiling 6.8.9-10 under CentOS 7 as follows:
  • cd ImageMagick-6.8.9-10
    ./confgure --disable-shared
    cp */*.xml .
    utilities/convert logo: logo.pam
The convert program ran without complaint. Does that work for you?
bigzed
Posts: 8
Joined: 2014-11-03T08:30:07-07:00
Authentication code: 6789

Re: Compiling on Centos 7

Post by bigzed »

It's still the same:

Code: Select all

$ ./configure --with-webp=no --disable-shared
$ make
$ make install
$ mogrify 
Illegal instruction (core dumped)
$ dmesg
[  594.233787] traps: mogrify[26462] trap invalid opcode ip:45284e sp:7fff39012570 error:0 in mogrify[400000+420000]
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Compiling on Centos 7

Post by magick »

Try again, but this time use the exact commands we gave. Do they fail in the same way? If so, try
  • gdb utilities/mogrify
    run
    where
Post the stack trace here so we can inspect it.
bigzed
Posts: 8
Joined: 2014-11-03T08:30:07-07:00
Authentication code: 6789

Re: Compiling on Centos 7

Post by bigzed »

They do fail in the same way here is the gdb output:

Code: Select all

$ ./utilities/mogrify 
Illegal instruction (core dumped)
$ gdb utilities/mogrify 
\GNU gdb (GDB) Red Hat Enterprise Linux 7.6.1-51.el7
Copyright (C) 2013 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-redhat-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /root/sb4/strawberry4-4.5.99/data/ImageMagick-6.8.9-9/utilities/mogrify...done.
(gdb) run
Starting program: /root/sb4/strawberry4-4.5.99/data/ImageMagick-6.8.9-9/utilities/mogrify 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".

Program received signal SIGILL, Illegal instruction.
ElapsedTime () at magick/timer.c:198
198	  return((double) times(&timer)/CLK_TCK);
Missing separate debuginfos, use: debuginfo-install OpenEXR-libs-1.7.1-7.el7.x86_64 freetype-2.4.11-9.el7.x86_64 glibc-2.17-55.el7.x86_64 ilmbase-1.0.3-7.el7.x86_64 jbigkit-libs-2.0-11.el7.x86_64 libX11-1.6.0-2.1.el7.x86_64 libXau-1.0.8-2.1.el7.x86_64 libXext-1.3.2-2.1.el7.x86_64 libgcc-4.8.2-16.2.el7_0.x86_64 libgomp-4.8.2-16.2.el7_0.x86_64 libjpeg-turbo-1.2.90-5.el7.x86_64 libpng-1.5.13-5.el7.x86_64 libstdc++-4.8.2-16.2.el7_0.x86_64 libtiff-4.0.3-14.el7.x86_64 libxcb-1.9-5.el7.x86_64 libxml2-2.9.1-5.el7_0.1.x86_64 xz-libs-5.1.2-8alpha.el7.x86_64 zlib-1.2.7-13.el7.x86_64
(gdb) where
#0  ElapsedTime () at magick/timer.c:198
#1  0x0000000000452bb5 in StartTimer (time_info=time_info@entry=0xa82860, reset=reset@entry=MagickTrue) at magick/timer.c:383
#2  0x0000000000452c53 in GetTimerInfo (time_info=time_info@entry=0xa82860) at magick/timer.c:274
#3  0x000000000041dbcd in LoadLogCache (log_cache=log_cache@entry=0xa82690, xml=<optimized out>, 
    filename=filename@entry=0xa83de0 "/opt/sb4/stage/etc/ImageMagick-6/log.xml", depth=depth@entry=0, 
    exception=exception@entry=0xa824d0) at magick/log.c:1528
#4  0x000000000041e1a6 in AcquireLogCache (filename=0x6c3349 "log.xml", exception=0xa824d0) at magick/log.c:280
#5  IsLogCacheInstantiated (exception=0xa824d0) at magick/log.c:659
#6  GetLogInfo (exception=exception@entry=0xa824d0, name=0x6c40f3 "*") at magick/log.c:392
#7  0x000000000041e44b in LogComponentGenesis () at magick/log.c:828
#8  0x000000000042144b in MagickCoreGenesis (
    path=0x7fffffffe7a4 "/root/sb4/strawberry4-4.5.99/data/ImageMagick-6.8.9-9/utilities/mogrify", 
    establish_signal_handlers=establish_signal_handlers@entry=MagickTrue) at magick/magick.c:1251
#9  0x000000000040e96e in MogrifyMain (argv=0x7fffffffe578, argc=1) at utilities/mogrify.c:74
#10 main (argc=1, argv=0x7fffffffe578) at utilities/mogrify.c:88
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Compiling on Centos 7

Post by magick »

Edit magick/magick-baseconfig.h and undefine MAGICKCORE_HAVE_TIMES:

Code: Select all

#ifndef MAGICKCORE_HAVE_TIMES
#undef MAGICKCORE_HAVE_TIMES
#endif
Now build and rerun convert / mogrify. Does it work now?
bigzed
Posts: 8
Joined: 2014-11-03T08:30:07-07:00
Authentication code: 6789

Re: Compiling on Centos 7

Post by bigzed »

I changed this

Code: Select all

#ifndef MAGICK_HAVE_TIMES
#define MAGICK_HAVE_TIMES 1
#endif
to

Code: Select all

#ifdef MAGICK_HAVE_TIMES
#undef MAGICK_HAVE_TIMES
#endif
then I ran

Code: Select all

$ make 
$ ./utilities/mogrify
Illegal instruction (core dumped)
So it still doesn't work.
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Compiling on Centos 7

Post by magick »

We'll need a stack trace before we can comment.
bigzed
Posts: 8
Joined: 2014-11-03T08:30:07-07:00
Authentication code: 6789

Re: Compiling on Centos 7

Post by bigzed »

Code: Select all

GNU gdb (GDB) Red Hat Enterprise Linux 7.6.1-51.el7
Copyright (C) 2013 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-redhat-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /root/sb4/strawberry4-4.5.99/data/ImageMagick-6.8.9-9/utilities/mogrify...done.
(gdb) run
Starting program: /root/sb4/strawberry4-4.5.99/data/ImageMagick-6.8.9-9/utilities/mogrify 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".

Program received signal SIGILL, Illegal instruction.
0x00000000004527d3 in ElapsedTime () at magick/timer.c:203
203	  return((double) clock()/CLK_TCK);
Missing separate debuginfos, use: debuginfo-install OpenEXR-libs-1.7.1-7.el7.x86_64 freetype-2.4.11-9.el7.x86_64 glibc-2.17-55.el7.x86_64 ilmbase-1.0.3-7.el7.x86_64 jbigkit-libs-2.0-11.el7.x86_64 libX11-1.6.0-2.1.el7.x86_64 libXau-1.0.8-2.1.el7.x86_64 libXext-1.3.2-2.1.el7.x86_64 libgcc-4.8.2-16.2.el7_0.x86_64 libgomp-4.8.2-16.2.el7_0.x86_64 libjpeg-turbo-1.2.90-5.el7.x86_64 libpng-1.5.13-5.el7.x86_64 libstdc++-4.8.2-16.2.el7_0.x86_64 libtiff-4.0.3-14.el7.x86_64 libxcb-1.9-5.el7.x86_64 libxml2-2.9.1-5.el7_0.1.x86_64 xz-libs-5.1.2-8alpha.el7.x86_64 zlib-1.2.7-13.el7.x86_64
(gdb) where
#0  0x00000000004527d3 in ElapsedTime () at magick/timer.c:203
#1  0x0000000000452b25 in StartTimer (time_info=time_info@entry=0xa82860, reset=reset@entry=MagickTrue) at magick/timer.c:383
#2  0x0000000000452bc3 in GetTimerInfo (time_info=time_info@entry=0xa82860) at magick/timer.c:274
#3  0x000000000041db7d in LoadLogCache (log_cache=log_cache@entry=0xa82690, xml=<optimized out>, 
    filename=filename@entry=0xa83de0 "/opt/sb4/stage/etc/ImageMagick-6/log.xml", depth=depth@entry=0, 
    exception=exception@entry=0xa824d0) at magick/log.c:1528
#4  0x000000000041e156 in AcquireLogCache (filename=0x6c32a9 "log.xml", exception=0xa824d0) at magick/log.c:280
#5  IsLogCacheInstantiated (exception=0xa824d0) at magick/log.c:659
#6  GetLogInfo (exception=exception@entry=0xa824d0, name=0x6c4053 "*") at magick/log.c:392
#7  0x000000000041e3fb in LogComponentGenesis () at magick/log.c:828
#8  0x00000000004213fb in MagickCoreGenesis (
    path=0x7fffffffe7a4 "/root/sb4/strawberry4-4.5.99/data/ImageMagick-6.8.9-9/utilities/mogrify", 
    establish_signal_handlers=establish_signal_handlers@entry=MagickTrue) at magick/magick.c:1251
#9  0x000000000040e91e in MogrifyMain (argv=0x7fffffffe578, argc=1) at utilities/mogrify.c:74
#10 main (argc=1, argv=0x7fffffffe578) at utilities/mogrify.c:88
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Compiling on Centos 7

Post by magick »

Change CLK_TCK to CLOCKS_PER_SEC. Does that fix the problem?
bigzed
Posts: 8
Joined: 2014-11-03T08:30:07-07:00
Authentication code: 6789

Re: Compiling on Centos 7

Post by bigzed »

Where do I have to change this? In magick/magick-baseconfig.h is no such line as CLK_TCK. The only file I found something like this is timer.c and this one contains already.

Code: Select all

#define CLK_TCK CLOCKS_PER_SEC
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Compiling on Centos 7

Post by magick »

We applied the patch to ImageMagick 6.9.0-0 Beta @ http://www.imagemagick.org/download/beta. Let us know if 6.9.0-0 fixes the problem.
bigzed
Posts: 8
Joined: 2014-11-03T08:30:07-07:00
Authentication code: 6789

Re: Compiling on Centos 7

Post by bigzed »

I downloaded http://www.imagemagick.org/download/bet ... -0.tar.bz2 and recompiled it like this:

Code: Select all

$ ./configure --disable-shared
$ make
$ cp */*.xml .
$ ./utilities/mogrify
Illegal instruction (core dumped)
gdb output:

Code: Select all

GNU gdb (GDB) Red Hat Enterprise Linux 7.6.1-51.el7
Copyright (C) 2013 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-redhat-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /root/stage/ImageMagick-6.9.0-0/utilities/mogrify...done.
(gdb) run
Starting program: /root/stage/ImageMagick-6.9.0-0/utilities/mogrify 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".

Program received signal SIGILL, Illegal instruction.
0x00000000004122a1 in ThrowMagickExceptionList (exception=0xa844d0, 
    module=0x7c6d72 "magick/configure.c", 
    function=0x7c6ee0 <__func__.10485> "GetConfigureOptions", line=706, severity=ConfigureWarning, 
    tag=<optimized out>, format=format@entry=0x7d39fd "`%s'", 
    operands=operands@entry=0x7fffffffb318) at magick/exception.c:1040
1040	  (void) FormatLocaleString(message,MaxTextExtent,"%s @ %s/%s/%s/%.20g",reason,
Missing separate debuginfos, use: debuginfo-install OpenEXR-libs-1.7.1-7.el7.x86_64 freetype-2.4.11-9.el7.x86_64 glibc-2.17-55.el7.x86_64 ilmbase-1.0.3-7.el7.x86_64 jbigkit-libs-2.0-11.el7.x86_64 libX11-1.6.0-2.1.el7.x86_64 libXau-1.0.8-2.1.el7.x86_64 libXext-1.3.2-2.1.el7.x86_64 libgcc-4.8.2-16.2.el7_0.x86_64 libgomp-4.8.2-16.2.el7_0.x86_64 libjpeg-turbo-1.2.90-5.el7.x86_64 libpng-1.5.13-5.el7.x86_64 libstdc++-4.8.2-16.2.el7_0.x86_64 libtiff-4.0.3-14.el7.x86_64 libxcb-1.9-5.el7.x86_64 libxml2-2.9.1-5.el7_0.1.x86_64 xz-libs-5.1.2-8alpha.el7.x86_64 zlib-1.2.7-13.el7.x86_64
(gdb) where
#0  0x00000000004122a1 in ThrowMagickExceptionList (exception=0xa844d0, 
    module=0x7c6d72 "magick/configure.c", 
    function=0x7c6ee0 <__func__.10485> "GetConfigureOptions", line=706, severity=ConfigureWarning, 
    tag=<optimized out>, format=format@entry=0x7d39fd "`%s'", 
    operands=operands@entry=0x7fffffffb318) at magick/exception.c:1040
#1  0x0000000000411ddf in ThrowMagickException (exception=exception@entry=0xa844d0, 
    module=module@entry=0x7c6d72 "magick/configure.c", 
    function=function@entry=0x7c6ee0 <__func__.10485> "GetConfigureOptions", line=line@entry=706, 
    severity=severity@entry=ConfigureWarning, tag=tag@entry=0x7c6ded "UnableToOpenConfigureFile", 
    format=format@entry=0x7d39fd "`%s'") at magick/exception.c:1057
#2  0x0000000000583e34 in GetConfigureOptions (filename=filename@entry=0x6c4ac9 "log.xml", 
    exception=exception@entry=0xa844d0) at magick/configure.c:706
#3  0x000000000041e147 in AcquireLogCache (filename=0x6c4ac9 "log.xml", exception=0xa844d0)
    at magick/log.c:276
#4  IsLogCacheInstantiated (exception=0xa844d0) at magick/log.c:659
#5  GetLogInfo (exception=exception@entry=0xa844d0, name=0x6c5873 "*") at magick/log.c:392
#6  0x000000000041e42b in LogComponentGenesis () at magick/log.c:828
#7  0x000000000042142b in MagickCoreGenesis (
    path=0x7fffffffe7e2 "/root/stage/ImageMagick-6.9.0-0/utilities/mogrify", 
    establish_signal_handlers=establish_signal_handlers@entry=MagickTrue) at magick/magick.c:1251
#8  0x000000000040e90e in MogrifyMain (argv=0x7fffffffe5b8, argc=1) at utilities/mogrify.c:74
#9  main (argc=1, argv=0x7fffffffe5b8) at utilities/mogrify.c:88
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Compiling on Centos 7

Post by magick »

Once again its failing in a system call. As before, ImageMagick 6.9.0-0 works for us. We're using gcc version 4.8.2 20140120 and CentOS 7.0.1406. The ldd mogrify command returns:
  • ldd utilities//mogrify
    linux-vdso.so.1 => (0x00007fffd7bfe000)
    libgomp.so.1 => /lib64/libgomp.so.1 (0x00007fba885c9000)
    libm.so.6 => /lib64/libm.so.6 (0x00007fba882c6000)
    libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00007fba880b0000)
    libpthread.so.0 => /lib64/libpthread.so.0 (0x00007fba87e94000)
    libc.so.6 => /lib64/libc.so.6 (0x00007fba87ad2000)
    /lib64/ld-linux-x86-64.so.2 (0x00007fba887e1000)
Unless we can reproduce the problem, we will be unable to offer any additional help.
bigzed
Posts: 8
Joined: 2014-11-03T08:30:07-07:00
Authentication code: 6789

Re: Compiling on Centos 7

Post by bigzed »

I'm using gcc 4.8.2 20140120 and CentOs 7.0.1406. ldd mogrify returns:

Code: Select all

$ ldd utilities/mogrify
linux-vdso.so.1 =>  (0x00007fffcc97d000)
libtiff.so.5 => /lib64/libtiff.so.5 (0x00007fad863fc000)
libfreetype.so.6 => /lib64/libfreetype.so.6 (0x00007fad86157000)
libjpeg.so.62 => /lib64/libjpeg.so.62 (0x00007fad85f01000)
libpng15.so.15 => /lib64/libpng15.so.15 (0x00007fad85cd6000)
libXext.so.6 => /lib64/libXext.so.6 (0x00007fad85ac4000)
liblzma.so.5 => /lib64/liblzma.so.5 (0x00007fad8589e000)
libIlmImf.so.7 => /lib64/libIlmImf.so.7 (0x00007fad855d6000)
libImath.so.6 => /lib64/libImath.so.6 (0x00007fad853c4000)
libHalf.so.6 => /lib64/libHalf.so.6 (0x00007fad85180000)
libIex.so.6 => /lib64/libIex.so.6 (0x00007fad84f61000)
libIexMath.so.6 => /lib64/libIexMath.so.6 (0x00007fad84d5c000)
libIlmThread.so.6 => /lib64/libIlmThread.so.6 (0x00007fad84b54000)
libxml2.so.2 => /lib64/libxml2.so.2 (0x00007fad847eb000)
libz.so.1 => /lib64/libz.so.1 (0x00007fad845d5000)
libX11.so.6 => /lib64/libX11.so.6 (0x00007fad84296000)
libgomp.so.1 => /lib64/libgomp.so.1 (0x00007fad8407f000)
libm.so.6 => /lib64/libm.so.6 (0x00007fad83d7d000)
libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00007fad83b66000)
libpthread.so.0 => /lib64/libpthread.so.0 (0x00007fad8394a000)
libc.so.6 => /lib64/libc.so.6 (0x00007fad83589000)
libjbig.so.2.0 => /lib64/libjbig.so.2.0 (0x00007fad8337c000)
libstdc++.so.6 => /lib64/libstdc++.so.6 (0x00007fad83075000)
libdl.so.2 => /lib64/libdl.so.2 (0x00007fad82e70000)
libxcb.so.1 => /lib64/libxcb.so.1 (0x00007fad82c4f000)
/lib64/ld-linux-x86-64.so.2 (0x00007fad86685000)
libXau.so.6 => /lib64/libXau.so.6 (0x00007fad82a4a000)
Hopefully it will be fixed by accident then :)
Thanks!
Post Reply