Why is this RMagick call generating a segmentation fault?
Asked Answered
S

12

68

I've been banging my head against the wall for the better part of an hour trying to figure out what's going wrong here, and I'm sure (or rather hoping) it's something fairly obvious that I'm overlooking. I'm using Ruby 1.9.1, Sinatra 1.0, and RMagick 2.13.1. ImageMagick and RMagick are correctly installed and functional—I've successfully manipulated and saved images from irb.

The relevant part of the params array (formatting changes for the sake of readability):

{"admin_user_new_image_file"=>
    {
        :filename=>"freddie-on-shetland-pony.png",
        :type=>"image/png", 
        :name=>"admin_user_new_image_file", 
        :tempfile=>#<File:/var/folders/a7/a7pO5jMcGLCww9XBGRvWfE+++TI/-Tmp-/RackMultipart20100514-20700-o2tkqu-0>,
        :head=>"Content-Disposition: form-data; name=\"admin_user_new_image_file\"; filename=\"freddie-on-shetland-pony.png\"\r\nContent-Type: image/png\r\n"
    }
}

The relevant code:

post "/admin/user/:account_name/image/new/" do
  if params[:admin_user_new_image_file][:tempfile]
    thumbnail = Magick::Image.read("png:"+params[:admin_user_new_image_file][:tempfile].path).first
  end
end

The error (line 229 is the line starting with "thumbnail = ":

config.ru:229: [BUG] Segmentation fault
ruby 1.9.1p376 (2009-12-07 revision 26041) [i386-darwin10.3.0]

-- control frame ----------
c:0042 p:---- s:0196 b:0196 l:000195 d:000195 CFUNC  :read
c:0041 p:0121 s:0192 b:0192 l:001ab8 d:000191 LAMBDA config.ru:229
c:0040 p:---- s:0189 b:0189 l:000188 d:000188 FINISH
c:0039 p:---- s:0187 b:0187 l:000186 d:000186 CFUNC  :call
c:0038 p:0018 s:0184 b:0184 l:001d78 d:000183 BLOCK  /usr/local/lib/ruby/gems/1.9.1/gems/sinatra-1.0/lib/sinatra/base.rb:865
c:0037 p:---- s:0182 b:0182 l:000181 d:000181 FINISH
c:0036 p:---- s:0180 b:0180 l:000179 d:000179 CFUNC  :instance_eval
c:0035 p:0016 s:0177 b:0175 l:000174 d:000174 METHOD /usr/local/lib/ruby/gems/1.9.1/gems/sinatra-1.0/lib/sinatra/base.rb:521
c:0034 p:0024 s:0171 b:0171 l:000148 d:000170 BLOCK  /usr/local/lib/ruby/gems/1.9.1/gems/sinatra-1.0/lib/sinatra/base.rb:500
c:0033 p:---- s:0169 b:0169 l:000168 d:000168 FINISH
c:0032 p:---- s:0167 b:0167 l:000166 d:000166 CFUNC  :catch
c:0031 p:0140 s:0163 b:0163 l:000148 d:000162 BLOCK  /usr/local/lib/ruby/gems/1.9.1/gems/sinatra-1.0/lib/sinatra/base.rb:497
c:0030 p:---- s:0154 b:0154 l:000153 d:000153 FINISH
c:0029 p:---- s:0152 b:0152 l:000151 d:000151 CFUNC  :each
c:0028 p:0073 s:0149 b:0149 l:000148 d:000148 METHOD /usr/local/lib/ruby/gems/1.9.1/gems/sinatra-1.0/lib/sinatra/base.rb:476
c:0027 p:0076 s:0141 b:0141 l:000140 d:000140 METHOD /usr/local/lib/ruby/gems/1.9.1/gems/sinatra-1.0/lib/sinatra/base.rb:601
c:0026 p:0009 s:0137 b:0137 l:000138 d:000136 BLOCK  /usr/local/lib/ruby/gems/1.9.1/gems/sinatra-1.0/lib/sinatra/base.rb:411
c:0025 p:---- s:0135 b:0135 l:000134 d:000134 FINISH
c:0024 p:---- s:0133 b:0133 l:000132 d:000132 CFUNC  :instance_eval
c:0023 p:0012 s:0130 b:0130 l:000121 d:000129 BLOCK  /usr/local/lib/ruby/gems/1.9.1/gems/sinatra-1.0/lib/sinatra/base.rb:566
c:0022 p:---- s:0128 b:0128 l:000127 d:000127 FINISH
c:0021 p:---- s:0126 b:0126 l:000125 d:000125 CFUNC  :catch
c:0020 p:0013 s:0122 b:0122 l:000121 d:000121 METHOD /usr/local/lib/ruby/gems/1.9.1/gems/sinatra-1.0/lib/sinatra/base.rb:566
c:0019 p:0098 s:0115 b:0115 l:000138 d:000138 METHOD /usr/local/lib/ruby/gems/1.9.1/gems/sinatra-1.0/lib/sinatra/base.rb:411
c:0018 p:0019 s:0108 b:0108 l:000107 d:000107 METHOD /usr/local/lib/ruby/gems/1.9.1/gems/sinatra-1.0/lib/sinatra/base.rb:399
c:0017 p:0014 s:0104 b:0104 l:000103 d:000103 METHOD /usr/local/lib/ruby/gems/1.9.1/gems/rack-1.1.0/lib/rack/showexceptions.rb:24
c:0016 p:0150 s:0098 b:0098 l:000097 d:000097 METHOD /usr/local/lib/ruby/gems/1.9.1/gems/rack-1.1.0/lib/rack/methodoverride.rb:24
c:0015 p:0031 s:0092 b:0092 l:000091 d:000091 METHOD /usr/local/lib/ruby/gems/1.9.1/gems/rack-1.1.0/lib/rack/commonlogger.rb:18
c:0014 p:0018 s:0084 b:0084 l:002080 d:000083 BLOCK  /usr/local/lib/ruby/gems/1.9.1/gems/sinatra-1.0/lib/sinatra/base.rb:979
c:0013 p:0032 s:0082 b:0082 l:000081 d:000081 METHOD /usr/local/lib/ruby/gems/1.9.1/gems/sinatra-1.0/lib/sinatra/base.rb:1005
c:0012 p:0011 s:0078 b:0078 l:002080 d:002080 METHOD /usr/local/lib/ruby/gems/1.9.1/gems/sinatra-1.0/lib/sinatra/base.rb:979
c:0011 p:0100 s:0074 b:0074 l:000ff0 d:000ff0 METHOD /usr/local/lib/ruby/gems/1.9.1/gems/rack-1.1.0/lib/rack/lint.rb:47
c:0010 p:0022 s:0068 b:0068 l:000067 d:000067 METHOD /usr/local/lib/ruby/gems/1.9.1/gems/rack-1.1.0/lib/rack/lint.rb:35
c:0009 p:0014 s:0064 b:0064 l:000063 d:000063 METHOD /usr/local/lib/ruby/gems/1.9.1/gems/rack-1.1.0/lib/rack/showexceptions.rb:24
c:0008 p:0031 s:0058 b:0058 l:000057 d:000057 METHOD /usr/local/lib/ruby/gems/1.9.1/gems/rack-1.1.0/lib/rack/commonlogger.rb:18
c:0007 p:0014 s:0050 b:0050 l:000049 d:000049 METHOD /usr/local/lib/ruby/gems/1.9.1/gems/rack-1.1.0/lib/rack/content_length.rb:13
c:0006 p:0320 s:0042 b:0042 l:000041 d:000041 METHOD /usr/local/lib/ruby/gems/1.9.1/gems/rack-1.1.0/lib/rack/handler/webrick.rb:48
c:0005 p:0256 s:0030 b:0030 l:000029 d:000029 METHOD /usr/local/lib/ruby/1.9.1/webrick/httpserver.rb:111
c:0004 p:0382 s:0020 b:0020 l:000019 d:000019 METHOD /usr/local/lib/ruby/1.9.1/webrick/httpserver.rb:70
c:0003 p:0123 s:0009 b:0009 l:000bc8 d:000008 BLOCK  /usr/local/lib/ruby/1.9.1/webrick/server.rb:183
c:0002 p:---- s:0004 b:0004 l:000003 d:000003 FINISH
c:0001 p:---- s:0002 b:0002 l:000001 d:000001 TOP   
---------------------------
-- Ruby level backtrace information-----------------------------------------
config.ru:229:in `read'
config.ru:229:in `block (2 levels) in <main>'
/usr/local/lib/ruby/gems/1.9.1/gems/sinatra-1.0/lib/sinatra/base.rb:865:in `call'
/usr/local/lib/ruby/gems/1.9.1/gems/sinatra-1.0/lib/sinatra/base.rb:865:in `block in route'
/usr/local/lib/ruby/gems/1.9.1/gems/sinatra-1.0/lib/sinatra/base.rb:521:in `instance_eval'
/usr/local/lib/ruby/gems/1.9.1/gems/sinatra-1.0/lib/sinatra/base.rb:521:in `route_eval'
/usr/local/lib/ruby/gems/1.9.1/gems/sinatra-1.0/lib/sinatra/base.rb:500:in `block (2 levels) in route!'
/usr/local/lib/ruby/gems/1.9.1/gems/sinatra-1.0/lib/sinatra/base.rb:497:in `catch'
/usr/local/lib/ruby/gems/1.9.1/gems/sinatra-1.0/lib/sinatra/base.rb:497:in `block in route!'
/usr/local/lib/ruby/gems/1.9.1/gems/sinatra-1.0/lib/sinatra/base.rb:476:in `each'
/usr/local/lib/ruby/gems/1.9.1/gems/sinatra-1.0/lib/sinatra/base.rb:476:in `route!'
/usr/local/lib/ruby/gems/1.9.1/gems/sinatra-1.0/lib/sinatra/base.rb:601:in `dispatch!'
/usr/local/lib/ruby/gems/1.9.1/gems/sinatra-1.0/lib/sinatra/base.rb:411:in `block in call!'
/usr/local/lib/ruby/gems/1.9.1/gems/sinatra-1.0/lib/sinatra/base.rb:566:in `instance_eval'
/usr/local/lib/ruby/gems/1.9.1/gems/sinatra-1.0/lib/sinatra/base.rb:566:in `block in invoke'
/usr/local/lib/ruby/gems/1.9.1/gems/sinatra-1.0/lib/sinatra/base.rb:566:in `catch'
/usr/local/lib/ruby/gems/1.9.1/gems/sinatra-1.0/lib/sinatra/base.rb:566:in `invoke'
/usr/local/lib/ruby/gems/1.9.1/gems/sinatra-1.0/lib/sinatra/base.rb:411:in `call!'
/usr/local/lib/ruby/gems/1.9.1/gems/sinatra-1.0/lib/sinatra/base.rb:399:in `call'
/usr/local/lib/ruby/gems/1.9.1/gems/rack-1.1.0/lib/rack/showexceptions.rb:24:in `call'
/usr/local/lib/ruby/gems/1.9.1/gems/rack-1.1.0/lib/rack/methodoverride.rb:24:in `call'
/usr/local/lib/ruby/gems/1.9.1/gems/rack-1.1.0/lib/rack/commonlogger.rb:18:in `call'
/usr/local/lib/ruby/gems/1.9.1/gems/sinatra-1.0/lib/sinatra/base.rb:979:in `block in call'
/usr/local/lib/ruby/gems/1.9.1/gems/sinatra-1.0/lib/sinatra/base.rb:1005:in `synchronize'
/usr/local/lib/ruby/gems/1.9.1/gems/sinatra-1.0/lib/sinatra/base.rb:979:in `call'
/usr/local/lib/ruby/gems/1.9.1/gems/rack-1.1.0/lib/rack/lint.rb:47:in `_call'
/usr/local/lib/ruby/gems/1.9.1/gems/rack-1.1.0/lib/rack/lint.rb:35:in `call'
/usr/local/lib/ruby/gems/1.9.1/gems/rack-1.1.0/lib/rack/showexceptions.rb:24:in `call'
/usr/local/lib/ruby/gems/1.9.1/gems/rack-1.1.0/lib/rack/commonlogger.rb:18:in `call'
/usr/local/lib/ruby/gems/1.9.1/gems/rack-1.1.0/lib/rack/content_length.rb:13:in `call'
/usr/local/lib/ruby/gems/1.9.1/gems/rack-1.1.0/lib/rack/handler/webrick.rb:48:in `service'
/usr/local/lib/ruby/1.9.1/webrick/httpserver.rb:111:in `service'
/usr/local/lib/ruby/1.9.1/webrick/httpserver.rb:70:in `run'
/usr/local/lib/ruby/1.9.1/webrick/server.rb:183:in `block in start_thread'

-- C level backtrace information -------------------------------------------
0x10010cd8d 0   libruby.dylib                       0x000000010010cd8d rb_vm_bugreport + 77
0x10002b184 1   libruby.dylib                       0x000000010002b184 report_bug + 260
0x10002b318 2   libruby.dylib                       0x000000010002b318 rb_bug + 200
0x1000b7124 3   libruby.dylib                       0x00000001000b7124 sigsegv + 132
0x7fff8301c80a 4   libSystem.B.dylib                   0x00007fff8301c80a _sigtramp + 26
0x1032313ac 5   libMagickCore.3.dylib               0x00000001032313ac Splay + 300
0x103119245 6   libMagickCore.3.dylib               0x0000000103119245 AcquirePixelCache + 325
0x1031cb317 7   libMagickCore.3.dylib               0x00000001031cb317 AcquireImage + 375
0x10333035b 8   libMagickCore.3.dylib               0x000000010333035b ReadPNGImage + 155
0x1031418fd 9   libMagickCore.3.dylib               0x00000001031418fd ReadImage + 2221
0x101f1b72b 10  RMagick2.bundle                     0x0000000101f1b72b rd_image + 339
0x101f1b59b 11  RMagick2.bundle                     0x0000000101f1b59b Image_read + 36
0x1000fd0e4 12  libruby.dylib                       0x00000001000fd0e4 vm_call_cfunc + 340
0x1000fe9b0 13  libruby.dylib                       0x00000001000fe9b0 vm_call_method + 896
0x1000ff8fc 14  libruby.dylib                       0x00000001000ff8fc vm_exec_core + 3180
0x100104b93 15  libruby.dylib                       0x0000000100104b93 vm_exec + 1203
0x100106643 16  libruby.dylib                       0x0000000100106643 rb_vm_invoke_proc + 691
0x100106ccd 17  libruby.dylib                       0x0000000100106ccd vm_call0 + 1085
0x1000317c6 18  libruby.dylib                       0x00000001000317c6 rb_method_call + 406
0x1000fd0e4 19  libruby.dylib                       0x00000001000fd0e4 vm_call_cfunc + 340
0x1000fe9b0 20  libruby.dylib                       0x00000001000fe9b0 vm_call_method + 896
0x1000ff8fc 21  libruby.dylib                       0x00000001000ff8fc vm_exec_core + 3180
0x100104b93 22  libruby.dylib                       0x0000000100104b93 vm_exec + 1203
0x100105ce6 23  libruby.dylib                       0x0000000100105ce6 yield_under + 710
0x100106188 24  libruby.dylib                       0x0000000100106188 specific_eval + 72
0x1000fd0e4 25  libruby.dylib                       0x00000001000fd0e4 vm_call_cfunc + 340
0x1000fe9b0 26  libruby.dylib                       0x00000001000fe9b0 vm_call_method + 896
0x1000ff8fc 27  libruby.dylib                       0x00000001000ff8fc vm_exec_core + 3180
0x100104b93 28  libruby.dylib                       0x0000000100104b93 vm_exec + 1203
0x10010b6bf 29  libruby.dylib                       0x000000010010b6bf rb_f_catch + 639
0x1000fd0e4 30  libruby.dylib                       0x00000001000fd0e4 vm_call_cfunc + 340
0x1000fe9b0 31  libruby.dylib                       0x00000001000fe9b0 vm_call_method + 896
0x1000ff8fc 32  libruby.dylib                       0x00000001000ff8fc vm_exec_core + 3180
0x100104b93 33  libruby.dylib                       0x0000000100104b93 vm_exec + 1203
0x10010aac9 34  libruby.dylib                       0x000000010010aac9 rb_yield + 505
0x100007902 35  libruby.dylib                       0x0000000100007902 rb_ary_each + 82
0x1000fd0e4 36  libruby.dylib                       0x00000001000fd0e4 vm_call_cfunc + 340
0x1000fe9b0 37  libruby.dylib                       0x00000001000fe9b0 vm_call_method + 896
0x1000ff8fc 38  libruby.dylib                       0x00000001000ff8fc vm_exec_core + 3180
0x100104b93 39  libruby.dylib                       0x0000000100104b93 vm_exec + 1203
0x100105ce6 40  libruby.dylib                       0x0000000100105ce6 yield_under + 710
0x100106188 41  libruby.dylib                       0x0000000100106188 specific_eval + 72
0x1000fd0e4 42  libruby.dylib                       0x00000001000fd0e4 vm_call_cfunc + 340
0x1000fe9b0 43  libruby.dylib                       0x00000001000fe9b0 vm_call_method + 896
0x1000ff8fc 44  libruby.dylib                       0x00000001000ff8fc vm_exec_core + 3180
0x100104b93 45  libruby.dylib                       0x0000000100104b93 vm_exec + 1203
0x10010b6bf 46  libruby.dylib                       0x000000010010b6bf rb_f_catch + 639
0x1000fd0e4 47  libruby.dylib                       0x00000001000fd0e4 vm_call_cfunc + 340
0x1000fe9b0 48  libruby.dylib                       0x00000001000fe9b0 vm_call_method + 896
0x1000ff8fc 49  libruby.dylib                       0x00000001000ff8fc vm_exec_core + 3180
0x100104b93 50  libruby.dylib                       0x0000000100104b93 vm_exec + 1203
0x100106643 51  libruby.dylib                       0x0000000100106643 rb_vm_invoke_proc + 691
0x100111803 52  libruby.dylib                       0x0000000100111803 thread_start_func_2 + 835
0x100111921 53  libruby.dylib                       0x0000000100111921 thread_start_func_1 + 17
0x7fff82ff58b6 54  libSystem.B.dylib                   0x00007fff82ff58b6 _pthread_start + 331
0x7fff82ff5769 55  libSystem.B.dylib                   0x00007fff82ff5769 thread_start + 13

[NOTE]
You may encounter a bug of Ruby interpreter. Bug reports are welcome.
For details: http://www.ruby-lang.org/bugreport.html

Abort trap

Anyone have any idea what's going on? Thanks!

Straphanger answered 14/5, 2010 at 23:46 Comment(3)
I may be confused, but I'm kind of surprised it works at all. Doesn't the # sign cause the remainder of the "tempfile:" line to become a comment? It looks like you're assigning nothing to the tempvalue. Is it possible Ruby 1.8 and 1.9 process the "#<...>" combination differently?Edwardedwardian
I can confirm this also happens on 1.9.2-rc1 and rc2.Ludewig
That first code snippet in the question is likely just the result of a logger.debug and in that case the syntax #<File:...> is just describing that the value for the :tempfile key is an instance of File. Think of it this way: if that was a real comment then the hash described would be a syntax error :)Kenton
N
91

To expand on Matthew Savage's comment, do this:

brew install imagemagick --disable-openmp

and it starts working again. No need to edit the files. (I'm not sure if thats what he's actually saying or if he's saying remove the flag, but the above homebrew command works for me on OSX 10.6)

If you already have imagemagick installed then

brew uninstall imagemagick && brew install imagemagick --disable-openmp

brew upgrade -f no longer reinstalls, so you have to uninstall it first.)

Naughty answered 3/9, 2010 at 17:33 Comment(9)
brew install -f imagemagick --disable-openmp didn't work for me. I am on osx(Darwin Kernel Version 10.6.0). I tried removing imagemagick and reinstalling and it didn't work for me. An alternative would be to use mini_magick gem instead of rmagick as noted in github.com/jnicklas/carrierwave/issues/185Lantana
Thanks so much for that hint. Is there a bug for homebrew or imagemagick for this?Biauriculate
I went to upvote this...and noticed I'd already done it. This apparently saved me once on snow leopard...and after I upgraded to lion it saved me again....if only I could remember to save myself the 20min headache every time...Superload
@Superload same thing just happened to me - question favorited!Wafture
Thank you so much Ash, this was one of the first results on Google. It certainly saved me a headache!Orleans
I had the same errors as above and this solution worked for me with the addition of reinstalling rmagick: sudo gem uninstall rmagick sudo gem install rmagickHosiery
Same issue with Lion here. I removed imagemagick, reinstalled it with this flags, removed the rmagick gem and built it again and it worked flawlessly!. CheersManns
I have no idea how I would have solved this without StackOverflowSherl
Once you have reinstalled imagemagick, be sure to rebuild rmagick against it: gem pristine rmagickTendon
C
34

I was having a very similar problem on OS X 10.6.7 running Ruby 1.9.2p180.

To expand on Ash Berlin's comment, if you are using the homebrew package manager, you need to uninstall the imagemagick package and also remove the cache as well, before it will work.

Uninstall imagemagick:

brew remove imagemagick

Delete the cache:

rm -rf `brew --cache imagemagick`

Then re-install the package with this flag:

brew install -f imagemagick --disable-openmp
Crumpet answered 23/4, 2011 at 21:46 Comment(2)
Exact same problem but on Mac OS 10.7, followed these steps and it solved the problem. I also removed and rebuilt the Rmagick Gem for good measure.Vaporish
This means to be made as the default answer.Mesne
A
30

For those using MacPorts, ImageMagick 6.6.5 and Ruby 1.9.2.

  1. port uninstall ImageMagick
  2. port edit ImageMagick
  3. Add --disable-openmp to configure.args (near line 100)
  4. port install ImageMagick
  5. Remove, then reinstall rmagick

Worked for me :)

Allover answered 24/11, 2010 at 3:12 Comment(4)
I don't understand step 3 in this answer.After I did sudo port edit ImageMagick, it just gave me some basic information about ImageMagick, such as license, version etc. Can you elaborate a bit. Thank you.Lefthanded
Hey @Michael, I don't have MacPorts on my system anymore (have since switched to Homebrew) so I can't help you out with the step-by-step. Port edit should open the Portfile, you should find the mentioned variable near line 100, which you can then insert --disable-openmp into. Can anyone else help Michael out with a more detailed step 3?Allover
Wow, this answer was back in 2010. Still, it might help somebody out. Anyone have an update on the situation?Allover
Perhaps there's some confusion? "port edit ImageMagick" will open an editor (I get vi) on the Portfile. The first few lines of the file do, indeed, contain "some basic information about ImageMagic," or rather about the Portfile. Mine says "# $Id: Portfile 90819 2012-03-15 03:06:13Z " and so on. But if you go down to line 100, you'll see a set of command line switches where you can add --disable-openmp.Eatmon
S
5

i had a similar problem using rails 3 with carrierwave on os x 10.6 and ruby 1.9.2, also crashed in a call to read everytime an image needed to be resized. doing:

brew uninstall imagemagick
brew install imagemagick --disable-openmp

solved the problem for me.

Sundstrom answered 11/2, 2011 at 19:3 Comment(0)
E
3

The crash may be due to accessing ImageMagick on a thread under OSX MacPorts. See post.

Electrician answered 3/6, 2010 at 5:59 Comment(1)
I had this same issue with 1.9.1, 1.9.2-rc1 and 1.9.2-rc2 - I am using homebrew to install the package, so all I did was edit the brew file and remove the condition for adding the --disable-openmp (line 58 on my system), then installed, and its fixed!Ludewig
C
2

Not an answer, just my experiences:

I also stumbled on this problem in one of my own projects. I have this problem on os x (snow leopard) using ruby-1.9.2-p0, and ruby-1.9.2-p136.

What was particularly confusing to me was that I can read in an image using rmagick via rails console. But when I hit the exact same line from my rails app it blows up the same way as outlined above.

Rebuilding imagemagick via homebrew as outlined above wasn't enough for me. I also had to delete the rmagick gem and rebuild it via bundle.

Connie answered 17/2, 2011 at 3:59 Comment(0)
S
2

If you have already installed imagemagick with brew, use this:

brew upgrade -f imagemagick --disable-openmp
Sibella answered 26/8, 2011 at 16:16 Comment(0)
S
1

UPDATE: This isn't really a true answer per se (I'm still seeing the same problem in MRI 1.9.1), but I used RVM to get my MRI 1.8.7 installation and gems up to date and tried running it, and everything works perfectly. I assume the problem is that RMagick isn't yet quite compatible with 1.9.1 yet, though the documentation does specifically mention Ruby 1.9 support.

Straphanger answered 15/5, 2010 at 2:53 Comment(0)
O
1

Saw the same problem after upgrading ImageMagick on a Linux box. There are some more notes here. I suspect some mismatch of ImageMagick libraries and linked ruby gems (which is in agreement with all the previous comments. Check out this similar thread at rubyforge. http://rubyforge.org/forum/forum.php?thread_id=48036&forum_id=33

My solution was to dump RMagick in favor of MojoMagick - a very lean ruby API which doesn't link to ImageMagick libraries but simply uses the console binaries.

It's available here : www.misuse.org/science/2008/01/30/mojomagick-ruby-image-library-for-imagemagick/

I've built a gem and added resize to fill with crop functionality which is available on github https://github.com/bunnymatic/mojo_magick

Overnight answered 28/8, 2011 at 7:22 Comment(0)
M
0

I tried CaptainPete's MacPorts solution. It built 6.6.6-0 and still had the same problem. Switching to brew to do the build did the trick. Note that brew built 6.6.4-5. It's possible there are multiple bugs or a new bug in 6.6.6 that causes similar problems to occur.

Masaryk answered 30/11, 2010 at 16:55 Comment(0)
J
0

None of these answers fixed it in my case.

After investigating further, I found that I was calling .resample on a 0.02dpi image (I pull the images from a 3rd party API so I had no idea). This was even prompting a "disk almost full" alert message after the segmentation fault error would show up.

Jeanelle answered 22/6, 2011 at 3:31 Comment(0)
I
0

I solved the same error (after many trials) by moving the 'gem "pg"' line in the gemfile below the fog gem, had something to do with loading dependencies I think.

Inalterable answered 28/7, 2011 at 20:5 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.