passenger: MacOS High Sierra Apache, Case-insensitive FS causes fork() sanitizer crash.

Help please: https://stackoverflow.com/questions/46628052/phusion-passenger-installation-error-in-macos-10-13-high-sierra


## Issue report
/Library/Developer/CommandLineTools/usr/bin/ranlib: file: buildout/apache2/module_libboost_oxt.a(regex_debug.o) has no symbols
/Library/Developer/CommandLineTools/usr/bin/ranlib: file: buildout/apache2/module_libboost_oxt.a(tss_null.o) has no symbols
clang -o buildout/apache2/mod_passenger.o  -Isrc/agent -Isrc/cxx_supportlib -Isrc/cxx_supportlib/vendor-copy -Isrc/cxx_supportlib/vendor-modified -fPIC -D_REENTRANT -I/usr/local/include -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wpointer-arith -Wwrite-strings -Wno-long-long -Wno-missing-field-initializers -fvisibility=hidden -DVISIBILITY_ATTRIBUTE_SUPPORTED -g -DHAS_ALLOCA_H -DHAS_SFENCE -DHAS_LFENCE -DPASSENGER_DEBUG -DBOOST_DISABLE_ASSERTS -c src/apache2_module/mod_passenger.c
src/apache2_module/mod_passenger.c:26:10: fatal error: 'httpd.h' file not found
#include <httpd.h>
         ^~~~~~~~~
1 error generated.
rake aborted!
Command failed with status (1): [clang -o buildout/apache2/mod_passenger.o  -Isrc/agent -Isrc/cxx_supportlib -Isrc/cxx_supportlib/vendor-copy -Isrc/cxx_supportlib/vendor-modified -fPIC -D_REENTRANT -I/usr/local/include -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wpointer-arith -Wwrite-strings -Wno-long-long -Wno-missing-field-initializers -fvisibility=hidden -DVISIBILITY_ATTRIBUTE_SUPPORTED -g -DHAS_ALLOCA_H -DHAS_SFENCE -DHAS_LFENCE -DPASSENGER_DEBUG -DBOOST_DISABLE_ASSERTS -c src/apache2_module/mod_passenger.c]
/private/tmp/passenger-20171008-7392-owxt2w/passenger-5.1.8/build/support/cplusplus.rb:53:in `run_compiler'
/private/tmp/passenger-20171008-7392-owxt2w/passenger-5.1.8/build/support/cplusplus.rb:97:in `compile_c'
/private/tmp/passenger-20171008-7392-owxt2w/passenger-5.1.8/build/support/cplusplus.rb:154:in `block in define_c_object_compilation_task'
Tasks: TOP => apache2 => buildout/apache2/mod_passenger.so => buildout/apache2/mod_passenger.o

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 96 (43 by maintainers)

Commits related to this issue

Most upvoted comments

So the current workarounds are:

  • Use a non-system apache (so it doesn’t have apple’s patches)
  • Set the OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES env var to the apache launchd plist (requires disabling SIP)
  • Add PassengerHighPerformance on to your virtualhost if your app can work that way
  • Use a case-sensitive filesystem (requires a fresh install of macOS)

Ok that confirms my suspicion. Apple introduced a bug into the system Apache in High Sierra, you can review the change yourself if it interests you here:

The original file: https://opensource.apple.com/source/apache/apache-822/httpd/server/request.c.orig.auto.html Apple’s modified file: https://opensource.apple.com/source/apache/apache-822/httpd/server/request.c.auto.html

Particularly, they call CFLocaleCopyCurrent in files_strcmp, which after a long call tree loads the Obj-C runtime (something Core Foundation is not supposed to do).

What’s interesting to me is that when an older Passenger is loaded this does not occur, and presumably this also doesn’t occur when mod_passenger is not loaded at all (maybe someone could check that case). Meaning that this files_strcmp function is triggered because mod_passenger is loaded.

I’ll poke around to see if I can find a way to avoid triggering the bug.

@NDuggan ah, no that’s fine, I thought you were also testing with a static site, but actually using Passenger is an even better test 😃

@CamJN Using apachectl and using smart spawning. Disabling smart spawning didn’t change anything.

@NDuggan See https://www.phusionpassenger.com/library/indepth/ruby/spawn_methods/.