Both ia64 and ppc64 have dev-ruby/ruby-gd marked as stable, but the code does not seem to be 64-bit safe. The build output hints at this already: GD.c: In function ‘img_set_interlace’: GD.c:1380: warning: cast to pointer from integer of different size and trying to run the example.rb file in the distribution on amd64 results in this: flame@enterprise ~/devel/hacking/ruby-GD-0.7.4/sample % ruby ./example.rb ./example.rb:16: [BUG] Segmentation fault ruby 1.8.5 (2006-12-25) [x86_64-linux] zsh: abort (core dumped) ruby ./example.rb the backtrace confirms the build output suggestion: 0 0x0000003000e2f7b5 in *__GI_raise (sig=<value optimized out>) at ../nptl/sysdeps/unix/sysv/linux/raise.c:64 #1 0x0000003000e30a4e in *__GI_abort () at abort.c:88 #2 0x0000003041229c70 in rb_bug (fmt=0x30412c435b "Segmentation fault") at error.c:214 #3 0x0000003041298a6a in sigsegv (sig=11) at signal.c:537 #4 <signal handler called> #5 rb_check_type (x=25716344, t=34) at ruby.h:678 #6 0x00002b8a02153d40 in img_set_interlace (img=<value optimized out>, val=2) at GD.c:1380 #7 0x00000030412355bb in rb_call0 (klass=47871731195360, recv=47871731197560, id=19812, oid=19812, argc=<value optimized out>, argv=<value optimized out>, body=0x2b8a018839a0, flags=<value optimized out>) at eval.c:5810 So the package should have likely be marked -amd64 -ia64 -ppc64 rather than ia64 and ppc64 stable.
does work here: markus@G5 ~ $ uname -m ppc64 markus@G5 ~ $ ruby /usr/share/doc/ruby-gd-0.7.4/sample/example.rb > file.png markus@G5 ~ $ and I can open that file.
Compiler version? /me starts to think GCC is crazy.
this is gcc-4.1.1-r3
guess we're out. please CC us again, if you need further information from us.
In ia64 fails, # ruby /usr/share/doc/ruby-gd-0.7.4/sample/example.rb > file.png /usr/share/doc/ruby-gd-0.7.4/sample/example.rb:16: [BUG] Segmentation fault ruby 1.8.5 (2006-12-04) [ia64-linux] Marking -ia64. Closing.
There seems to be a new upstream, so I've reported the problem there as well. See http://rubyforge.org/projects/ruby-gd/
I'm reopening this bug as I found the cause of the segmentation fault. I'm including an updated ebuild and patch to the bug and would be happy to get feedback on this. In particular: does this solve the segmentation fault, and can you create a valid PNG file with the resulting ruby-GD?
Created attachment 116758 [details, diff] Patch to fix segmentation fault with set interlace method
Created attachment 116760 [details] ruby-gd-0.7.4-r1.ebuild
Yup, it works on ia64.
Thanks for the feedback. I have committed the new ebuild and patch to CVS.