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

/root/pht/src/pht_copy.c:784: copy_zval_table: Assertion `0' failed #14

Open
z3nth10n opened this issue Jan 23, 2020 · 3 comments
Open

Comments

@z3nth10n
Copy link

z3nth10n commented Jan 23, 2020

I compiled PHP using this commands:

#!/bin/sh
git clone https://github.com/php/php-src.git -b PHP-7.2.27 --depth=1 php-src-7.2
cd php-src-7.2
rm -rf /etc/php7

./buildconf --force

./configure --prefix=/etc/php7 --with-bz2 --with-zlib --enable-zip --disable-cgi \
   --enable-soap --enable-intl --with-mcrypt --with-openssl --with-readline --with-curl \
   --enable-ftp --enable-mysqlnd --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd \
   --enable-sockets --enable-pcntl --with-pspell --with-enchant --with-gettext \
   --with-gd --enable-exif --with-jpeg-dir --with-png-dir --with-freetype-dir --with-xsl \
   --enable-bcmath --enable-mbstring --enable-calendar --enable-simplexml --enable-json \
   --enable-hash --enable-session --enable-xml --enable-wddx --enable-opcache \
   --with-pcre-regex --with-config-file-path=/etc/php7/cli \
   --with-config-file-scan-dir=/etc/php7/etc --enable-cli --enable-maintainer-zts \
   --with-tsrm-pthreads --enable-debug --enable-fpm \
   --with-fpm-user=www-data --with-fpm-group=www-data

make && make install

chmod o+x /etc/php7/bin/phpize
chmod o+x /etc/php7/bin/php-config

mkdir /etc/php7/cli
cp php.ini-production /etc/php7/cli/php.ini

sed -e '924iextension=/etc/php7/lib/php/extensions/debug-zts-20170718/pht.so' -i /etc/php7/cli/php.ini

update-alternatives --install /usr/bin/php php /etc/php7/bin/php 74
update-alternatives --install /usr/bin/phpize phpize /etc/php7/bin/phpize 99

And then, I installed pht:

cd ~
rm -rf pht
git clone https://github.com/tpunt/pht
cd pht
git checkout tags/v0.0.1
phpize
./configure --prefix=/etc/php7 --with-libdir=/lib/x86_64-linux-gnu --enable-pthreads=shared --with-php-config=/etc/php7/bin/php-config
make
make install

Then I runned the command php script.php this error prompted:

/root/pht/src/pht_copy.c:784: copy_zval_table: Assertion 0' failed`

https://github.com/tpunt/phactor/blob/master/src/ph_copy.c#L784

PHP Version: 7.2.27

I need to use a lower PHP version?

EDIT: I tried version 7.2.4 (from March 2018, the latest commit on this repo was April 2018)

root@debian:/var/www/api.z3nth10n.net# php -v
PHP 7.2.4-dev (cli) (built: Jan 23 2020 11:01:58) ( ZTS DEBUG )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies

But this is still not working... :(

EDIT2: I edited the line to return NULL; by the moment.

@tpunt
Copy link
Owner

tpunt commented Jan 23, 2020

Did you mean to post this on my pht extension instead?

Also, this extension (and pht) is not currently being maintained, since I don't yet have the time.

It looks as though new ZVAL types have been introduced since I last touched this code. Ignoring the assertion will just lead to values not being serialised (which could quite possible cause segfaults down the execution path). If you want to try out the extension, you could try a slightly early version (such as 7.2.0), since I don't have the time to update this currently.

@z3nth10n
Copy link
Author

So, you developed this extension using PHP 7.2.0 not 7.2.4?

@tpunt
Copy link
Owner

tpunt commented Jan 24, 2020

From what I can recall, yes. Unfortunately, PHP's internal API is not subject to any limitations around breakages in patch versions. This makes extension development much more complicated (but in return, it does give greater flexibility when making changes to PHP itself).

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

2 participants