Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rmagick 1.15.17 Failed Install on Mac OS X #18

Closed
bf4 opened this issue Jul 24, 2014 · 6 comments
Closed

rmagick 1.15.17 Failed Install on Mac OS X #18

bf4 opened this issue Jul 24, 2014 · 6 comments
Milestone

Comments

@bf4
Copy link
Member

@bf4 bf4 commented Jul 24, 2014

Issue by ylluminate
Thursday Jul 28, 2011 at 18:02 GMT
Originally opened as #31


Attempting to bundle install a Gemfile from ChiliProject and running into an issue with rmagick compilation:

Gemfile: https://gist.github.com/1112118

The error in question appears to be:
rmagick.h:20:20: error: intern.h: No such file or directory

But the chunk that contains this in context is:

---> ext/RMagick
make
gcc -I. -I/Users/username/.rvm/rubies/ruby-1.9.2-p290/include/ruby-1.9.1/x86_64-darwin11.0.0 -I/Users/username/.rvm/rubies/ruby-1.9.2-p290/include/ruby-1.9.1/ruby/backward -I/Users/username/.rvm/rubies/ruby-1.9.2-p290/include/ruby-1.9.1 -I/Volumes/StorageVolume/Users/username/.rvm/gems/ruby-1.9.2-p290/gems/rmagick-1.15.17/ext/RMagick -DRUBY_VERSION=0x192  -I/usr/local/include/ImageMagick -fno-common   -o rmdraw.o -c rmdraw.c
In file included from rmdraw.c:10:
rmagick.h:20:20: error: intern.h: No such file or directory
In file included from rmagick.h:21,
                 from rmdraw.c:10:
/Users/username/.rvm/rubies/ruby-1.9.2-p290/include/ruby-1.9.1/ruby/backward/rubyio.h:2:2: warning: #warning use "ruby/io.h" instead of "rubyio.h"
rmdraw.c: In function ‘Draw_annotate’:
rmdraw.c:448: warning: ‘InterpretImageAttributes’ is deprecated (declared at /usr/local/include/ImageMagick/magick/deprecate.h:96)
rmdraw.c: In function ‘get_dummy_tm_img’:
rmdraw.c:1419: warning: ‘AllocateImage’ is deprecated (declared at /usr/local/include/ImageMagick/magick/deprecate.h:119)
rmdraw.c:1427: error: too many arguments to function ‘rb_cvar_set’
rmdraw.c: In function ‘get_type_metrics’:
rmdraw.c:1504: warning: ‘InterpretImageAttributes’ is deprecated (declared at /usr/local/include/ImageMagick/magick/deprecate.h:96)
make[1]: *** [rmdraw.o] Error 1
setup.rb:655:in `command': system("make") failed (RuntimeError)
    from setup.rb:664:in `make'
    from setup.rb:1258:in `setup_dir_ext'
    from setup.rb:1532:in `block in traverse'
    from setup.rb:1549:in `dive_into'
    from setup.rb:1530:in `traverse'
    from setup.rb:1534:in `block (2 levels) in traverse'
    from setup.rb:1533:in `each'
    from setup.rb:1533:in `block in traverse'
    from setup.rb:1549:in `dive_into'
    from setup.rb:1530:in `traverse'
    from setup.rb:1524:in `block in exec_task_traverse'
    from setup.rb:1519:in `each'
    from setup.rb:1519:in `exec_task_traverse'
    from setup.rb:1246:in `exec_setup'
    from setup.rb:996:in `exec_setup'
    from setup.rb:826:in `invoke'
    from setup.rb:772:in `invoke'
    from setup.rb:1578:in `'
make: *** [all] Error 1

Any help would be much appreciated so as to get this resolved.

@bf4
Copy link
Member Author

@bf4 bf4 commented Jul 24, 2014

Comment by mmaiza
Thursday Jul 28, 2011 at 18:32 GMT


This means that rmagick is unable to find some of the header file. It could be because your path is not set correctly or because your imagemagick installation failed. Please follow the following instruction http://rmagick.rubyforge.org/install-osx.html and make sure you see no errors when installing imagemagick. You should then be able to do the bundle install.

Best Regards,
Moncef Maiza

-----Original Message-----
From: ylluminate [mailto:reply@reply.github.com]
Sent: Thursday, July 28, 2011 2:02 PM
To: moncef@datasieve.com
Subject: [rmagick] rmagick 1.15.17 Failed Install on Mac OS X (#31)

Attempting to bundle install a Gemfile from ChiliProject and running into an issue with rmagick compilation:

Gemfile: https://gist.github.com/1112118

The error in question appears to be:
rmagick.h:20:20: error: intern.h: No such file or directory

But the chunk that contains this in context is:

---> ext/RMagick
make
gcc -I. -I/Users/username/.rvm/rubies/ruby-1.9.2-p290/include/ruby-1.9.1/x86_64-darwin11.0.0 -I/Users/username/.rvm/rubies/ruby-1.9.2-p290/include/ruby-1.9.1/ruby/backward -I/Users/username/.rvm/rubies/ruby-1.9.2-p290/include/ruby-1.9.1 -I/Volumes/StorageVolume/Users/username/.rvm/gems/ruby-1.9.2-p290/gems/rmagick-1.15.17/ext/RMagick -DRUBY_VERSION=0x192  -I/usr/local/include/ImageMagick -fno-common   -o rmdraw.o -c rmdraw.c
In file included from rmdraw.c:10:
rmagick.h:20:20: error: intern.h: No such file or directory
In file included from rmagick.h:21,
                 from rmdraw.c:10:
/Users/username/.rvm/rubies/ruby-1.9.2-p290/include/ruby-1.9.1/ruby/backward/rubyio.h:2:2: warning: #warning use "ruby/io.h" instead of "rubyio.h"
rmdraw.c: In function ‘Draw_annotate’:
rmdraw.c:448: warning: ‘InterpretImageAttributes’ is deprecated (declared at /usr/local/include/ImageMagick/magick/deprecate.h:96)
rmdraw.c: In function ‘get_dummy_tm_img’:
rmdraw.c:1419: warning: ‘AllocateImage’ is deprecated (declared at /usr/local/include/ImageMagick/magick/deprecate.h:119)
rmdraw.c:1427: error: too many arguments to function ‘rb_cvar_set’
rmdraw.c: In function ‘get_type_metrics’:
rmdraw.c:1504: warning: ‘InterpretImageAttributes’ is deprecated (declared at /usr/local/include/ImageMagick/magick/deprecate.h:96)
make[1]: *** [rmdraw.o] Error 1
setup.rb:655:in `command': system("make") failed (RuntimeError)
    from setup.rb:664:in `make'
    from setup.rb:1258:in `setup_dir_ext'
    from setup.rb:1532:in `block in traverse'
    from setup.rb:1549:in `dive_into'
    from setup.rb:1530:in `traverse'
    from setup.rb:1534:in `block (2 levels) in traverse'
    from setup.rb:1533:in `each'
    from setup.rb:1533:in `block in traverse'
    from setup.rb:1549:in `dive_into'
    from setup.rb:1530:in `traverse'
    from setup.rb:1524:in `block in exec_task_traverse'
    from setup.rb:1519:in `each'
    from setup.rb:1519:in `exec_task_traverse'
    from setup.rb:1246:in `exec_setup'
    from setup.rb:996:in `exec_setup'
    from setup.rb:826:in `invoke'
    from setup.rb:772:in `invoke'
    from setup.rb:1578:in `'
make: *** [all] Error 1

Any help would be much appreciated so as to get this resolved.

Reply to this email directly or view it on GitHub:
#31

@bf4
Copy link
Member Author

@bf4 bf4 commented Jul 24, 2014

Comment by ylluminate
Thursday Jul 28, 2011 at 18:47 GMT


Thanks for the note. Unfortunately ImageMagick installs just fine and is installed fine:

$mogrify --version
Version: ImageMagick 6.7.1-0 2011-07-28 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2011 ImageMagick Studio LLC
Features: OpenMP   

I was able to run the following seemingly just fine:

./configure --prefix=/usr/local --disable-static --without-fontconfig --with-modules --without-perl --without-magick-plus-plus --with-quantum-depth=8 --with-gs-font-dir=/usr/local/share/ghostscript/fonts --disable-openmp && make && sudo make install

Following this I attempted to go back to the bundle install and come up with the above issue.

It appears to be missing intern.h which seems to be part of Ruby source. This does also appear to be available as it is present here: /Users/username/.rvm/src/ruby-1.9.2-p290/include/ruby/intern.h

Thanks,

-George

@bf4
Copy link
Member Author

@bf4 bf4 commented Jul 24, 2014

Comment by mmaiza
Thursday Jul 28, 2011 at 19:39 GMT


Looking at the gcc command that fails I do not see a path that leads to intern.h. Check your path and see what comes first. You may have had an old install of Ruby and it is still searching there. In this case you would have to modify the path. Something is wrong with your configuration and you will have to look for it.
From a console do: which ruby to find out where it is looking? If the root of the path is not the same as the one where inten.h lied then you need to fix your PATH variable.

Moncef

-----Original Message-----
From: ylluminate [mailto:reply@reply.github.com]
Sent: Thursday, July 28, 2011 2:47 PM
To: moncef@datasieve.com
Subject: Re: [rmagick] rmagick 1.15.17 Failed Install on Mac OS X (#31)

Thanks for the note. Unfortunately ImageMagick installs just fine and is installed fine:

$mogrify --version
Version: ImageMagick 6.7.1-0 2011-07-28 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2011 ImageMagick Studio LLC
Features: OpenMP   

I was able to run the following seemingly just fine:

./configure --prefix=/usr/local --disable-static --without-fontconfig --with-modules --without-perl --without-magick-plus-plus --with-quantum-depth=8 --with-gs-font-dir=/usr/local/share/ghostscript/fonts --disable-openmp && make && sudo make install

Following this I attempted to go back to the bundle install and come up with the above issue.

It appears to be missing intern.h which seems to be part of Ruby source. This does also appear to be available as it is present here: /Users/username/.rvm/src/ruby-1.9.2-p290/include/ruby/intern.h

Thanks,

-George

Reply to this email directly or view it on GitHub:
#31 (comment)

@bf4
Copy link
Member Author

@bf4 bf4 commented Jul 24, 2014

Comment by ylluminate
Friday Jul 29, 2011 at 19:10 GMT


I actually switched to ruby ruby-1.8.7-p352 from ruby-1.9.2-p290 and this seemed to help. Still having some odd crashes with ruby itself, but that appears to perhaps be from some gcc issue on Lion which tries to use LLVM. I did force it over to gcc, but still some odd sporadic crashes.

@bf4
Copy link
Member Author

@bf4 bf4 commented Jul 24, 2014

Comment by ycherniavsky
Wednesday Aug 03, 2011 at 09:39 GMT


I have the same problem. After some investigate I have understood that proble not in any environment configuration, it is in rmagick library version.
From http://rmagick.rubyforge.org
RMagick 1 does not support any features added to ImageMagick 6.3.0 and later and does not work with Ruby 1.9.
and we try to compile RMagick 1.15.17 under Ruby 1.9.2 :).

@ioquatix ioquatix added this to the documentation milestone Sep 7, 2014
@vassilevsky
Copy link
Member

@vassilevsky vassilevsky commented Oct 27, 2014

The latest RMagick successfully installs on OS X Yosemite.

We are on a path to enable CI on OS X.

Feel free to open new issues if you get failures.

Watson1978 added a commit that referenced this issue Dec 29, 2019
The AddressSanitizer indicates heap-buffer-overflow at https://github.com/rmagick/rmagick/blob/655f48ff2fdc980be63bf656f2f5bef393c8d182/ext/RMagick/rmimage.c#L16057

```
$ CFLAGS='-O0 -g -fsanitize=address -fno-omit-frame-pointer' rake
...
==52655==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x61d00082bc00 at pc 0x00011ae6566d bp 0x7ffee11df090 sp 0x7ffee11df088
READ of size 4 at 0x61d00082bc00 thread T0
    #0 0x11ae6566c in Image_wet_floor rmimage.c:16057
    #1 0x10f25bdf9 in call_cfunc_m1 vm_insnhelper.c:2336
    #2 0x10f23aaa9 in vm_call_cfunc_with_frame vm_insnhelper.c:2514
    #3 0x10f21bf8b in vm_call_cfunc vm_insnhelper.c:2539
    #4 0x10f219e74 in vm_call_method_each_type vm_insnhelper.c:2925
    #5 0x10f219649 in vm_call_method vm_insnhelper.c:3028
    #6 0x10f1bf95c in vm_call_general vm_insnhelper.c:3076
    #7 0x10f247393 in vm_sendish vm_insnhelper.c:4023
    #8 0x10f1cdf3f in vm_exec_core insns.def:801
    #9 0x10f20a734 in rb_vm_exec vm.c:1920
    #10 0x10f2660c6 in invoke_block vm.c:1044
    #11 0x10f26559c in invoke_block_from_c_bh vm.c:1134
    #12 0x10f1fe93e in vm_yield_with_cref vm.c:1171
    #13 0x10f1ff972 in yield_under vm_eval.c:1877
    #14 0x10f201fc9 in rb_obj_instance_exec_internal vm_eval.c:2023
    #15 0x10f25bdf9 in call_cfunc_m1 vm_insnhelper.c:2336
    #16 0x10f23aaa9 in vm_call_cfunc_with_frame vm_insnhelper.c:2514
    #17 0x10f21bf8b in vm_call_cfunc vm_insnhelper.c:2539
    #18 0x10f247393 in vm_sendish vm_insnhelper.c:4023
    #19 0x10f1cda91 in vm_exec_core insns.def:782
    #20 0x10f20a880 in rb_vm_exec vm.c:1929
    #21 0x10f2660c6 in invoke_block vm.c:1044
    #22 0x10f26559c in invoke_block_from_c_bh vm.c:1134
    #23 0x10f2650c0 in vm_yield vm.c:1179
    #24 0x10f1f86a4 in rb_yield_0 vm_eval.c:1227
    #25 0x10f1f8604 in rb_yield_1 vm_eval.c:1233
    #26 0x10f1f86e3 in rb_yield vm_eval.c:1243
    #27 0x10ea232c1 in rb_ary_collect array.c:3065
    #28 0x10f25be28 in call_cfunc_0 vm_insnhelper.c:2343
    #29 0x10f23aaa9 in vm_call_cfunc_with_frame vm_insnhelper.c:2514
    #30 0x10f21bf8b in vm_call_cfunc vm_insnhelper.c:2539
    #31 0x10f247393 in vm_sendish vm_insnhelper.c:4023
    #32 0x10f1cda91 in vm_exec_core insns.def:782
    #33 0x10f20a734 in rb_vm_exec vm.c:1920
    #34 0x10f2660c6 in invoke_block vm.c:1044
    #35 0x10f26559c in invoke_block_from_c_bh vm.c:1134
    #36 0x10f2650c0 in vm_yield vm.c:1179
    #37 0x10f1f86a4 in rb_yield_0 vm_eval.c:1227
    #38 0x10f1f8604 in rb_yield_1 vm_eval.c:1233
    #39 0x10f1f86e3 in rb_yield vm_eval.c:1243
    #40 0x10ea232c1 in rb_ary_collect array.c:3065
    #41 0x10f25be28 in call_cfunc_0 vm_insnhelper.c:2343
    #42 0x10f23aaa9 in vm_call_cfunc_with_frame vm_insnhelper.c:2514
    #43 0x10f21bf8b in vm_call_cfunc vm_insnhelper.c:2539
    #44 0x10f219e74 in vm_call_method_each_type vm_insnhelper.c:2925
    #45 0x10f219649 in vm_call_method vm_insnhelper.c:3028
    #46 0x10f1bf95c in vm_call_general vm_insnhelper.c:3076
    #47 0x10f247393 in vm_sendish vm_insnhelper.c:4023
    #48 0x10f1cda91 in vm_exec_core insns.def:782
    #49 0x10f20a880 in rb_vm_exec vm.c:1929
    #50 0x10f20efcf in rb_iseq_eval_main vm.c:2179
    #51 0x10ebcd82b in rb_ec_exec_node eval.c:277
    #52 0x10ebcd2ae in ruby_run_node eval.c:335
    #53 0x10ea0bd13 in main main.c:50
    #54 0x7fff67ac57fc in start (libdyld.dylib:x86_64+0x1a7fc)

0x61d00082bc00 is located 0 bytes to the right of 1920-byte region [0x61d00082b480,0x61d00082bc00)
allocated by thread T0 here:
    #0 0x10f85b107 in wrap_posix_memalign (libclang_rt.asan_osx_dynamic.dylib:x86_64h+0x62107)
    #1 0x11ae8d87c in rm_aligned_malloc rmmain.c:147
    #2 0x11b0dfa06 in AcquireAlignedMemory (libMagickCore-7.Q16HDRI.7.dylib:x86_64+0x10ea06)
    #3 0x11aff6a38 in OpenPixelCache (libMagickCore-7.Q16HDRI.7.dylib:x86_64+0x25a38)
    #4 0x11aff8c5d in GetImagePixelCache (libMagickCore-7.Q16HDRI.7.dylib:x86_64+0x27c5d)
    #5 0x11affb381 in SyncImagePixelCache (libMagickCore-7.Q16HDRI.7.dylib:x86_64+0x2a381)
    #6 0x11b001601 in SetImageAlphaChannel (libMagickCore-7.Q16HDRI.7.dylib:x86_64+0x30601)
    #7 0x11ae653b2 in Image_wet_floor rmimage.c:16013
    #8 0x10f25bdf9 in call_cfunc_m1 vm_insnhelper.c:2336
    #9 0x10f23aaa9 in vm_call_cfunc_with_frame vm_insnhelper.c:2514
    #10 0x10f21bf8b in vm_call_cfunc vm_insnhelper.c:2539
    #11 0x10f219e74 in vm_call_method_each_type vm_insnhelper.c:2925
    #12 0x10f219649 in vm_call_method vm_insnhelper.c:3028
    #13 0x10f1bf95c in vm_call_general vm_insnhelper.c:3076
    #14 0x10f247393 in vm_sendish vm_insnhelper.c:4023
    #15 0x10f1cdf3f in vm_exec_core insns.def:801
    #16 0x10f20a734 in rb_vm_exec vm.c:1920
    #17 0x10f2660c6 in invoke_block vm.c:1044
    #18 0x10f26559c in invoke_block_from_c_bh vm.c:1134
    #19 0x10f1fe93e in vm_yield_with_cref vm.c:1171
    #20 0x10f1ff972 in yield_under vm_eval.c:1877
    #21 0x10f201fc9 in rb_obj_instance_exec_internal vm_eval.c:2023
    #22 0x10f25bdf9 in call_cfunc_m1 vm_insnhelper.c:2336
    #23 0x10f23aaa9 in vm_call_cfunc_with_frame vm_insnhelper.c:2514
    #24 0x10f21bf8b in vm_call_cfunc vm_insnhelper.c:2539
    #25 0x10f247393 in vm_sendish vm_insnhelper.c:4023
    #26 0x10f1cda91 in vm_exec_core insns.def:782
    #27 0x10f20a880 in rb_vm_exec vm.c:1929
    #28 0x10f2660c6 in invoke_block vm.c:1044
    #29 0x10f26559c in invoke_block_from_c_bh vm.c:1134

SUMMARY: AddressSanitizer: heap-buffer-overflow rmimage.c:16057 in Image_wet_floor
Shadow bytes around the buggy address:
  0x1c3a00105730: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x1c3a00105740: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x1c3a00105750: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x1c3a00105760: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x1c3a00105770: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
=>0x1c3a00105780:[fa]fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x1c3a00105790: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x1c3a001057a0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x1c3a001057b0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x1c3a001057c0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x1c3a001057d0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
Shadow byte legend (one shadow byte represents 8 application bytes):
  Addressable:           00
  Partially addressable: 01 02 03 04 05 06 07
  Heap left redzone:       fa
  Freed heap region:       fd
  Stack left redzone:      f1
  Stack mid redzone:       f2
  Stack right redzone:     f3
  Stack after return:      f5
  Stack use after scope:   f8
  Global redzone:          f9
  Global init order:       f6
  Poisoned by user:        f7
  Container overflow:      fc
  Array cookie:            ac
  Intra object redzone:    bb
  ASan internal:           fe
  Left alloca redzone:     ca
  Right alloca redzone:    cb
  Shadow gap:              cc
==52655==ABORTING
```

The address of variable `p` and `q` will be moved in https://github.com/rmagick/rmagick/blob/655f48ff2fdc980be63bf656f2f5bef393c8d182/ext/RMagick/rmimage.c#L16062-L16063

The overflow will be occurred with storing to moved address + index `x`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.