tpunt / phactor

An implementation of the Actor model for PHP
BSD 3-Clause "New" or "Revised" License
61 stars 5 forks source link

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

Open z3nth10n opened 4 years ago

z3nth10n commented 4 years ago

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: Assertion0' 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 commented 4 years ago

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 commented 4 years ago

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

tpunt commented 4 years ago

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).