# Mongrel crashing when using gd2 with an uploaded file

**URL:** <https://www.ruby-forum.com/t/mongrel-crashing-when-using-gd2-with-an-uploaded-file/123967>\
**Category:** Rails\
**Created:** [December 22, 2007, 8:42pm UTC](https://www.ruby-forum.com/t/mongrel-crashing-when-using-gd2-with-an-uploaded-file/123967 "2007-12-22T20:42:16Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![mechu](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/ac91a4/32.png) [@mechu](https://www.ruby-forum.com/u/mechu)\
**Post date:** [December 22, 2007, 8:42pm UTC](https://www.ruby-forum.com/t/mongrel-crashing-when-using-gd2-with-an-uploaded-file/123967/1 "2007-12-22T20:42:16Z")

</div>

using GD2 graphic library, this code  
@image = Image.load(@params[:image].read)  
works one time, and crashes the server the second time. usually the  
mongrel window shows this error message:  
C:/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/gd2-1.1.1/lib/gd2/image.rb:120:  
[BUG] Segmentation fault  
ruby 1.8.6 (2007-03-13) [i386-mswin32]  
other times this error message shows up:  
C:/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/mongrel-1.0.1-mswin32/lib/mongrel.rb:276  
: [BUG] Segmentation fault  
ruby 1.8.6 (2007-03-13) [i386-mswin32]  
and other times, nothing.

what i see happen is that rails (or whoever) create a temporary CGI file  
in the windows TEMP folder, and fail to delete it after the script  
finished its job… the next time that rails get a file using POST it  
crashes.

I’m using instant rails on windows vista.

any suggestions on how to fix this annoyance?

thanks in advance and sorry for my beat up English…
