Closed cgzones closed 1 year ago
That's weird, but I don't think it's possible this is a hardened_malloc bug. It must be either a glibc or PHP bug.
zend_string_release calls pefree macro which is calling through to libc free. I see no reason it would be calling any weird libc symbol. I think your php build is done in a way that it doesn't support overriding the symbols. I don't think hardened_malloc can do anything about this.
Any suggestions what compiler and linker flags, or what code patterns to look for?
I could reproduce it on Fedora 37, so it's not a problem of the Debian packaging.
Looking at the Debian build log, nothing stands out:
10275:/bin/bash /<<PKGBUILDDIR>>/ext-build/libtool --preserve-dup-deps --tag CC --mode=compile x86_64-linux-gnu-gcc -Iext/pdo/ -I/<<PKGBUILDDIR>>/ext/pdo/ -I/<<PKGBUILDDIR>>/ext-build/include -I/<<PKGBUILDDIR>>/ext-build/main -I/<<PKGBUILDDIR>> -I/<<PKGBUILDDIR>>/ext-build/ext/date/lib -I/<<PKGBUILDDIR>>/ext/date/lib -I/usr/include/libxml2 -I/usr/include/x86_64-linux-gnu -I/usr/include/enchant-2 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/libpng16 -I/usr/include/freetype2 -I/usr/include/c-client -I/<<PKGBUILDDIR>>/ext/mbstring/libmbfl -I/<<PKGBUILDDIR>>/ext-build/ext/mbstring/libmbfl -I/<<PKGBUILDDIR>>/ext/mbstring/libmbfl/mbfl -I/<<PKGBUILDDIR>>/ext-build/ext/mbstring/libmbfl/mbfl -I/usr/include/postgresql -I/usr/include/pspell -I/usr/include/editline -I/usr/include/tidy -I/<<PKGBUILDDIR>>/ext-build/TSRM -I/<<PKGBUILDDIR>>/ext-build/Zend -I/<<PKGBUILDDIR>>/main -I/<<PKGBUILDDIR>>/Zend -I/<<PKGBUILDDIR>>/TSRM -I/<<PKGBUILDDIR>>/ext-build/ -Wdate-time -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE -fno-common -Wstrict-prototypes -Wformat-truncation -Wlogical-op -Wduplicated-cond -Wno-clobbered -Wall -Wextra -Wno-strict-aliasing -Wno-unused-parameter -Wno-sign-compare -g -O2 -ffile-prefix-map=/<<PKGBUILDDIR>>=. -fstack-protector-strong -Wformat -Werror=format-security -O2 -Wall -pedantic -fsigned-char -fno-strict-aliasing -DOPENSSL_SUPPRESS_DEPRECATED -g -fvisibility=hidden -Wimplicit-fallthrough=1 -DZEND_SIGNALS -prefer-pic -DZEND_COMPILE_DL_EXT=1 -c /<<PKGBUILDDIR>>/ext/pdo/pdo.c -o ext/pdo/pdo.lo -MMD -MF ext/pdo/pdo.dep -MT ext/pdo/pdo.lo
10281: x86_64-linux-gnu-gcc -Iext/pdo/ -I/<<PKGBUILDDIR>>/ext/pdo/ -I/<<PKGBUILDDIR>>/ext-build/include -I/<<PKGBUILDDIR>>/ext-build/main -I/<<PKGBUILDDIR>> -I/<<PKGBUILDDIR>>/ext-build/ext/date/lib -I/<<PKGBUILDDIR>>/ext/date/lib -I/usr/include/libxml2 -I/usr/include/x86_64-linux-gnu -I/usr/include/enchant-2 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/libpng16 -I/usr/include/freetype2 -I/usr/include/c-client -I/<<PKGBUILDDIR>>/ext/mbstring/libmbfl -I/<<PKGBUILDDIR>>/ext-build/ext/mbstring/libmbfl -I/<<PKGBUILDDIR>>/ext/mbstring/libmbfl/mbfl -I/<<PKGBUILDDIR>>/ext-build/ext/mbstring/libmbfl/mbfl -I/usr/include/postgresql -I/usr/include/pspell -I/usr/include/editline -I/usr/include/tidy -I/<<PKGBUILDDIR>>/ext-build/TSRM -I/<<PKGBUILDDIR>>/ext-build/Zend -I/<<PKGBUILDDIR>>/main -I/<<PKGBUILDDIR>>/Zend -I/<<PKGBUILDDIR>>/TSRM -I/<<PKGBUILDDIR>>/ext-build/ -Wdate-time -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE -fno-common -Wstrict-prototypes -Wformat-truncation -Wlogical-op -Wduplicated-cond -Wno-clobbered -Wall -Wextra -Wno-strict-aliasing -Wno-unused-parameter -Wno-sign-compare -g -O2 -ffile-prefix-map=/<<PKGBUILDDIR>>=. -fstack-protector-strong -Wformat -Werror=format-security -O2 -Wall -pedantic -fsigned-char -fno-strict-aliasing -DOPENSSL_SUPPRESS_DEPRECATED -g -fvisibility=hidden -Wimplicit-fallthrough=1 -DZEND_SIGNALS -DZEND_COMPILE_DL_EXT=1 -c /<<PKGBUILDDIR>>/ext/pdo/pdo.c -MMD -MF ext/pdo/pdo.dep -MT ext/pdo/pdo.lo -fPIC -DPIC -o ext/pdo/.libs/pdo.o
10287:In file included from /<<PKGBUILDDIR>>/ext/pdo/pdo.c:28:
10292: x86_64-linux-gnu-gcc -Iext/pdo/ -I/<<PKGBUILDDIR>>/ext/pdo/ -I/<<PKGBUILDDIR>>/ext-build/include -I/<<PKGBUILDDIR>>/ext-build/main -I/<<PKGBUILDDIR>> -I/<<PKGBUILDDIR>>/ext-build/ext/date/lib -I/<<PKGBUILDDIR>>/ext/date/lib -I/usr/include/libxml2 -I/usr/include/x86_64-linux-gnu -I/usr/include/enchant-2 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/libpng16 -I/usr/include/freetype2 -I/usr/include/c-client -I/<<PKGBUILDDIR>>/ext/mbstring/libmbfl -I/<<PKGBUILDDIR>>/ext-build/ext/mbstring/libmbfl -I/<<PKGBUILDDIR>>/ext/mbstring/libmbfl/mbfl -I/<<PKGBUILDDIR>>/ext-build/ext/mbstring/libmbfl/mbfl -I/usr/include/postgresql -I/usr/include/pspell -I/usr/include/editline -I/usr/include/tidy -I/<<PKGBUILDDIR>>/ext-build/TSRM -I/<<PKGBUILDDIR>>/ext-build/Zend -I/<<PKGBUILDDIR>>/main -I/<<PKGBUILDDIR>>/Zend -I/<<PKGBUILDDIR>>/TSRM -I/<<PKGBUILDDIR>>/ext-build/ -Wdate-time -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE -fno-common -Wstrict-prototypes -Wformat-truncation -Wlogical-op -Wduplicated-cond -Wno-clobbered -Wall -Wextra -Wno-strict-aliasing -Wno-unused-parameter -Wno-sign-compare -g -O2 -ffile-prefix-map=/<<PKGBUILDDIR>>=. -fstack-protector-strong -Wformat -Werror=format-security -O2 -Wall -pedantic -fsigned-char -fno-strict-aliasing -DOPENSSL_SUPPRESS_DEPRECATED -g -fvisibility=hidden -Wimplicit-fallthrough=1 -DZEND_SIGNALS -DZEND_COMPILE_DL_EXT=1 -c /<<PKGBUILDDIR>>/ext/pdo/pdo.c -MMD -MF ext/pdo/pdo.dep -MT ext/pdo/pdo.lo -fPIC -DPIC -o ext/pdo/pdo.o >/dev/null 2>&1
12630:/bin/bash /<<PKGBUILDDIR>>/ext-build/libtool --preserve-dup-deps --tag CC --mode=link x86_64-linux-gnu-gcc -shared -I/<<PKGBUILDDIR>>/ext-build/include -I/<<PKGBUILDDIR>>/ext-build/main -I/<<PKGBUILDDIR>> -I/<<PKGBUILDDIR>>/ext-build/ext/date/lib -I/<<PKGBUILDDIR>>/ext/date/lib -I/usr/include/libxml2 -I/usr/include/x86_64-linux-gnu -I/usr/include/enchant-2 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/libpng16 -I/usr/include/freetype2 -I/usr/include/c-client -I/<<PKGBUILDDIR>>/ext/mbstring/libmbfl -I/<<PKGBUILDDIR>>/ext-build/ext/mbstring/libmbfl -I/<<PKGBUILDDIR>>/ext/mbstring/libmbfl/mbfl -I/<<PKGBUILDDIR>>/ext-build/ext/mbstring/libmbfl/mbfl -I/usr/include/postgresql -I/usr/include/pspell -I/usr/include/editline -I/usr/include/tidy -I/<<PKGBUILDDIR>>/ext-build/TSRM -I/<<PKGBUILDDIR>>/ext-build/Zend -I/<<PKGBUILDDIR>>/main -I/<<PKGBUILDDIR>>/Zend -I/<<PKGBUILDDIR>>/TSRM -I/<<PKGBUILDDIR>>/ext-build/ -Wdate-time -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE -fno-common -Wstrict-prototypes -Wformat-truncation -Wlogical-op -Wduplicated-cond -Wno-clobbered -Wall -Wextra -Wno-strict-aliasing -Wno-unused-parameter -Wno-sign-compare -g -O2 -ffile-prefix-map=/<<PKGBUILDDIR>>=. -fstack-protector-strong -Wformat -Werror=format-security -O2 -Wall -pedantic -fsigned-char -fno-strict-aliasing -DOPENSSL_SUPPRESS_DEPRECATED -g -fvisibility=hidden -Wimplicit-fallthrough=1 -DZEND_SIGNALS -Wl,-z,relro -Wl,-z,now -Wl,--as-needed -o ext/pdo/pdo.la -export-dynamic -avoid-version -prefer-pic -module -rpath /<<PKGBUILDDIR>>/ext-build/modules -L/usr/lib/x86_64-linux-gnu/mit-krb5 ext/pdo/pdo.lo ext/pdo/pdo_dbh.lo ext/pdo/pdo_stmt.lo ext/pdo/pdo_sql_parser.lo ext/pdo/pdo_sqlstate.lo
12639:x86_64-linux-gnu-gcc -shared ext/pdo/.libs/pdo.o ext/pdo/.libs/pdo_dbh.o ext/pdo/.libs/pdo_stmt.o ext/pdo/.libs/pdo_sql_parser.o ext/pdo/.libs/pdo_sqlstate.o -L/usr/lib/x86_64-linux-gnu/mit-krb5 -Wl,-z -Wl,relro -Wl,-z -Wl,now -Wl,--as-needed -Wl,-soname -Wl,pdo.so -o ext/pdo/.libs/pdo.so
12640:creating ext/pdo/pdo.la
12641:(cd ext/pdo/.libs && rm -f pdo.la && ln -s ../pdo.la pdo.la)
13997:/bin/bash /<<PKGBUILDDIR>>/ext-build/libtool --preserve-dup-deps --tag CC --mode=install cp ext/pdo/pdo.la /<<PKGBUILDDIR>>/ext-build/modules
14033:cp ext/pdo/.libs/pdo.so /<<PKGBUILDDIR>>/ext-build/modules/pdo.so
14041:cp ext/pdo/.libs/pdo.lai /<<PKGBUILDDIR>>/ext-build/modules/pdo.la
333796:/bin/bash /<<PKGBUILDDIR>>/ext-build/libtool --preserve-dup-deps --tag CC --mode=compile x86_64-linux-gnu-gcc -Iext/pdo/ -I/<<PKGBUILDDIR>>/ext/pdo/ -I/<<PKGBUILDDIR>>/ext-build/include -I/<<PKGBUILDDIR>>/ext-build/main -I/<<PKGBUILDDIR>> -I/<<PKGBUILDDIR>>/ext-build/ext/date/lib -I/<<PKGBUILDDIR>>/ext/date/lib -I/usr/include/libxml2 -I/usr/include/x86_64-linux-gnu -I/usr/include/enchant-2 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/libpng16 -I/usr/include/freetype2 -I/usr/include/c-client -I/<<PKGBUILDDIR>>/ext/mbstring/libmbfl -I/<<PKGBUILDDIR>>/ext-build/ext/mbstring/libmbfl -I/<<PKGBUILDDIR>>/ext/mbstring/libmbfl/mbfl -I/<<PKGBUILDDIR>>/ext-build/ext/mbstring/libmbfl/mbfl -I/usr/include/postgresql -I/usr/include/pspell -I/usr/include/editline -I/usr/include/tidy -I/<<PKGBUILDDIR>>/ext-build/TSRM -I/<<PKGBUILDDIR>>/ext-build/Zend -I/<<PKGBUILDDIR>>/main -I/<<PKGBUILDDIR>>/Zend -I/<<PKGBUILDDIR>>/TSRM -I/<<PKGBUILDDIR>>/ext-build/ -Wdate-time -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE -fno-common -Wstrict-prototypes -Wformat-truncation -Wlogical-op -Wduplicated-cond -Wno-clobbered -Wall -Wextra -Wno-strict-aliasing -Wno-unused-parameter -Wno-sign-compare -g -O2 -ffile-prefix-map=/<<PKGBUILDDIR>>=. -fstack-protector-strong -Wformat -Werror=format-security -O2 -Wall -pedantic -fsigned-char -fno-strict-aliasing -DOPENSSL_SUPPRESS_DEPRECATED -g -fvisibility=hidden -Wimplicit-fallthrough=1 -DZEND_SIGNALS -prefer-pic -DZEND_COMPILE_DL_EXT=1 -c /<<PKGBUILDDIR>>/ext/pdo/pdo.c -o ext/pdo/pdo.lo -MMD -MF ext/pdo/pdo.dep -MT ext/pdo/pdo.lo
333799: x86_64-linux-gnu-gcc -Iext/pdo/ -I/<<PKGBUILDDIR>>/ext/pdo/ -I/<<PKGBUILDDIR>>/ext-build/include -I/<<PKGBUILDDIR>>/ext-build/main -I/<<PKGBUILDDIR>> -I/<<PKGBUILDDIR>>/ext-build/ext/date/lib -I/<<PKGBUILDDIR>>/ext/date/lib -I/usr/include/libxml2 -I/usr/include/x86_64-linux-gnu -I/usr/include/enchant-2 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/libpng16 -I/usr/include/freetype2 -I/usr/include/c-client -I/<<PKGBUILDDIR>>/ext/mbstring/libmbfl -I/<<PKGBUILDDIR>>/ext-build/ext/mbstring/libmbfl -I/<<PKGBUILDDIR>>/ext/mbstring/libmbfl/mbfl -I/<<PKGBUILDDIR>>/ext-build/ext/mbstring/libmbfl/mbfl -I/usr/include/postgresql -I/usr/include/pspell -I/usr/include/editline -I/usr/include/tidy -I/<<PKGBUILDDIR>>/ext-build/TSRM -I/<<PKGBUILDDIR>>/ext-build/Zend -I/<<PKGBUILDDIR>>/main -I/<<PKGBUILDDIR>>/Zend -I/<<PKGBUILDDIR>>/TSRM -I/<<PKGBUILDDIR>>/ext-build/ -Wdate-time -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE -fno-common -Wstrict-prototypes -Wformat-truncation -Wlogical-op -Wduplicated-cond -Wno-clobbered -Wall -Wextra -Wno-strict-aliasing -Wno-unused-parameter -Wno-sign-compare -g -O2 -ffile-prefix-map=/<<PKGBUILDDIR>>=. -fstack-protector-strong -Wformat -Werror=format-security -O2 -Wall -pedantic -fsigned-char -fno-strict-aliasing -DOPENSSL_SUPPRESS_DEPRECATED -g -fvisibility=hidden -Wimplicit-fallthrough=1 -DZEND_SIGNALS -DZEND_COMPILE_DL_EXT=1 -c /<<PKGBUILDDIR>>/ext/pdo/pdo.c -MMD -MF ext/pdo/pdo.dep -MT ext/pdo/pdo.lo -fPIC -DPIC -o ext/pdo/.libs/pdo.o
333801:In file included from /<<PKGBUILDDIR>>/ext/pdo/pdo.c:28:
333806: x86_64-linux-gnu-gcc -Iext/pdo/ -I/<<PKGBUILDDIR>>/ext/pdo/ -I/<<PKGBUILDDIR>>/ext-build/include -I/<<PKGBUILDDIR>>/ext-build/main -I/<<PKGBUILDDIR>> -I/<<PKGBUILDDIR>>/ext-build/ext/date/lib -I/<<PKGBUILDDIR>>/ext/date/lib -I/usr/include/libxml2 -I/usr/include/x86_64-linux-gnu -I/usr/include/enchant-2 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/libpng16 -I/usr/include/freetype2 -I/usr/include/c-client -I/<<PKGBUILDDIR>>/ext/mbstring/libmbfl -I/<<PKGBUILDDIR>>/ext-build/ext/mbstring/libmbfl -I/<<PKGBUILDDIR>>/ext/mbstring/libmbfl/mbfl -I/<<PKGBUILDDIR>>/ext-build/ext/mbstring/libmbfl/mbfl -I/usr/include/postgresql -I/usr/include/pspell -I/usr/include/editline -I/usr/include/tidy -I/<<PKGBUILDDIR>>/ext-build/TSRM -I/<<PKGBUILDDIR>>/ext-build/Zend -I/<<PKGBUILDDIR>>/main -I/<<PKGBUILDDIR>>/Zend -I/<<PKGBUILDDIR>>/TSRM -I/<<PKGBUILDDIR>>/ext-build/ -Wdate-time -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE -fno-common -Wstrict-prototypes -Wformat-truncation -Wlogical-op -Wduplicated-cond -Wno-clobbered -Wall -Wextra -Wno-strict-aliasing -Wno-unused-parameter -Wno-sign-compare -g -O2 -ffile-prefix-map=/<<PKGBUILDDIR>>=. -fstack-protector-strong -Wformat -Werror=format-security -O2 -Wall -pedantic -fsigned-char -fno-strict-aliasing -DOPENSSL_SUPPRESS_DEPRECATED -g -fvisibility=hidden -Wimplicit-fallthrough=1 -DZEND_SIGNALS -DZEND_COMPILE_DL_EXT=1 -c /<<PKGBUILDDIR>>/ext/pdo/pdo.c -MMD -MF ext/pdo/pdo.dep -MT ext/pdo/pdo.lo -fPIC -DPIC -o ext/pdo/pdo.o >/dev/null 2>&1
392269:/bin/bash /<<PKGBUILDDIR>>/ext-build/libtool --preserve-dup-deps --tag CC --mode=link x86_64-linux-gnu-gcc -shared -I/<<PKGBUILDDIR>>/ext-build/include -I/<<PKGBUILDDIR>>/ext-build/main -I/<<PKGBUILDDIR>> -I/<<PKGBUILDDIR>>/ext-build/ext/date/lib -I/<<PKGBUILDDIR>>/ext/date/lib -I/usr/include/libxml2 -I/usr/include/x86_64-linux-gnu -I/usr/include/enchant-2 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/libpng16 -I/usr/include/freetype2 -I/usr/include/c-client -I/<<PKGBUILDDIR>>/ext/mbstring/libmbfl -I/<<PKGBUILDDIR>>/ext-build/ext/mbstring/libmbfl -I/<<PKGBUILDDIR>>/ext/mbstring/libmbfl/mbfl -I/<<PKGBUILDDIR>>/ext-build/ext/mbstring/libmbfl/mbfl -I/usr/include/postgresql -I/usr/include/pspell -I/usr/include/editline -I/usr/include/tidy -I/<<PKGBUILDDIR>>/ext-build/TSRM -I/<<PKGBUILDDIR>>/ext-build/Zend -I/<<PKGBUILDDIR>>/main -I/<<PKGBUILDDIR>>/Zend -I/<<PKGBUILDDIR>>/TSRM -I/<<PKGBUILDDIR>>/ext-build/ -Wdate-time -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE -fno-common -Wstrict-prototypes -Wformat-truncation -Wlogical-op -Wduplicated-cond -Wno-clobbered -Wall -Wextra -Wno-strict-aliasing -Wno-unused-parameter -Wno-sign-compare -g -O2 -ffile-prefix-map=/<<PKGBUILDDIR>>=. -fstack-protector-strong -Wformat -Werror=format-security -O2 -Wall -pedantic -fsigned-char -fno-strict-aliasing -DOPENSSL_SUPPRESS_DEPRECATED -g -fvisibility=hidden -Wimplicit-fallthrough=1 -DZEND_SIGNALS -Wl,-z,relro -Wl,-z,now -Wl,--as-needed -o ext/pdo/pdo.la -export-dynamic -avoid-version -prefer-pic -module -rpath /<<PKGBUILDDIR>>/ext-build/modules -L/usr/lib/x86_64-linux-gnu/mit-krb5 ext/pdo/pdo.lo ext/pdo/pdo_dbh.lo ext/pdo/pdo_stmt.lo ext/pdo/pdo_sql_parser.lo ext/pdo/pdo_sqlstate.lo
392275:rm -fr ext/pdo/.libs/pdo.la ext/pdo/.libs/pdo.lai ext/pdo/.libs/pdo.so
392276:x86_64-linux-gnu-gcc -shared ext/pdo/.libs/pdo.o ext/pdo/.libs/pdo_dbh.o ext/pdo/.libs/pdo_stmt.o ext/pdo/.libs/pdo_sql_parser.o ext/pdo/.libs/pdo_sqlstate.o -L/usr/lib/x86_64-linux-gnu/mit-krb5 -Wl,-z -Wl,relro -Wl,-z -Wl,now -Wl,--as-needed -Wl,-soname -Wl,pdo.so -o ext/pdo/.libs/pdo.so
392277:creating ext/pdo/pdo.la
392278:(cd ext/pdo/.libs && rm -f pdo.la && ln -s ../pdo.la pdo.la)
392902:/bin/bash /<<PKGBUILDDIR>>/ext-build/libtool --preserve-dup-deps --tag CC --mode=install cp ext/pdo/pdo.la /<<PKGBUILDDIR>>/ext-build/modules
392929:cp ext/pdo/.libs/pdo.so /<<PKGBUILDDIR>>/ext-build/modules/pdo.so
392930:cp ext/pdo/.libs/pdo.lai /<<PKGBUILDDIR>>/ext-build/modules/pdo.la
604933: cp --reflink=auto -a debian/tmp/usr/lib/php/20220829/calendar.so debian/tmp/usr/lib/php/20220829/ctype.so debian/tmp/usr/lib/php/20220829/exif.so debian/tmp/usr/lib/php/20220829/ffi.so debian/tmp/usr/lib/php/20220829/fileinfo.so debian/tmp/usr/lib/php/20220829/ftp.so debian/tmp/usr/lib/php/20220829/gettext.so debian/tmp/usr/lib/php/20220829/iconv.so debian/tmp/usr/lib/php/20220829/pdo.so debian/tmp/usr/lib/php/20220829/phar.so debian/tmp/usr/lib/php/20220829/posix.so debian/tmp/usr/lib/php/20220829/shmop.so debian/tmp/usr/lib/php/20220829/sockets.so debian/tmp/usr/lib/php/20220829/sysvmsg.so debian/tmp/usr/lib/php/20220829/sysvsem.so debian/tmp/usr/lib/php/20220829/sysvshm.so debian/tmp/usr/lib/php/20220829/tokenizer.so debian/php8.2-common//usr/lib/php/20220829/
606119: objcopy --only-keep-debug --compress-debug-sections debian/php8.2-common/usr/lib/php/20220829/pdo.so debian/.debhelper/php8.2-common/dbgsym-root/usr/lib/debug/.build-id/d8/4c88ba56fd565e15611d7d8faf605ebb33db04.debug
606131: strip --remove-section=.comment --remove-section=.note --strip-unneeded debian/php8.2-common/usr/lib/php/20220829/pdo.so
606132: objcopy --add-gnu-debuglink debian/.debhelper/php8.2-common/dbgsym-root/usr/lib/debug/.build-id/d8/4c88ba56fd565e15611d7d8faf605ebb33db04.debug debian/php8.2-common/usr/lib/php/20220829/pdo.so
606503: dpkg-shlibdeps -Tdebian/php8.2-common.substvars debian/php8.2-common/usr/lib/php/20220829/tokenizer.so debian/php8.2-common/usr/lib/php/20220829/sysvshm.so debian/php8.2-common/usr/lib/php/20220829/sysvsem.so debian/php8.2-common/usr/lib/php/20220829/sysvmsg.so debian/php8.2-common/usr/lib/php/20220829/sockets.so debian/php8.2-common/usr/lib/php/20220829/shmop.so debian/php8.2-common/usr/lib/php/20220829/posix.so debian/php8.2-common/usr/lib/php/20220829/phar.so debian/php8.2-common/usr/lib/php/20220829/pdo.so debian/php8.2-common/usr/lib/php/20220829/iconv.so debian/php8.2-common/usr/lib/php/20220829/gettext.so debian/php8.2-common/usr/lib/php/20220829/ftp.so debian/php8.2-common/usr/lib/php/20220829/fileinfo.so debian/php8.2-common/usr/lib/php/20220829/ffi.so debian/php8.2-common/usr/lib/php/20220829/exif.so debian/php8.2-common/usr/lib/php/20220829/ctype.so debian/php8.2-common/usr/lib/php/20220829/calendar.so
606549:dpkg-shlibdeps: warning: debian/php8.2-common/usr/lib/php/20220829/pdo.so contains an unresolvable reference to symbol zend_std_unset_property: it's probably a plugin
610072:-rw-r--r-- root/root 129128 2023-03-16 14:24 ./usr/lib/php/20220829/pdo.so
Does it happen with other allocators like mimalloc?
Thanks for the suggestion!
It seems to be a common allocator incompatibility with the dlopen
(3) flag RTLD_DEEPBIND
.
On previous glibc versions assigning the malloc hooks, e.g.
__attribute__((visibility("default"))) void *(*__malloc_hook)(size_t size) = h_malloc;
__attribute__((visibility("default"))) void *(*__realloc_hook)(void *ptr, size_t size) = h_realloc;
__attribute__((visibility("default"))) void (*__free_hook)(void *ptr) = h_free;
__attribute__((visibility("default"))) void *(*__memalign_hook)(size_t alignment, size_t size) = h_memalign;
should have worked, but that workaround has been invalidated in recent glibc versions.
So it seems there is nothing allocators can do currently.
Running hardened_malloc with php rebuild with the flag RTLD_DEEPBIND
dropped actually works fine.
Running php 8.2.1 with libhardened_malloc.so preloaded via /etc/ld.so.preload results in a segfault due to a
free()
call to glibc (accompanied by an error message offree(): invalid pointer
):Any ideas for the reason or how to avoid glibc's allocator being used?