vjardin / bcgen

A bytecode generator (compiler) for PHP7
56 stars 19 forks source link

zend_mm_heap corrupted #4

Open vjardin opened 6 years ago

vjardin commented 6 years ago

console: OK

$ cat s/testinfo.php 
<?php
  phpinfo();

$ cat compile.php | grep testinfo
  bcgen_compile_file("s/testinfo.php", "t/testinfo.php");

$ cd t/ # testinfo.php is compiled here
$ php testinfo.php | head
phpinfo()
PHP Version => 7.2.7-0ubuntu0.18.04.2

System => Linux pluton 4.4.0-17134-Microsoft #137-Microsoft Thu Jun 14 18:46:00 PST 2018 x86_64
Build Date => Jul  4 2018 16:55:24
Server API => Command Line Interface
Virtual Directory Support => disabled
Configuration File (php.ini) Path => /etc/php/7.2/cli
Loaded Configuration File => /etc/php/7.2/cli/php.ini
Scan this dir for additional .ini files => /etc/php/7.2/cli/conf.d

server: FAILED - zend_mm_heap corrupted

$ cd t/
$ php -S 127.0.0.1:8080
PHP 7.2.7-0ubuntu0.18.04.2 Development Server started at Thu Aug  2 17:49:52 2018
Listening on http://127.0.0.1:8080
Document root is /home/vjardin/Documents/compile/t
Press Ctrl-C to quit.
zend_mm_heap corrupted
nanosonde commented 6 years ago

Hi! I have not tested other SAPIs yet except CLI. So maybe you can support me here concerning other SAPIs?

vjardin commented 6 years ago

Yes you welcome. I was checking php-src in order to understand how to track the root cause but I did not get it. This log can have many roots. What kind of logging can I enable to debug it?

vjardin commented 6 years ago

A workaround is to disable opcache, it seems there is a conflict. Currently, I do not know how to track it:

$ php -dopcache.enable=0 -S 127.0.0.1:8080
PHP 7.2.7-0ubuntu0.18.04.2 Development Server started at Sat Aug  4 11:45:28 2018
Listening on http://127.0.0.1:8080
Document root is testc
Press Ctrl-C to quit.
[Sat Aug  4 11:45:31 2018] 127.0.0.1:51406 [200]: /test.php

$ php -dopcache.enable=1 -S 127.0.0.1:8080
PHP 7.2.7-0ubuntu0.18.04.2 Development Server started at Sat Aug  4 11:45:39 2018
Listening on http://127.0.0.1:8080
Document root is testc
Press Ctrl-C to quit.
zend_mm_heap corrupted