-
Notifications
You must be signed in to change notification settings - Fork 548
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MacOS High Sierra Apache, Case-insensitive FS causes fork() sanitizer crash. #1986
Comments
High Sierra support was recently added to stable and will be part of the upcoming release 5.1.11. |
Thanks for the speedy response. |
I don't see that it's fixed in 5.1.11. I'm running 10.13 (17A405) both with/without "Command Line Tools (macOS High Sierra version 10.13) for Xcode" (version 9.0) installed I was able to get the compile to complete by modifying apache.rb as such:
If you're running home-brew ruby, here's the process
|
@patricksereno you are installing from a gem, that is a different process than homebrew, perhaps open another issue? |
This is the log message I’m receiving:
objc[82628]: +[__NSCFConstantString initialize] may have been in progress in another thread when fork() was called.
objc[82628]: +[__NSCFConstantString initialize] may have been in progress in another thread when fork() was called. We cannot safely call it or ignore it in the fork() child process. Crashing instead. Set a breakpoint on objc_initializeAfterForkError to debug.
[Wed Oct 18 22:39:47.939850 2017] [core:notice] [pid 53108] AH00052: child pid 82628 exit signal Abort trap (6)
It only happens on the / URI. If I go to a sub-URI, such as /apple-touch-icon-152x152-precomposed.png, the service works fine.
I’m going to try the bottle and I’ll let you know if this fixes it.
Best regards,
Patrick Sereno
|
@patricksereno It looks like your High Sierra system is a bit different than the ones we tested on. Can you tell me what you see if you run these command?
|
/usr/include/apache2/httpd.h
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/apache2/httpd.h
Patrick Sereno
… On Oct 18, 2017, at 11:24 PM, Hongli Lai ***@***.***> wrote:
find / -name httpd.h
|
…ation Apparently on some systems the Apache header files may be in a different location than on our test systems. Partially closes GH-1986.
Thanks @patricksereno. I've published a branch And can you also show me what @CamJN As for his |
This is the log dump from running passenger from the home-brew bottle:
[ N 2017-10-18 23:06:42.2085 93306/T1 age/Wat/WatchdogMain.cpp:1267 ]: Starting Passenger watchdog...
[ N 2017-10-18 23:06:42.3248 93308/T1 age/Cor/CoreMain.cpp:1165 ]: Starting Passenger core...
[ N 2017-10-18 23:06:42.3260 93308/T1 age/Cor/CoreMain.cpp:249 ]: Passenger core running in multi-application mode.
[ W 2017-10-18 23:06:42.3443 93308/T1 age/Cor/CoreMain.cpp:897 ]: WARNING: potential privilege escalation vulnerability. Passenger is running as root, and part(s) of the passenger root path (/usr/local/opt/passenger/libexec/src/ruby_supportlib/phusion_passenger/locations.ini) can be changed by non-root user(s):
The path "/usr/local/opt/passenger/libexec/src/ruby_supportlib/phusion_passenger/locations.ini" can be modified by user "administrator" (or applications running as that user). Change the owner of the path to root, or avoid running Passenger as root.
The path "/usr/local/opt/passenger/libexec/src/ruby_supportlib/phusion_passenger" can be modified by user "administrator" (or applications running as that user). Change the owner of the path to root, or avoid running Passenger as root.
The path "/usr/local/opt/passenger/libexec/src/ruby_supportlib" can be modified by user "administrator" (or applications running as that user). Change the owner of the path to root, or avoid running Passenger as root.
The path "/usr/local/opt/passenger/libexec/src" can be modified by user "administrator" (or applications running as that user). Change the owner of the path to root, or avoid running Passenger as root.
The path "/usr/local/opt/passenger/libexec" can be modified by user "administrator" (or applications running as that user). Change the owner of the path to root, or avoid running Passenger as root.
The path "/usr/local/opt/passenger" can be modified by user "administrator" (or applications running as that user). Change the owner of the path to root, or avoid running Passenger as root.
The path "/usr/local/opt" can be modified by user "administrator" (or applications running as that user). Change the owner of the path to root, or avoid running Passenger as root.
[ N 2017-10-18 23:06:42.3444 93308/T1 age/Cor/CoreMain.cpp:905 ]: Passenger core online, PID 93308
[ N 2017-10-18 23:06:42.4692 93308/T7 age/Cor/CoreMain.cpp:589 ]: Signal received. Gracefully shutting down... (send signal 2 more time(s) to force shutdown)
[ N 2017-10-18 23:06:42.4694 93308/T1 age/Cor/CoreMain.cpp:1080 ]: Received command to shutdown gracefully. Waiting until all clients have disconnected...
[ N 2017-10-18 23:06:42.4701 93308/Tn Ser/Server.h:885 ]: [ApiServer] Freed 0 spare client objects
[ N 2017-10-18 23:06:42.4702 93308/T9 Ser/Server.h:885 ]: [ServerThr.2] Freed 128 spare client objects
[ N 2017-10-18 23:06:42.4703 93308/Tb Ser/Server.h:885 ]: [ServerThr.3] Freed 128 spare client objects
[ N 2017-10-18 23:06:42.4703 93308/T9 Ser/Server.h:531 ]: [ServerThr.2] Shutdown finished
[ N 2017-10-18 23:06:42.4704 93308/Tb Ser/Server.h:531 ]: [ServerThr.3] Shutdown finished
[ N 2017-10-18 23:06:42.4704 93308/Tg Ser/Server.h:885 ]: [ServerThr.5] Freed 128 spare client objects
[ N 2017-10-18 23:06:42.4704 93308/Th Ser/Server.h:885 ]: [ServerThr.6] Freed 128 spare client objects
[ N 2017-10-18 23:06:42.4703 93308/T7 Ser/Server.h:885 ]: [ServerThr.1] Freed 128 spare client objects
[ N 2017-10-18 23:06:42.4703 93308/Tn Ser/Server.h:531 ]: [ApiServer] Shutdown finished
[ N 2017-10-18 23:06:42.4705 93308/Td Ser/Server.h:885 ]: [ServerThr.4] Freed 128 spare client objects
[ N 2017-10-18 23:06:42.4706 93308/Tl Ser/Server.h:885 ]: [ServerThr.8] Freed 128 spare client objects
[ N 2017-10-18 23:06:42.4705 93308/Tk Ser/Server.h:885 ]: [ServerThr.7] Freed 128 spare client objects
[ N 2017-10-18 23:06:42.4708 93308/Th Ser/Server.h:531 ]: [ServerThr.6] Shutdown finished
[ N 2017-10-18 23:06:42.4709 93308/T7 Ser/Server.h:531 ]: [ServerThr.1] Shutdown finished
[ N 2017-10-18 23:06:42.4710 93308/Td Ser/Server.h:531 ]: [ServerThr.4] Shutdown finished
[ N 2017-10-18 23:06:42.4711 93308/Tl Ser/Server.h:531 ]: [ServerThr.8] Shutdown finished
[ N 2017-10-18 23:06:42.4707 93308/Tg Ser/Server.h:531 ]: [ServerThr.5] Shutdown finished
[ N 2017-10-18 23:06:42.4711 93308/Tk Ser/Server.h:531 ]: [ServerThr.7] Shutdown finished
[ N 2017-10-18 23:06:42.5302 93311/T1 age/Wat/WatchdogMain.cpp:1267 ]: Starting Passenger watchdog...
[ N 2017-10-18 23:06:42.5641 93313/T1 age/Cor/CoreMain.cpp:1165 ]: Starting Passenger core...
[ N 2017-10-18 23:06:42.5653 93313/T1 age/Cor/CoreMain.cpp:249 ]: Passenger core running in multi-application mode.
[ W 2017-10-18 23:06:42.5843 93313/T1 age/Cor/CoreMain.cpp:897 ]: WARNING: potential privilege escalation vulnerability. Passenger is running as root, and part(s) of the passenger root path (/usr/local/opt/passenger/libexec/src/ruby_supportlib/phusion_passenger/locations.ini) can be changed by non-root user(s):
The path "/usr/local/opt/passenger/libexec/src/ruby_supportlib/phusion_passenger/locations.ini" can be modified by user "administrator" (or applications running as that user). Change the owner of the path to root, or avoid running Passenger as root.
The path "/usr/local/opt/passenger/libexec/src/ruby_supportlib/phusion_passenger" can be modified by user "administrator" (or applications running as that user). Change the owner of the path to root, or avoid running Passenger as root.
The path "/usr/local/opt/passenger/libexec/src/ruby_supportlib" can be modified by user "administrator" (or applications running as that user). Change the owner of the path to root, or avoid running Passenger as root.
The path "/usr/local/opt/passenger/libexec/src" can be modified by user "administrator" (or applications running as that user). Change the owner of the path to root, or avoid running Passenger as root.
The path "/usr/local/opt/passenger/libexec" can be modified by user "administrator" (or applications running as that user). Change the owner of the path to root, or avoid running Passenger as root.
The path "/usr/local/opt/passenger" can be modified by user "administrator" (or applications running as that user). Change the owner of the path to root, or avoid running Passenger as root.
The path "/usr/local/opt" can be modified by user "administrator" (or applications running as that user). Change the owner of the path to root, or avoid running Passenger as root.
[ N 2017-10-18 23:06:42.5844 93313/T1 age/Cor/CoreMain.cpp:905 ]: Passenger core online, PID 93313
[Wed Oct 18 23:06:42.587272 2017] [mpm_prefork:notice] [pid 93301] AH00163: Apache/2.4.27 (Unix) Phusion_Passenger/5.1.11 LibreSSL/2.2.7 configured -- resuming normal operations
[Wed Oct 18 23:06:42.587344 2017] [core:notice] [pid 93301] AH00094: Command line: '/usr/sbin/httpd -D SERVER_APP_HAS_DEFAULT_PORTS -D FOREGROUND -f /Library/Server/Web/Config/apache2/httpd_server_app.conf -E /var/log/apache2/error_log -D WEBSERVICE_ON'
[ N 2017-10-18 23:06:42.9844 93308/T1 age/Cor/CoreMain.cpp:1150 ]: Passenger core shutdown finished
[ N 2017-10-18 23:06:46.0801 93313/T5 age/Cor/SecurityUpdateChecker.h:374 ]: Security update check: no update found (next check in 24 hours)
objc[93521]: +[__NSCFConstantString initialize] may have been in progress in another thread when fork() was called.
objc[93521]: +[__NSCFConstantString initialize] may have been in progress in another thread when fork() was called. We cannot safely call it or ignore it in the fork() child process. Crashing instead. Set a breakpoint on objc_initializeAfterForkError to debug.
[Wed Oct 18 23:08:28.389155 2017] [core:notice] [pid 93301] AH00052: child pid 93521 exit signal Abort trap (6)
This actually made things worse, now
Patrick Sereno
… On Oct 18, 2017, at 10:44 PM, Patrick Sereno ***@***.***> wrote:
This is the log message I’m receiving:
objc[82628]: +[__NSCFConstantString initialize] may have been in progress in another thread when fork() was called.
objc[82628]: +[__NSCFConstantString initialize] may have been in progress in another thread when fork() was called. We cannot safely call it or ignore it in the fork() child process. Crashing instead. Set a breakpoint on objc_initializeAfterForkError to debug.
[Wed Oct 18 22:39:47.939850 2017] [core:notice] [pid 53108] AH00052: child pid 82628 exit signal Abort trap (6)
It only happens on the / URI. If I go to a sub-URI, such as /apple-touch-icon-152x152-precomposed.png, the service works fine.
I’m going to try the bottle and I’ll let you know if this fixes it.
Best regards,
Patrick Sereno
> On Oct 18, 2017, at 9:15 AM, Camden Narzt ***@***.*** ***@***.***>> wrote:
>
> I'm on HS and use homebrew to manage Passenger, and it works on my box (I have both xcode and the cli tools installed). Also there is a HS bottle available from homebrew so it works on their CI as well.
>
> Perhaps you could detail the errors you saw?
>
> —
> You are receiving this because you commented.
> Reply to this email directly, view it on GitHub <#1986 (comment)>, or mute the thread <https://github.com/notifications/unsubscribe-auth/ADwXLQgIlAZFKTPcAl4d103PTcrrOxDhks5stiQTgaJpZM4PxndV>.
>
|
@patricksereno Are you running Apache with the event, worker, or prefork MPM module in use? |
prefork. I'm using macOS Server Version 5.4 (17S1207). This appears to default to prefork.
|
@patricksereno could you apply the following patch and recompile? There will be some clang warnings about unused flags, that's fine. I haven't been able to reproduce your issue, unfortunately so I can't verify it myself.
|
Below is the output from attempted compile/install:
$ bin/passenger-install-apache2-module
Welcome to the Phusion Passenger Apache 2 module installer, v5.1.12.
This installer will guide you through the entire installation process. It
shouldn't take more than 3 minutes in total.
Here's what you can expect from the installation process:
1. The Apache 2 module will be installed for you.
2. You'll learn how to configure Apache.
3. You'll learn how to deploy a Ruby on Rails application.
Don't worry if anything goes wrong. This installer will advise you on how to
solve any problems.
Press Enter to continue, or Ctrl-C to abort.
…--------------------------------------------
Which languages are you interested in?
Use <space> to select.
If the menu doesn't display correctly, press '!'
⬢ Ruby
⬡ Python
‣ ⬡ Node.js
⬡ Meteor
--------------------------------------------
Checking for required software...
* Checking for C compiler...
Found: yes
Location: /usr/bin/cc
* Checking for C++ compiler...
Found: yes
Location: /usr/bin/c++
* Checking for Curl development headers with SSL support...
Found: yes
curl-config location: /usr/bin/curl-config
Header location: /usr/include/curl/curl.h
Version: libcurl 7.54.0
Usable: yes
Supports SSL: yes
* Checking for Zlib development headers...
Found: yes
Location: /usr/include/zlib.h
* Checking for Apache 2...
Found: yes
Location of httpd: /usr/sbin/httpd
Apache version: 2.4.27
* Checking for Rake (associated with /usr/local/Cellar/ruby/2.4.2/bin/ruby)...
Found: yes
Location: /usr/local/Cellar/ruby/2.4.2/bin/ruby /usr/local/Cellar/ruby/2.4.2/bin/rake
* Checking for OpenSSL support for Ruby...
Found: yes
* Checking for RubyGems...
Found: yes
* Checking for Ruby development headers...
Found: yes
Location: /usr/local/Cellar/ruby/2.4.2/include/ruby-2.4.0/ruby.h
* Checking for rack...
Found: yes
--------------------------------------------
Checking whether there are multiple Apache installations...
Only a single installation detected. This is good.
--------------------------------------------
Compiling and installing Apache 2 module...
cd /Users/administrator/passenger
# env NOEXEC_DISABLE=1 /usr/local/Cellar/ruby/2.4.2/bin/ruby /usr/local/Cellar/ruby/2.4.2/bin/rake RELEASE=yes apache2:clean apache2
rm -rf buildout/cache
rm -rf buildout/common/libboost_oxt.a buildout/common/libboost_oxt
rm -f buildout/common/libpassenger_common/LoggingKit.o buildout/common/libpassenger_common/Exceptions.o buildout/common/libpassenger_common/ProcessManagement/Spawn.o buildout/common/libpassenger_common/ProcessManagement/Utils.o buildout/common/libpassenger_common/Utils/SystemTime.o buildout/common/libpassenger_common/Utils/StrIntUtils.o buildout/common/libpassenger_common/Utils/StrIntUtilsNoStrictAliasing.o buildout/common/libpassenger_common/Utils/IOUtils.o buildout/common/libpassenger_common/Utils/Hasher.o buildout/common/libpassenger_common/Utils.o buildout/common/libpassenger_common/jsoncpp.o
rm -f buildout/common/libpassenger_common/Crypto.o buildout/common/libpassenger_common/Utils/CachedFileStat.o buildout/common/libpassenger_common/Utils/LargeFiles.o buildout/common/libpassenger_common/WatchdogLauncher.o buildout/common/libpassenger_common/MemoryKit/mbuf.o buildout/common/libpassenger_common/MemoryKit/palloc.o buildout/common/libpassenger_common/ServerKit/http_parser.o buildout/common/libpassenger_common/ServerKit/Implementation.o buildout/common/libpassenger_common/DataStructures/LString.o buildout/common/libpassenger_common/AppTypes.o
rm -f buildout/common/libpassenger_common/vendor-modified/modp_b64.o buildout/common/libpassenger_common/vendor-modified/modp_b64_strict_aliasing.o
rm -f buildout/common/libpassenger_common/UnionStationFilterSupport.o
rm -f buildout/common/libpassenger_common/ProcessManagement/Ruby.o
rm -rf buildout/common/libpassenger_common
rm -rf buildout/support-binaries/
rm -rf buildout/apache2/module_libboost_oxt.a buildout/apache2/module_libboost_oxt
rm -f buildout/apache2/module_libpassenger_common/LoggingKit.o buildout/apache2/module_libpassenger_common/Exceptions.o buildout/apache2/module_libpassenger_common/ProcessManagement/Spawn.o buildout/apache2/module_libpassenger_common/ProcessManagement/Utils.o buildout/apache2/module_libpassenger_common/Utils/SystemTime.o buildout/apache2/module_libpassenger_common/Utils/StrIntUtils.o buildout/apache2/module_libpassenger_common/Utils/StrIntUtilsNoStrictAliasing.o buildout/apache2/module_libpassenger_common/Utils/IOUtils.o buildout/apache2/module_libpassenger_common/Utils/Hasher.o buildout/apache2/module_libpassenger_common/Utils.o buildout/apache2/module_libpassenger_common/jsoncpp.o
rm -f buildout/apache2/module_libpassenger_common/Crypto.o buildout/apache2/module_libpassenger_common/Utils/CachedFileStat.o buildout/apache2/module_libpassenger_common/Utils/LargeFiles.o buildout/apache2/module_libpassenger_common/WatchdogLauncher.o buildout/apache2/module_libpassenger_common/MemoryKit/mbuf.o buildout/apache2/module_libpassenger_common/MemoryKit/palloc.o buildout/apache2/module_libpassenger_common/ServerKit/http_parser.o buildout/apache2/module_libpassenger_common/ServerKit/Implementation.o buildout/apache2/module_libpassenger_common/DataStructures/LString.o buildout/apache2/module_libpassenger_common/AppTypes.o
rm -f buildout/apache2/module_libpassenger_common/vendor-modified/modp_b64.o buildout/apache2/module_libpassenger_common/vendor-modified/modp_b64_strict_aliasing.o
rm -f buildout/apache2/module_libpassenger_common/UnionStationFilterSupport.o
rm -f buildout/apache2/module_libpassenger_common/ProcessManagement/Ruby.o
rm -rf buildout/apache2/module_libpassenger_common
rm -rf buildout/apache2/mod_passenger.o buildout/apache2/Configuration.o buildout/apache2/Bucket.o buildout/apache2/Hooks.o buildout/apache2/mod_passenger.so
rake aborted!
LoadError: cannot load such file -- /Users/administrator/passenger/build/support/vendor/cxxcodebuilder/lib/cxxcodebuilder
/Users/administrator/passenger/Rakefile:42:in `require_build_system_file'
/Users/administrator/passenger/build/support/general.rb:28:in `initialize'
/Users/administrator/passenger/build/common_library.rb:259:in `new'
/Users/administrator/passenger/build/common_library.rb:259:in `block in <top (required)>'
/usr/local/lib/ruby/gems/2.4.0/gems/rake-12.0.0/exe/rake:27:in `<top (required)>'
Tasks: TOP => apache2 => buildout/apache2/mod_passenger.so => buildout/apache2/module_libpassenger_common/LoggingKit.o => src/cxx_supportlib/Constants.h
(See full trace by running task with --trace)
--------------------------------------------
It looks like something went wrong
Please read our documentation for troubleshooting tips:
https://www.phusionpassenger.com/library/install/apache/
https://www.phusionpassenger.com/library/admin/apache/troubleshooting/
If that doesn't help, please use our support facilities. We'll do our best to help you.
https://www.phusionpassenger.com/support
$ git branch
* GH-1986-high-sierra-continued-fix
stable-5.1
On Oct 18, 2017, at 11:42 PM, Hongli Lai ***@***.***> wrote:
Thanks @patricksereno <https://github.com/patricksereno>. I've published a branch GH-1986-high-sierra-continued-fix. Can you check whether that one compiles correctly?
And can you also show me what sw_vers outputs?
@CamJN <https://github.com/camjn> As for his __NSCFConstantString initialize error: the message indicates that it's an Apache worker process that's crashing. Are you able to reproduce this on your system with Apache?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub <#1986 (comment)>, or mute the thread <https://github.com/notifications/unsubscribe-auth/ADwXLY1VcNDVLDHKXOOEgB8uUJD2jPNcks5stu9ygaJpZM4PxndV>.
|
Well at least that narrows it down. (Also some people will be able to work around this bug that way). |
So the current workarounds are:
|
On High Sierra (10.13) with X-Code 9.1, I was able to install the ruby gem (5.1.12), along with the patch to make it compile:
And then include in the VirtualHost configuration:
However, trying to access a file from public results in the following apache error message:
I would be inclined to blame the Sinatra 2.0.0 gem, but this is the same error that was occurring for '/' before. (Of course, this is much better than the previous state.) |
Yeah, it's going to be a game of whack a mole until Apple fixes their end. You can help that happen faster by opening bug reports at https://bugreport.apple.com/ as they prioritize duplicated bugs. |
Any update on this? I tried what @NDuggan suggested using the brew version of apache but that didn't fix the issue for me.
Passenger: 5.1.12 - Apache 2.4.28 - macOS: 10.13.2 |
@mattbob if there's a crash in the homebrew apache, that would be surprising, as it doesn't have the patches that invoke the Obj-C runtime to load. Can you get a backtrace? |
I'm not sure if this is the same error as @mattbob . I'm running a ruby app on an SSL virtual host using passenger. This is my config: https://gist.github.com/enrique-ramirez/6173de71b866ce2e3b6cb78a94b84fe7 I also want to be able to access For some reason, I cannot get both of them running. The gist config works fine for my ruby app, but when attempting to access
If I do not load the I'm sorry if this is already answered, but there are so many comments it's a bit confusing: Is there a way to get both of them running? I develop a few PHP projects, so I need apache to run them as well. |
Yes, that sounds like the same bug, please file a bug report with apple, the more they get the sooner they'll fix this. |
@enrique-ramirez deactivate apache that come with osx and reinstall like this instruction: Will work for me (passenger 5.1.12, Xcode 9.1, High Sierra 10.13.2, ruby-2.4.1 via rvm) |
Closing this issue, because the original problem was found in Apple's Apache. If you have a problem that can be shown to not involve the system Apache then you can open another issue. |
Help please:
https://stackoverflow.com/questions/46628052/phusion-passenger-installation-error-in-macos-10-13-high-sierra
The text was updated successfully, but these errors were encountered: