Skip to content
This repository has been archived by the owner on Oct 6, 2023. It is now read-only.

5.0.2 extension for php 7.4 zts compiled as non-zts #97

Open
glensc opened this issue Apr 19, 2020 · 1 comment
Open

5.0.2 extension for php 7.4 zts compiled as non-zts #97

glensc opened this issue Apr 19, 2020 · 1 comment

Comments

@glensc
Copy link

glensc commented Apr 19, 2020

PHP Warning:  PHP Startup: Unable to load dynamic library '/tideways_xhprof-7.4-zts.so' (tried: /tideways_xhprof-7.4-zts.so (/tideways_xhprof-7.4-zts.so: undefined symbol: compiler_globals), /usr/local/lib/php/extensions/no-debug-zts-20190902//tideways_xhprof-7.4-zts.so.so (/usr/local/lib/php/extensions/no-debug-zts-20190902//tideways_xhprof-7.4-zts.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0

The undefined symbol: compiler_globals indicates that extension was compiled NTS but attempted to be loaded as ZTS.

I discovered this fault when attempted to use your extension in Travis CI:

@glensc
Copy link
Author

glensc commented Apr 19, 2020

here's a script that tests all versions via docker images. integrate in your qa.

 #!/bin/sh

set -eu
for m in $(seq 0 4); do
	v=7.$m

	ext=tideways_xhprof-$v.so
	local=$(pwd)/tideways_xhprof-5.0.2/$ext
	if test -f $local; then
		docker run --rm \
			-v $local:/tideways_xhprof-$v.so \
			php:$v-cli \
			php -dextension=/tideways_xhprof-$v.so -r 'printf("- %s (%s): %s\n", PHP_VERSION, PHP_ZTS ? "ZTS": "NTS", var_export(extension_loaded("tideways_xhprof"), 1));'
	fi

	ext=tideways_xhprof-$v-zts.so
	local=$(pwd)/tideways_xhprof-5.0.2/$ext
	if test -f $local; then
		docker run --rm \
			-v $local:/$ext \
			php:$v-zts \
			php -dextension=/$ext -r 'printf("- %s (%s): %s\n", PHP_VERSION, PHP_ZTS ? "ZTS": "NTS", var_export(extension_loaded("tideways_xhprof"), 1));'
	fi
done
➔ ./test-all.sh
- 7.0.33 (NTS): true
- 7.1.33 (NTS): true
- 7.1.33 (ZTS): true
- 7.2.30 (NTS): true
- 7.2.30 (ZTS): true
- 7.3.17 (NTS): true
- 7.3.17 (ZTS): true
- 7.4.5 (NTS): true
- 7.4.5 (ZTS): false
PHP Warning:  PHP Startup: Unable to load dynamic library '/tideways_xhprof-7.4-zts.so' (tried: /tideways_xhprof-7.4-zts.so (/tideways_xhprof-7.4-zts.so: undefined symbol: compiler_globals), /usr/local/lib/php/extensions/no-debug-zts-20190902//tideways_xhprof-7.4-zts.so.so (/usr/local/lib/php/extensions/no-debug-zts-20190902//tideways_xhprof-7.4-zts.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0

also, do you know that your download is lacking 7.0-zts extension?

glensc added a commit to perftools/php-profiler that referenced this issue Apr 19, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant