Dashed lines crash in perlmagick

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
martink

Dashed lines crash in perlmagick

Post by martink »

Hi,

When using the stroke-dasharray property of the Draw method, the program crashes.

Repro code:

Code: Select all

use Image::Magick;

my $im = Image::Magick->new( size => '100x100' );
print $im->Get('version'), "\n\n\n";
$im->Read( 'xc:white' );

$im->Draw(
    primitive           => 'Line',
    stroke              => 'black',
    strokewidth         => 10,
    points              => '10,50 90,50',
    'stroke-dasharray'    => [10,5,5],
);

$im->Write('segfault.png');
I'm running on Kubuntu 9.10, however I've seen this behaviour on other Ubuntus and Debian installations as well.

With the vanilla imagemagick (v 6.5.1) and perl that come with (k)ubuntu 9.10 the following is being output:

Output:

Code: Select all

martin@hopla:/data/custom/chartmagick/scripts$ perl test_dash.pl                                                                
ImageMagick 6.5.1-0 2009-08-27 Q16 OpenMP http://www.imagemagick.org                                                            


*** glibc detected *** perl: free(): invalid next size (fast): 0x09c3b158 ***
======= Backtrace: =========                                                 
/lib/tls/i686/cmov/libc.so.6[0xd05ff1]                                       
/lib/tls/i686/cmov/libc.so.6[0xd076f2]                                       
/lib/tls/i686/cmov/libc.so.6(cfree+0x6d)[0xd0a79d]                           
/usr/lib/libMagickCore.so.2(RelinquishMagickMemory+0x22)[0x3b3ba2]           
/usr/lib/libMagickCore.so.2(DestroyDrawInfo+0x158)[0x355a08]                 
/usr/lib/perl5/auto/Image/Magick/Magick.so(XS_Image__Magick_Mogrify+0x18cf)[0x146a9f]
perl(Perl_pp_entersub+0x570)[0x80b12c0]                                              
perl(Perl_runops_standard+0x18)[0x80af688]                                           
perl(perl_run+0x342)[0x80adbb2]                                                      
perl(main+0xed)[0x8063ffd]                                                           
/lib/tls/i686/cmov/libc.so.6(__libc_start_main+0xe6)[0xcb1b56]                       
perl[0x8063e71]                                                                      
======= Memory map: ========                                                         
00110000-00154000 r-xp 00000000 08:01 172077     /usr/lib/perl5/auto/Image/Magick/Magick.so
00154000-00155000 r--p 00043000 08:01 172077     /usr/lib/perl5/auto/Image/Magick/Magick.so
00155000-0015d000 rw-p 00044000 08:01 172077     /usr/lib/perl5/auto/Image/Magick/Magick.so
0015d000-0026c000 r-xp 00000000 08:01 605035     /usr/lib/libMagickWand.so.2.0.0           
0026c000-0026d000 r--p 0010e000 08:01 605035     /usr/lib/libMagickWand.so.2.0.0           
0026d000-0026f000 rw-p 0010f000 08:01 605035     /usr/lib/libMagickWand.so.2.0.0           
0026f000-00291000 r-xp 00000000 08:01 108694     /usr/lib/libjpeg.so.62.0.0                
00291000-00292000 r--p 00021000 08:01 108694     /usr/lib/libjpeg.so.62.0.0                
00292000-00293000 rw-p 00022000 08:01 108694     /usr/lib/libjpeg.so.62.0.0                
00293000-00295000 r-xp 00000000 08:01 109012     /usr/lib/libXau.so.6.0.0                  
00295000-00296000 r--p 00001000 08:01 109012     /usr/lib/libXau.so.6.0.0                  
00296000-00297000 rw-p 00002000 08:01 109012     /usr/lib/libXau.so.6.0.0                  
00297000-0029a000 r-xp 00000000 08:01 65571      /lib/libuuid.so.1.3.0                     
0029a000-0029b000 r--p 00002000 08:01 65571      /lib/libuuid.so.1.3.0                     
0029b000-0029c000 rw-p 00003000 08:01 65571      /lib/libuuid.so.1.3.0                     
0029c000-002b8000 r-xp 00000000 08:01 109015     /usr/lib/libxcb.so.1.1.0                  
002b8000-002b9000 r--p 0001c000 08:01 109015     /usr/lib/libxcb.so.1.1.0                  
002b9000-002ba000 rw-p 0001d000 08:01 109015     /usr/lib/libxcb.so.1.1.0                  
002bc000-002be000 r-xp 00000000 08:01 645911     /lib/tls/i686/cmov/libdl-2.10.1.so        
002be000-002bf000 r--p 00001000 08:01 645911     /lib/tls/i686/cmov/libdl-2.10.1.so        
002bf000-002c0000 rw-p 00002000 08:01 645911     /lib/tls/i686/cmov/libdl-2.10.1.so        
002c0000-00492000 r-xp 00000000 08:01 115782     /usr/lib/libMagickCore.so.2.0.0           
00492000-00497000 r--p 001d1000 08:01 115782     /usr/lib/libMagickCore.so.2.0.0           
00497000-004dc000 rw-p 001d6000 08:01 115782     /usr/lib/libMagickCore.so.2.0.0           
004dc000-004f4000 rw-p 00000000 00:00 0                                                    
004f4000-0056e000 r-xp 00000000 08:01 110048     /usr/lib/libfreetype.so.6.3.20            
0056e000-00572000 r--p 00079000 08:01 110048     /usr/lib/libfreetype.so.6.3.20            
00572000-00573000 rw-p 0007d000 08:01 110048     /usr/lib/libfreetype.so.6.3.20            
00573000-006cc000 r-xp 00000000 08:01 107630     /usr/lib/libperl.so.5.10.0                
006cc000-006ce000 r--p 00159000 08:01 107630     /usr/lib/libperl.so.5.10.0                
006ce000-006d1000 rw-p 0015b000 08:01 107630     /usr/lib/libperl.so.5.10.0                
006d1000-00727000 r-xp 00000000 08:01 106487     /usr/lib/libtiff.so.4.2.1                 
00727000-00729000 r--p 00055000 08:01 106487     /usr/lib/libtiff.so.4.2.1                 
00729000-0072a000 rw-p 00057000 08:01 106487     /usr/lib/libtiff.so.4.2.1                 
00777000-0078e000 r-xp 00000000 08:01 108427     /usr/lib/libICE.so.6.3.0                  
0078e000-0078f000 r--p 00016000 08:01 108427     /usr/lib/libICE.so.6.3.0                  
0078f000-00790000 rw-p 00017000 08:01 108427     /usr/lib/libICE.so.6.3.0                  
00790000-00792000 rw-p 00000000 00:00 0                                                    
007b3000-007ba000 r-xp 00000000 08:01 106346     /usr/lib/libSM.so.6.0.0                   
007ba000-007bb000 r--p 00006000 08:01 106346     /usr/lib/libSM.so.6.0.0                   
007bb000-007bc000 rw-p 00007000 08:01 106346     /usr/lib/libSM.so.6.0.0                   
007c9000-007dd000 r-xp 00000000 08:01 65709      /lib/libz.so.1.2.3.3                      
007dd000-007de000 r--p 00013000 08:01 65709      /lib/libz.so.1.2.3.3                      
007de000-007df000 rw-p 00014000 08:01 65709      /lib/libz.so.1.2.3.3                      
007df000-0082e000 r-xp 00000000 08:01 106488     /usr/lib/libXt.so.6.0.0                   
0082e000-0082f000 r--p 0004f000 08:01 106488     /usr/lib/libXt.so.6.0.0                   
0082f000-00832000 rw-p 00050000 08:01 106488     /usr/lib/libXt.so.6.0.0
00890000-008c0000 r-xp 00000000 08:01 109218     /usr/lib/liblcms.so.1.0.18
008c0000-008c1000 r--p 0002f000 08:01 109218     /usr/lib/liblcms.so.1.0.18
008c1000-008c2000 rw-p 00030000 08:01 109218     /usr/lib/liblcms.so.1.0.18
008c2000-008c4000 rw-p 00000000 00:00 0
008c4000-009ee000 r-xp 00000000 08:01 106603     /usr/lib/libX11.so.6.2.0
009ee000-009ef000 ---p 0012a000 08:01 106603     /usr/lib/libX11.so.6.2.0
009ef000-009f0000 r--p 0012a000 08:01 106603     /usr/lib/libX11.so.6.2.0
009f0000-009f2000 rw-p 0012b000 08:01 106603     /usr/lib/libX11.so.6.2.0
009f2000-009f3000 rw-p 00000000 00:00 0
009fc000-00a08000 r-xp 00000000 08:01 107420     /usr/lib/libgomp.so.1.0.0
00a08000-00a09000 r--p 0000b000 08:01 107420     /usr/lib/libgomp.so.1.0.0
00a09000-00a0a000 rw-p 0000c000 08:01 107420     /usr/lib/libgomp.so.1.0.0
00a1b000-00a2b000 r-xp 00000000 08:01 65781      /lib/libbz2.so.1.0.4
00a2b000-00a2c000 r--p 0000f000 08:01 65781      /lib/libbz2.so.1.0.4
00a2c000-00a2d000 rw-p 00010000 08:01 65781      /lib/libbz2.so.1.0.4
00a32000-00a40000 r-xp 00000000 08:01 106290     /usr/lib/libXext.so.6.4.0
00a40000-00a41000 r--p 0000d000 08:01 106290     /usr/lib/libXext.so.6.4.0
00a41000-00a42000 rw-p 0000e000 08:01 106290     /usr/lib/libXext.so.6.4.0
00aa7000-00abc000 r-xp 00000000 08:01 645922     /lib/tls/i686/cmov/libpthread-2.10.1.so
00abc000-00abd000 r--p 00014000 08:01 645922     /lib/tls/i686/cmov/libpthread-2.10.1.so
00abd000-00abe000 rw-p 00015000 08:01 645922     /lib/tls/i686/cmov/libpthread-2.10.1.so
00abe000-00ac0000 rw-p 00000000 00:00 0
00ad5000-00add000 r-xp 00000000 08:01 107423     /usr/lib/libltdl.so.7.2.0
00add000-00ade000 r--p 00007000 08:01 107423     /usr/lib/libltdl.so.7.2.0
00ade000-00adf000 rw-p 00008000 08:01 107423     /usr/lib/libltdl.so.7.2.0
00afd000-00b21000 r-xp 00000000 08:01 645912     /lib/tls/i686/cmov/libm-2.10.1.so
00b21000-00b22000 r--p 00023000 08:01 645912     /lib/tls/i686/cmov/libm-2.10.1.so
00b22000-00b23000 rw-p 00024000 08:01 645912     /lib/tls/i686/cmov/libm-2.10.1.so
00b3f000-00b5b000 r-xp 00000000 08:01 65413      /lib/libgcc_s.so.1
00b5b000-00b5c000 r--p 0001b000 08:01 65413      /lib/libgcc_s.so.1
00b5c000-00b5d000 rw-p 0001c000 08:01 65413      /lib/libgcc_s.so.1
00c4f000-00c56000 r-xp 00000000 08:01 645924     /lib/tls/i686/cmov/librt-2.10.1.so
00c56000-00c57000 r--p 00006000 08:01 645924     /lib/tls/i686/cmov/librt-2.10.1.so
00c57000-00c58000 rw-p 00007000 08:01 645924     /lib/tls/i686/cmov/librt-2.10.1.so
00c5c000-00c77000 r-xp 00000000 08:01 70861      /lib/ld-2.10.1.so
00c77000-00c78000 r--p 0001a0Aborted
martin@hopla:/data/custom/chartmagick/scripts$
No file is saved in this case. When setting MALLOC_CHECK_=1 in my environment (so the free error won't crash the program, but rather puts out a warning message instead) an image is saved and the line is dashed, and the following output is generated:

Code: Select all

martin@hopla:/data/custom/chartmagick/scripts$ export MALLOC_CHECK_=1
martin@hopla:/data/custom/chartmagick/scripts$ perl test_dash.pl
ImageMagick 6.5.1-0 2009-08-27 Q16 OpenMP http://www.imagemagick.org


*** glibc detected *** perl: free(): invalid pointer: 0x08d94f80 ***
martin@hopla:/data/custom/chartmagick/scripts$
For a custom compiled Imagemagick (version 6.5.7-10) on the same system I get the same error:

Code: Select all

martin@hopla:/data/custom/chartmagick/scripts$ perl test_dash.pl                           
ImageMagick 6.5.7-10 2009-11-25 Q16 http://www.imagemagick.org                             


*** glibc detected *** perl: free(): invalid next size (fast): 0x0840c290 ***
======= Backtrace: =========                                                 
/lib/tls/i686/cmov/libc.so.6[0x17aff1]                                       
/lib/tls/i686/cmov/libc.so.6[0x17c6f2]                                       
/lib/tls/i686/cmov/libc.so.6(cfree+0x6d)[0x17f79d]                           
/data/wre/prereqs/lib/libMagickCore.so.2(RelinquishMagickMemory+0x22)[0x469332]
/data/wre/prereqs/lib/libMagickCore.so.2(DestroyDrawInfo+0x158)[0x4046d8]      
/data/wre/prereqs/lib/perl5/site_perl/5.10.1/i686-linux/auto/Image/Magick/Magick.so(XS_Image__Magick_Mogrify+0x5e34)[0xc36fb4]
perl(Perl_pp_entersub+0x592)[0x80c76f2]                                                                                       
perl(Perl_runops_standard+0x13)[0x80c5c43]                                                                                    
perl(perl_run+0x2bd)[0x807715d]                                                                                               
perl(main+0xc5)[0x80628e5]                                                                                                    
/lib/tls/i686/cmov/libc.so.6(__libc_start_main+0xe6)[0x126b56]                                                                
perl[0x8062781]                                                                                                               
======= Memory map: ========                                                                                                  
00110000-0024e000 r-xp 00000000 08:01 645908     /lib/tls/i686/cmov/libc-2.10.1.so                                            
0024e000-00250000 r--p 0013e000 08:01 645908     /lib/tls/i686/cmov/libc-2.10.1.so                                            
00250000-00251000 rw-p 00140000 08:01 645908     /lib/tls/i686/cmov/libc-2.10.1.so                                            
00251000-00254000 rw-p 00000000 00:00 0                                                                                       
00254000-00284000 r-xp 00000000 08:01 12818      /data/wre/prereqs/lib/liblcms.so.1.0.18                                      
00284000-00285000 r--p 0002f000 08:01 12818      /data/wre/prereqs/lib/liblcms.so.1.0.18                                      
00285000-00286000 rw-p 00030000 08:01 12818      /data/wre/prereqs/lib/liblcms.so.1.0.18                                      
00286000-00288000 rw-p 00000000 00:00 0                                                                                       
00288000-002d1000 r-xp 00000000 08:01 12846      /data/wre/prereqs/lib/libtiff.so.3.8.2                                       
002d1000-002d3000 r--p 00048000 08:01 12846      /data/wre/prereqs/lib/libtiff.so.3.8.2                                       
002d3000-002d4000 rw-p 0004a000 08:01 12846      /data/wre/prereqs/lib/libtiff.so.3.8.2                                       
002ea000-0035f000 r-xp 00000000 08:01 12861      /data/wre/prereqs/lib/libfreetype.so.6.3.22                                  
0035f000-00363000 r--p 00075000 08:01 12861      /data/wre/prereqs/lib/libfreetype.so.6.3.22                                  
00363000-00364000 rw-p 00079000 08:01 12861      /data/wre/prereqs/lib/libfreetype.so.6.3.22                                  
00364000-00379000 r-xp 00000000 08:01 645922     /lib/tls/i686/cmov/libpthread-2.10.1.so                                      
00379000-0037a000 r--p 00014000 08:01 645922     /lib/tls/i686/cmov/libpthread-2.10.1.so                                      
0037a000-0037b000 rw-p 00015000 08:01 645922     /lib/tls/i686/cmov/libpthread-2.10.1.so                                      
0037b000-0037d000 rw-p 00000000 00:00 0                                                                                       
0038d000-004fc000 r-xp 00000000 08:01 12814      /data/wre/prereqs/lib/libMagickCore.so.2.0.1                                 
004fc000-00506000 r--p 0016e000 08:01 12814      /data/wre/prereqs/lib/libMagickCore.so.2.0.1                                 
00506000-0050c000 rw-p 00178000 08:01 12814      /data/wre/prereqs/lib/libMagickCore.so.2.0.1                                 
0050c000-0053f000 r-xp 00000000 08:01 12917      /data/wre/prereqs/lib/libjpeg.so.7.0.0                                       
0053f000-00540000 ---p 00033000 08:01 12917      /data/wre/prereqs/lib/libjpeg.so.7.0.0                                       
00540000-00541000 r--p 00033000 08:01 12917      /data/wre/prereqs/lib/libjpeg.so.7.0.0                                       
00541000-00542000 rw-p 00034000 08:01 12917      /data/wre/prereqs/lib/libjpeg.so.7.0.0                                       
0054b000-00552000 r-xp 00000000 08:01 645924     /lib/tls/i686/cmov/librt-2.10.1.so                                           
00552000-00553000 r--p 00006000 08:01 645924     /lib/tls/i686/cmov/librt-2.10.1.so                                           
00553000-00554000 rw-p 00007000 08:01 645924     /lib/tls/i686/cmov/librt-2.10.1.so                                           
00554000-00570000 r-xp 00000000 08:01 65413      /lib/libgcc_s.so.1                                                           
00570000-00571000 r--p 0001b000 08:01 65413      /lib/libgcc_s.so.1                                                           
00571000-00572000 rw-p 0001c000 08:01 65413      /lib/libgcc_s.so.1                                                           
00594000-00596000 r-xp 00000000 08:01 645911     /lib/tls/i686/cmov/libdl-2.10.1.so
00596000-00597000 r--p 00001000 08:01 645911     /lib/tls/i686/cmov/libdl-2.10.1.so
00597000-00598000 rw-p 00002000 08:01 645911     /lib/tls/i686/cmov/libdl-2.10.1.so
0074b000-00754000 r-xp 00000000 08:01 645910     /lib/tls/i686/cmov/libcrypt-2.10.1.so
00754000-00755000 r--p 00008000 08:01 645910     /lib/tls/i686/cmov/libcrypt-2.10.1.so
00755000-00756000 rw-p 00009000 08:01 645910     /lib/tls/i686/cmov/libcrypt-2.10.1.so
00756000-0077d000 rw-p 00000000 00:00 0
0077e000-00799000 r-xp 00000000 08:01 70861      /lib/ld-2.10.1.so
00799000-0079a000 r--p 0001a000 08:01 70861      /lib/ld-2.10.1.so
0079a000-0079b000 rw-p 0001b000 08:01 70861      /lib/ld-2.10.1.so
009da000-009e6000 r-xp 00000000 08:01 107420     /usr/lib/libgomp.so.1.0.0
009e6000-009e7000 r--p 0000b000 08:01 107420     /usr/lib/libgomp.so.1.0.0
009e7000-009e8000 rw-p 0000c000 08:01 107420     /usr/lib/libgomp.so.1.0.0
00a36000-00a49000 r-xp 00000000 08:01 12909      /data/wre/prereqs/lib/libz.so.1.2.3
00a49000-00a4a000 r--p 00012000 08:01 12909      /data/wre/prereqs/lib/libz.so.1.2.3
00a4a000-00a4b000 rw-p 00013000 08:01 12909      /data/wre/prereqs/lib/libz.so.1.2.3
00aa2000-00aa3000 r-xp 00000000 08:01 510334     /data/wre/prereqs/lib/ImageMagick-6.5.7/modules-Q16/coders/xc.so
00aa3000-00aa4000 r--p 00001000 08:01 510334     /data/wre/prereqs/lib/ImageMagick-6.5.7/modules-Q16/coders/xc.so
00aa4000-00aa5000 rw-p 00002000 08:01 510334     /data/wre/prereqs/lib/ImageMagick-6.5.7/modules-Q16/coders/xc.so
00c02000-00c3f000 r-xp 00000000 08:01 696572     /data/wre/prereqs/lib/perl5/site_perl/5.10.1/i686-linux/auto/Image/Magick/Magick.so
00c3f000-00c40000 r--p 0003c000 08:01 696572     /data/wre/prereqs/lib/perl5/site_perl/5.10.1/i686-linux/auto/Image/Magick/Magick.so
00c40000-00c49000 rw-p 0003d000 08:01 696572     /data/wre/prereqs/lib/perl5/site_perl/5.10.1/i686-linux/auto/Image/Magick/Magick.so
00cef000-00d13000 r-xp 00000000 08:01 645912     /lib/tls/i686/cmov/libm-2.10.1.so
00d13000-00d14000 r--p 00023000 08:01 645912     /lib/tls/i686/cmov/libm-2.10.1.so
00d14000-00d15000 rw-p 00024000 08:01 645912     /lib/tls/i686/cmov/libm-2.10.1.so
00dae000-00db0000 r-xp 00000000 08:01 645927     /lib/tls/i686/cmov/libutil-2.10.1.so
00db0000-00db1000 r--p 00001000 08:01 645927     /lib/tls/i686/cmov/libutil-2.10.1.so
00db1000-00db2000 rw-p 00002000 08:01 645927     /lib/tls/i686/cmov/libutil-2.10.1.so
00dcc000-00dd4000 r-xp 00000000 08:01 12830      /data/wre/prereqs/lib/libltdl.so.7.2.0
00dd4000-00dd5000 r--p 00007000 08:01 12830      /data/wre/prereqs/lib/libltdl.so.7.2.0
00dd5000-00dd6000 rw-p 00008000 08:01 12830      /data/wre/prereqs/lib/libltdl.so.7.2.0
00ded000-00dee000 r-xp 00000000 00:00 0          [vdso]
00eaf000-00ec2000 r-xp 00000000 08:01 645914     /lib/tls/i686/cmov/libnsl-2.10.1.so
00ec2000-00ec3000 r--p 00012000 08:01 645914     /lib/tls/i686/cmov/libnsl-2.10.1.so
00ec3000-00ec4000 rw-p 00013000 08:01 645914     /lib/tls/i686/cmov/libnsl-2.10.1.so
00ec4000-00ec6000 rw-p 00000000 00:00 0
08048000-08154000 r-xp 00000000 08:01 11234      /data/wre/prereqs/bin/perlAborted
martin@hopla:/data/custom/chartmagick/scripts$
Note that the perlmagick part of this imagemagick install is built against a custom perl (5.10.1) on the same system.

With MALLOC_CHECK_=1 exported into the envronment, the following gets output:

Code: Select all

martin@hopla:/data/custom/chartmagick/scripts$ export MALLOC_CHECK_=1
martin@hopla:/data/custom/chartmagick/scripts$ perl test_dash.pl
ImageMagick 6.5.7-10 2009-11-25 Q16 http://www.imagemagick.org


*** glibc detected *** perl: free(): invalid pointer: 0x08f53160 ***
*** glibc detected *** perl: free(): invalid pointer: 0x08f53180 ***
Segmentation fault
martin@hopla:/data/custom/chartmagick/scripts$
In this case a file is saved saved as well. The dashing is correct too. However, there are now two free() errors and a segfault is reported.

Related to this issue I found this, which may be of help: http://studio.imagemagick.org/pipermail ... 20888.html

If you need any additional information, or any other tests I can perform, please let me know.

Regards,
Martin Kamerbeek
http://www.oqapi.nl
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Dashed lines crash in perlmagick

Post by magick »

We can reproduce the problem you posted and will have a patch in the next point release of ImageMagick. Thanks.
martink

Re: Dashed lines crash in perlmagick

Post by martink »

Awesome. Thanks a bunch for the superfast reply!

Regards,
Martin Kamerbeek
http://www.oqapi.nl
martink

Re: Dashed lines crash in perlmagick

Post by martink »

I've compiled 6.5.8-6 and tested the with the same test_dash.pl program as above. Unfortunately it still crashes. My guess is that rev 762 was the intented fix for the bug (http://trac.imagemagick.org/changeset/7 ... /Magick.xs). The output is as follows:

Code: Select all

martin@hopla:/data/custom/chartmagick/scripts$ perl test_dash.pl
ImageMagick 6.5.8-6 2009-12-18 Q16 http://www.imagemagick.org   


*** glibc detected *** perl: free(): invalid next size (fast): 0x0a13aea8 ***
======= Backtrace: =========                                                 
/lib/tls/i686/cmov/libc.so.6[0x1dbff1]                                       
/lib/tls/i686/cmov/libc.so.6[0x1dd6f2]                                       
/lib/tls/i686/cmov/libc.so.6(cfree+0x6d)[0x1e079d]                           
/data/wrebuild/source/ImageMagick-6.5.8-6/PerlMagick/../magick/.libs/libMagickCore.so.2(RelinquishMagickMemory+0x22)[0x4d55d2]
/data/wrebuild/source/ImageMagick-6.5.8-6/PerlMagick/../magick/.libs/libMagickCore.so.2(DestroyDrawInfo+0x158)[0x470808]      
/data/wre/prereqs/lib/perl5/site_perl/5.10.1/i686-linux/auto/Image/Magick/Magick.so(XS_Image__Magick_Mogrify+0x5e64)[0xd3c094]
perl(Perl_pp_entersub+0x592)[0x80c7772]                                                                                       
perl(Perl_runops_standard+0x13)[0x80c5cc3]                                                                                    
perl(perl_run+0x2bd)[0x80771dd]                                                                                               
perl(main+0xc5)[0x8062905]                                                                                                    
/lib/tls/i686/cmov/libc.so.6(__libc_start_main+0xe6)[0x187b56]                                                                
perl[0x80627a1]                                                                                                               
======= Memory map: ========                                                                                                  
00110000-00112000 r-xp 00000000 08:01 645911     /lib/tls/i686/cmov/libdl-2.10.1.so                                           
00112000-00113000 r--p 00001000 08:01 645911     /lib/tls/i686/cmov/libdl-2.10.1.so                                           
00113000-00114000 rw-p 00002000 08:01 645911     /lib/tls/i686/cmov/libdl-2.10.1.so                                           
00114000-00147000 r-xp 00000000 08:01 8565       /data/wre/prereqs/lib/libjpeg.so.7.0.0                                       
00147000-00148000 ---p 00033000 08:01 8565       /data/wre/prereqs/lib/libjpeg.so.7.0.0                                       
00148000-00149000 r--p 00033000 08:01 8565       /data/wre/prereqs/lib/libjpeg.so.7.0.0                                       
00149000-0014a000 rw-p 00034000 08:01 8565       /data/wre/prereqs/lib/libjpeg.so.7.0.0                                       
0014a000-00156000 r-xp 00000000 08:01 107420     /usr/lib/libgomp.so.1.0.0                                                    
00156000-00157000 r--p 0000b000 08:01 107420     /usr/lib/libgomp.so.1.0.0                                                    
00157000-00158000 rw-p 0000c000 08:01 107420     /usr/lib/libgomp.so.1.0.0                                                    
00158000-00160000 r-xp 00000000 08:01 12830      /data/wre/prereqs/lib/libltdl.so.7.2.0                                       
00160000-00161000 r--p 00007000 08:01 12830      /data/wre/prereqs/lib/libltdl.so.7.2.0                                       
00161000-00162000 rw-p 00008000 08:01 12830      /data/wre/prereqs/lib/libltdl.so.7.2.0                                       
00162000-00169000 r-xp 00000000 08:01 645924     /lib/tls/i686/cmov/librt-2.10.1.so                                           
00169000-0016a000 r--p 00006000 08:01 645924     /lib/tls/i686/cmov/librt-2.10.1.so                                           
0016a000-0016b000 rw-p 00007000 08:01 645924     /lib/tls/i686/cmov/librt-2.10.1.so                                           
0016b000-0016c000 r-xp 00000000 08:01 543795     /data/wre/prereqs/lib/ImageMagick-6.5.8/modules-Q16/coders/xc.so             
0016c000-0016d000 r--p 00001000 08:01 543795     /data/wre/prereqs/lib/ImageMagick-6.5.8/modules-Q16/coders/xc.so             
0016d000-0016e000 rw-p 00002000 08:01 543795     /data/wre/prereqs/lib/ImageMagick-6.5.8/modules-Q16/coders/xc.so             
00171000-002af000 r-xp 00000000 08:01 645908     /lib/tls/i686/cmov/libc-2.10.1.so                                            
002af000-002b1000 r--p 0013e000 08:01 645908     /lib/tls/i686/cmov/libc-2.10.1.so                                            
002b1000-002b2000 rw-p 00140000 08:01 645908     /lib/tls/i686/cmov/libc-2.10.1.so                                            
002b2000-002b5000 rw-p 00000000 00:00 0                                                                                       
002df000-002e1000 r-xp 00000000 08:01 645927     /lib/tls/i686/cmov/libutil-2.10.1.so                                         
002e1000-002e2000 r--p 00001000 08:01 645927     /lib/tls/i686/cmov/libutil-2.10.1.so                                         
002e2000-002e3000 rw-p 00002000 08:01 645927     /lib/tls/i686/cmov/libutil-2.10.1.so                                         
002e3000-00355000 r-xp 00000000 08:01 11801      /data/wre/prereqs/lib/libfreetype.so.6.3.22                                  
00355000-00359000 r--p 00071000 08:01 11801      /data/wre/prereqs/lib/libfreetype.so.6.3.22                                  
00359000-0035a000 rw-p 00075000 08:01 11801      /data/wre/prereqs/lib/libfreetype.so.6.3.22
003f8000-003f9000 r-xp 00000000 00:00 0          [vdso]
003f9000-00568000 r-xp 00000000 08:01 982637     /data/wrebuild/source/ImageMagick-6.5.8-6/magick/.libs/libMagickCore.so.2.0.1
00568000-00572000 r--p 0016e000 08:01 982637     /data/wrebuild/source/ImageMagick-6.5.8-6/magick/.libs/libMagickCore.so.2.0.1
00572000-00578000 rw-p 00178000 08:01 982637     /data/wrebuild/source/ImageMagick-6.5.8-6/magick/.libs/libMagickCore.so.2.0.1
0079d000-007b2000 r-xp 00000000 08:01 645922     /lib/tls/i686/cmov/libpthread-2.10.1.so
007b2000-007b3000 r--p 00014000 08:01 645922     /lib/tls/i686/cmov/libpthread-2.10.1.so
007b3000-007b4000 rw-p 00015000 08:01 645922     /lib/tls/i686/cmov/libpthread-2.10.1.so
007b4000-007b6000 rw-p 00000000 00:00 0
007d5000-007f1000 r-xp 00000000 08:01 65413      /lib/libgcc_s.so.1
007f1000-007f2000 r--p 0001b000 08:01 65413      /lib/libgcc_s.so.1
007f2000-007f3000 rw-p 0001c000 08:01 65413      /lib/libgcc_s.so.1
008b4000-008c7000 r-xp 00000000 08:01 645914     /lib/tls/i686/cmov/libnsl-2.10.1.so
008c7000-008c8000 r--p 00012000 08:01 645914     /lib/tls/i686/cmov/libnsl-2.10.1.so
008c8000-008c9000 rw-p 00013000 08:01 645914     /lib/tls/i686/cmov/libnsl-2.10.1.so
008c9000-008cb000 rw-p 00000000 00:00 0
008cf000-00921000 r-xp 00000000 08:01 11831      /data/wre/prereqs/lib/libtiff.so.3.8.2
00921000-00923000 r--p 00051000 08:01 11831      /data/wre/prereqs/lib/libtiff.so.3.8.2
00923000-00924000 rw-p 00053000 08:01 11831      /data/wre/prereqs/lib/libtiff.so.3.8.2
00924000-0092d000 r-xp 00000000 08:01 645910     /lib/tls/i686/cmov/libcrypt-2.10.1.so
0092d000-0092e000 r--p 00008000 08:01 645910     /lib/tls/i686/cmov/libcrypt-2.10.1.so
0092e000-0092f000 rw-p 00009000 08:01 645910     /lib/tls/i686/cmov/libcrypt-2.10.1.so
0092f000-00956000 rw-p 00000000 00:00 0
009ff000-00a1a000 r-xp 00000000 08:01 70861      /lib/ld-2.10.1.so
00a1a000-00a1b000 r--p 0001a000 08:01 70861      /lib/ld-2.10.1.so
00a1b000-00a1c000 rw-p 0001b000 08:01 70861      /lib/ld-2.10.1.so
00bf0000-00c20000 r-xp 00000000 08:01 11866      /data/wre/prereqs/lib/liblcms.so.1.0.18
00c20000-00c21000 r--p 0002f000 08:01 11866      /data/wre/prereqs/lib/liblcms.so.1.0.18
00c21000-00c22000 rw-p 00030000 08:01 11866      /data/wre/prereqs/lib/liblcms.so.1.0.18
00c22000-00c24000 rw-p 00000000 00:00 0
00c69000-00c87000 r-xp 00000000 08:01 13224      /data/wre/prereqs/lib/libjpeg.so.62.0.0
00c87000-00c88000 rw-p 0001d000 08:01 13224      /data/wre/prereqs/lib/libjpeg.so.62.0.0
00ca5000-00e34000 r-xp 00000000 08:01 694979     /data/wre/prereqs/lib/perl5/site_perl/5.10.1/i686-linux/auto/Image/Magick/Magick.so
00e34000-00e35000 r--p 0018e000 08:01 694979     /data/wre/prereqs/lib/perl5/site_perl/5.10.1/i686-linux/auto/Image/Magick/Magick.so
00e35000-00e3f000 rw-p 0018f000 08:01 694979     /data/wre/prereqs/lib/perl5/site_perl/5.10.1/i686-linux/auto/Image/Magick/Magick.so
00e3f000-00e40000 rw-p 00000000 00:00 0
00ebd000-00ed0000 r-xp 00000000 08:01 12909      /data/wre/prereqs/lib/libz.so.1.2.3Aborted
martin@hopla:/data/custom/chartmagick/scripts$
Especially note these lines:

Code: Select all

003f9000-00568000 r-xp 00000000 08:01 982637     /data/wrebuild/source/ImageMagick-6.5.8-6/magick/.libs/libMagickCore.so.2.0.1
00568000-00572000 r--p 0016e000 08:01 982637     /data/wrebuild/source/ImageMagick-6.5.8-6/magick/.libs/libMagickCore.so.2.0.1
00572000-00578000 rw-p 00178000 08:01 982637     /data/wrebuild/source/ImageMagick-6.5.8-6/magick/.libs/libMagickCore.so.2.0.1
those are still pointing to libraries inside the build dir. This wasn't the case in 6.5.7-10. I think, though, that this is a separate issue, since the same crash happened in 6.5.7-10 which didn't have the build dir issue. I'll open a separate ticket for that.

Regards,

Martin Kamerbeek
http://www.oqapi.nl
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Dashed lines crash in perlmagick

Post by magick »

We can reproduce the problem you reported. Look for an updated patch in the next point release of ImageMagick. Thanks.
synq

Re: Dashed lines crash in perlmagick

Post by synq »

martink wrote: Especially note these lines:

Code: Select all

003f9000-00568000 r-xp 00000000 08:01 982637     /data/wrebuild/source/ImageMagick-6.5.8-6/magick/.libs/libMagickCore.so.2.0.1
00568000-00572000 r--p 0016e000 08:01 982637     /data/wrebuild/source/ImageMagick-6.5.8-6/magick/.libs/libMagickCore.so.2.0.1
00572000-00578000 rw-p 00178000 08:01 982637     /data/wrebuild/source/ImageMagick-6.5.8-6/magick/.libs/libMagickCore.so.2.0.1
those are still pointing to libraries inside the build dir. This wasn't the case in 6.5.7-10. I think, though, that this is a separate issue, since the same crash happened in 6.5.7-10 which didn't have the build dir issue. I'll open a separate ticket for that.
I see that in 6.5.8-8 in PerlMagick/Makefile.PL on line 140 through 145 are several paths containing the build dir ../magick/.libs which I think causes the crash and is thus a bug:

Code: Select all

# defaults for LIBS & INC & CCFLAGS params that we later pass to Writemakefile
my $INC_magick = '-I../ -I.. -I/data/wre/prereqs/include -I/data/wrebuild/source/ImageMagick-6.5.8-8/magick -I/data/wrebuild/source/ImageMagick-6.5.8-8/wand -I"' . $Config{'usrinc'} . '/ImageMagick"';
my $LIBS_magick = '-L../magick/.libs -lMagickCore -lperl -lm';
my $CCFLAGS_magick = "$Config{'ccflags'} -fopenmp -g -O2 -Wall -W -pthread";
my $LDFLAGS_magick   = "-L../magick/.libs -lMagickCore $Config{'ldflags'} -L/data/wre/prereqs/lib -L/data/wrebuild/source/ImageMagick-6.5.8-8/magick/.libs -L/data/wrebuild/source/ImageMagick-6.5.8-8/magick     -L/data/wrebuild/source/ImageMagick-6.5.8-8/wand/.libs -L/data/wrebuild/source/ImageMagick-6.5.8-8/wand";
my $LDDLFLAGS_magick = "-L../magick/.libs -lMagickCore $Config{'lddlflags'} -L/data/wre/prereqs/lib -L/data/wrebuild/source/ImageMagick-6.5.8-8/magick/.libs -L/data/wrebuild/source/ImageMagick-6.5.8-8/magi    ck -L/data/wrebuild/source/ImageMagick-6.5.8-8/wand/.libs -L/data/wrebuild/source/ImageMagick-6.5.8-8/wand";
Post Reply