Rails App runs in WEBrick but specific ruby command causes crash in Passenger

14 views
Skip to first unread message

Tony Lembke

unread,
May 18, 2016, 12:21:26 AM5/18/16
to Phusion Passenger Discussions

I have a rails app that runs well using WEBrick in production mode, and starts well in Passenger, but causes a ruby segmentation fault when calling a particular command (using MacOSX Server 5.1.5  Apache)

The stated error error is "Incomplete response received from application"
An extract from the log file is

App 2774 stderr: /Users/cpd/Projects/aladdin/app/controllers/genie_controller.rb:30: [BUG] Segmentation fault at 0x00000000000110

An apache log file and ruby crash report are attached.

Any advice as to how to pursue this would be much appreciated. I have spent a couple of days trying to get to the bottom of it.

The offending command is a call to ruby-odbc (this works fine in WEBrick but not in Fusion)

dbh=ODBC.connect(dsn_name,@username,@password)

I have upgraded MacOSX (El Capitane 10.11.5), MacOSX Server 5.1.5, Ruby 2.3.1, Rails 2.4, and am using passenger: stable 5.0.26

passenger.conf 

LoadModule passenger_module /usr/local/opt/passenger/libexec/buildout/apache2/mod_passenger.so
 
PassengerRoot /usr/local/opt/passenger/libexec/src/ruby_supportlib/phusion_passenger/locations.ini
 
RailsEnv production
 
PassengerFriendlyErrorPages on
 
PassengerDefaultRuby /Users/cpd/.rvm/gems/ruby-2.3.1@rails2.4/wrappers/ruby


Thanks very much for any advice as to where to turn next.

Tony Lembke


ruby.crash
apache.log

Daniel Knoppel

unread,
May 18, 2016, 4:24:57 AM5/18/16
to Phusion Passenger Discussions
You should note that this is not a Passenger crash, but an application crash (i.e. something in your application or the libraries it uses). The first suspect would be ruby-odbc.

There can be multiple reasons why it happens while running under Passenger and not Webrick, for example, it could be that you're using a different ruby, rails or ruby-odbc gem version for Passenger. Or maybe because Passenger can handle a higher load the stress on the app is higher and more likely to reveal issues. Or maybe because the gem needs some kind of environment settings that are filtered out by Nginx.

- Daniel

Tony Lembke

unread,
May 25, 2016, 9:04:45 AM5/25/16
to Phusion Passenger Discussions
Thanks very much Daniel,
I was able to prevent this crash by using the direct spawn method
PassengerSpawnMethod direct
All good,
Cheers,
Tony Lembke
Reply all
Reply to author
Forward
0 new messages