Skip to content
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

Crashes webserver when used with apache and mod_php #214

Open
ausi opened this issue Jul 26, 2023 · 5 comments
Open

Crashes webserver when used with apache and mod_php #214

ausi opened this issue Jul 26, 2023 · 5 comments

Comments

@ausi
Copy link

ausi commented Jul 26, 2023

I’m using Apache 2.4.57 with PHP 8.1.21 loaded as mod_php (PHP SAPI apache2handler).

Using vips via the command line works as expected,
but running the same code on the webserver crashes with the following error:

objc[30622]: +[NSCheapMutableString initialize] may have been in progress in another thread when fork() was called.
objc[30622]: +[NSCheapMutableString 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 Jul 26 22:52:34.952832 2023] [core:notice] [pid 28824] AH00052: child pid 30622 exit signal Abort trap (6)
@jcupitt
Copy link
Member

jcupitt commented Jul 26, 2023

Hi @ausi,

This is an issue on macOS, is that your platform? It's been investigated for ruby-vips:

libvips/ruby-vips#155

Possibly, starting php-vips earlier could fix this.

@ausi
Copy link
Author

ausi commented Jul 27, 2023

This is an issue on macOS, is that your platform?

Yes:

$ uname -a
Darwin ….local 22.5.0 Darwin Kernel Version 22.5.0: Thu Jun  8 22:22:20 PDT 2023; root:xnu-8796.121.3~7/RELEASE_ARM64_T6000 arm64

Possibly, starting php-vips earlier could fix this.

I don’t know what that means ☺️

@adamkiss
Copy link

I have exactly the same problem with nginx 1.23.3 and PHP 8.2.10

The same exact code runs via CLI, but just kills the php-fpm thread it runs on.

From phpinfo();

PHP Version => 8.2.10
System => Darwin km.local 22.5.0 Darwin Kernel Version 22.5.0: Thu Jun  8 22:22:20 PDT 2023; root:xnu-8796.121.3~7/RELEASE_ARM64_T6000 arm64

@lemontango
Copy link

lemontango commented Nov 14, 2023

I recently installed PHP 8.2 and Apache 2.4 with Homebrew on OS X Sonoma.

Running php-libvips from Terminal works fine, but when running it via Apache the server immediately drops connection and crashes.

I see this in the Apache-log:
objc[8822]: +[NSCheapMutableString 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.

Any advice would be greatly appreciated.

@jcupitt
Copy link
Member

jcupitt commented Nov 14, 2023

Did you read the ruby-vips issue linked above? The problem is with dynamic libraries on macos loading after a fork(). You need to somehow force the library to load earlier in process startup, or perhaps run your server in a VM.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants