libvips / php-vips-ext

Low-level libvips binding for PHP
MIT License
101 stars 11 forks source link

segmentation fault with php7.4 on mac m1 #41

Closed mstaack closed 3 years ago

mstaack commented 3 years ago

hey there, i have found the vips.so extension throwing a segmentation fault on my macbook m1 (arm chip).

./vendor/bin/phpunit
PHPUnit 9.5.5 by Sebastian Bergmann and contributors.

.......................                                           23 / 23 (100%)

Time: 00:00.648, Memory: 60.50 MB

OK (23 tests, 119 assertions)
[1]    64109 segmentation fault  ./vendor/bin/phpunit

disabling the extension removes the segfault at the end of phpunit

php:

PHP 7.4.20 (cli) (built: Jun  3 2021 19:10:14) ( NTS )

vips:


vips property => value
Vips headers version => 8.11.0
Vips library version => 8.11.0
Vips ABI version => 55.0.13
Major version => 8
Minor version => 11
Micro version => 0
Cache max mem => 104857600
Cache max operations => 100
Cache current operations => 0
Cache max open files => 100
Memory allocations => 0
Memory currently allocated => 0
Memory high water => 0
Concurrency => 8
SIMD support with liborc => yes
JPEG support => yes
PNG support => yes
TIFF support => yes
GIF support => yes
OpenEXR support => yes
load OpenSlide => yes
load Matlab => yes
load PDF => yes
load SVG => yes
FITS support => yes
WebP support => yes
HEIF support => yes
load with libMagick => yes
Text rendering support => yes
ICC profile support with lcms => yey
vips -v
vips-8.11.0-Wed Jun  9 18:20:35 UTC 202

thank you for this awesome image library!

jcupitt commented 3 years ago

Hi @mstaack, sorry for the late reply.

I don't know why it's failing. Is this all built with homebrew?

mstaack commented 3 years ago

Yes straight m1 homebrew PHP 7.4. extension by pecl.

Any ideas to get down to the issue? Happy to help where I can.

mstaack commented 3 years ago

@jcupitt upgrading to vips-8.11.1-Tue Jun 29 07:30:12 UTC 2021 solves this for me!

jcupitt commented 3 years ago

Huh I wonder why? Anyway, I'm very glad it's now working.

kleisauke commented 3 years ago

Perhaps PR https://github.com/libvips/libvips/pull/2323 resolved it? libvips formula in Homebrew doesn't configure with --enable-shared --disable-static, so dynamic modules are not build on macOS now.

If that's the case, it's still strange why this segfault occurs with modules enabled. The only thing I can think of is that it fails during dlopen (security enforcement features of macOS?). Note that it tries to dlopen a .so library instead of .dylib due to https://gitlab.gnome.org/GNOME/glib/-/issues/1413.