Export to GitHub

phusion-passenger - issue #865

4.0 passenger_native_support.so on noexec partition


Posted on Mar 23, 2013 by Happy Camel

/home/user/.passenger/native_support/4.0.0.rc5/ruby-1.9.3-x86_64-linux/passenger_native_support.so: failed to map segment from shared object: Operation not permitted - /home/user/.passenger/native_support/4.0.0.rc5/ruby-1.9.3-x86_64-linux/passenger_native_support.so (LoadError)

/home is mounted as noexec.

I did not find any documentation about this passenger_native_support.so and directory ~/.passenger. What is it? Does passenger_native_support.so really has to be on users home dir? Would it not be enough for system wide passenger_native_support.so - one per used ruby version? If not then at least can you make config option for a difrrent location per vhost for this .passenger dir? It would be best if actual switched user wouldnt need write permissions there (writes done as root)

Comment #1

Posted on Mar 26, 2013 by Grumpy Camel

passenger_native_support.so is a Ruby C extension that speeds up certain operations in Phusion Passenger. passenger-install-xxx-module already compiles it in stores it in the gem directory, but only for the Ruby interpreter that was used to run the installer. Each Ruby interpreter needs its own passenger_native_support.so. When Phusion Passenger sees that no passenger_native_support.so exists for the current Ruby interpreter it will compile one and store it in ~/.passenger/native_support.

I've added a quick fix for you. Set the environment variable PASSENGER_NATIVE_SUPPORT_OUTPUT_DIR from the web server.

Comment #2

Posted on Jun 26, 2013 by Swift Horse

Hi,

I have passenger_native_support.so located in the following locations: /usr/local/rvm/gems/ruby-2.0.0-p195/gems/passenger-4.0.5/libout/ruby/ruby-2.0.0-x86_64-linux/passenger_native_support.so and /usr/local/rvm/gems/ruby-1.8.7-p371/gems/passenger-4.0.5/libout/ruby/ruby-1.8.7-x86_64-linux/passenger_native_support.so

However, when I put PassengerRuby /usr/local/rvm/wrappers/ruby-1.8.7-p371/ruby in a virtual host config (apache), it doesn't know about the 1.8.7 version of passenger_native_support.so and tries to compile a new one in /usr/local/rvm/gems/ruby-2.0.0-p195/gems/passenger-4.0.5/libout/ruby/ruby-1.8.7-x86_64-linux (but it has no write access to do so).

How can I tell passenger about this 1.8.7 version of passenger_native_support.so ?

Comment #3

Posted on Jun 27, 2013 by Grumpy Camel

How does your complete configuration look like?

Comment #4

Posted on Jul 5, 2013 by Swift Horse

Hi,

Sorry for late reply, Apache config as follows:

/etc/httpd/conf.d/0passenger.conf:

LoadModule passenger_module /usr/local/rvm/gems/ruby-2.0.0-p195/gems/passenger-4.0.5/libout/apache2/mod_passenger.so PassengerRoot /usr/local/rvm/gems/ruby-2.0.0-p195/gems/passenger-4.0.5 PassengerDefaultRuby /usr/local/rvm/wrappers/ruby-2.0.0-p195/ruby

PassengerMaxPoolSize 32 PassengerPoolIdleTime 600 PassengerDefaultUser nobody PassengerUserSwitching off PassengerHighPerformance on RailsSpawnMethod smart-lv2

0: Show only errors and warnings.

PassengerLogLevel 0

SeLinux - Workaround for not being able to use /tmp

PassengerTempDir /var/www/tmp RailsEnv systest RackEnv systest

/etc/httpd/conf.d/example_service.conf:

ServerName example.com

DocumentRoot /var/www/example_service/current/public PassengerRuby /usr/local/rvm/wrappers/ruby-1.8.7-p371/ruby RackEnv systest RailsEnv systest

/etc/httpd/conf.d/example2_service.conf:

ServerName example2.com

DocumentRoot /var/www/example2_service/current/public PassengerHighPerformance on

Workaround was to symlink the 1.8.7 libout/ruby/*1.8.7 dir in to the 2.0.0 libout/ruby dir:

$ ls -lA /usr/local/rvm/gems/ruby-2.0.0-p195/gems/passenger-4.0.5/libout/ruby/ lrwxrwxrwx. 1 root root 92 Jun 26 10:53 ruby-1.8.7-x86_64-linux -> /usr/local/rvm/gems/ruby-1.8.7-p371/gems/passenger-4.0.5/libout/ruby/ruby-1.8.7-x86_64-linux drwxr-xr-x. 2 root root 4096 Jun 25 17:21 ruby-2.0.0-x86_64-linux

Comment #5

Posted on Jul 5, 2013 by Swift Horse

I see 4.0.6 is now out with a workaround for this issue. #890 noted that there should also be a command to precompile native_support using the current Ruby interpreter. Was this introduced with 4.0.6?

Comment #6

Posted on Jul 5, 2013 by Grumpy Camel

No friendly precompile command at the moment. You can do it yourself as follows:

cd passenger-config --root rvm use whatever-ruby-you-want rake native_support

Comment #7

Posted on Jul 5, 2013 by Swift Horse

Oh cool, thanks! That's friendly enough.

Status: Fixed

Labels:
Type-Defect Priority-Medium Milestone-4.0.0