BitOne / php-meminfo

PHP extension to get insight about memory usage
MIT License
1.08k stars 78 forks source link

fix build with PHP 7.4 #97

Closed tony2001 closed 3 years ago

tony2001 commented 5 years ago

In 7.4 the API was slightly changed, so meminfo now needs a small patch to support it.

WyriHaximus commented 4 years ago

Can confirm that this compiles on php 7.4, the function is available, it seems to write out to the stream, but it currently leads to a SIGSEGV.

WyriHaximus commented 4 years ago

Tried directly on a machine and not in docker this time and it also SIGSEGV's with the following command: php -r "meminfo_dump(fopen('/tmp/my_dump_file.json', 'w'));sleep(1);echo file_get_contents('/tmp/my_dump_file.json');"

mleczakm commented 4 years ago

Any idea how get it working on php 7.4, will it be difficult? We have been using this extension for discovering memory leaks in workers (great tool, big thanks to the makers!) and would like to continue using it on php 7.4.

tony2001 commented 4 years ago

Check out the latest version of this branch, plz. Let me know if you find any issues, I'll try to fix them ASAP.

WyriHaximus commented 4 years ago

Can confirm that building the extension into 7.4 Docker images now works again and the simple write check doesn't segfault anymore 👍

WyriHaximus commented 4 years ago

Just opened #103 to fix the failing test and also test PHP 7.4 on the CI

kelunik commented 4 years ago

I can also confirm that it works mostly fine. I had an issue with FFI objects (see https://github.com/BitOne/php-meminfo/issues/104) and another issue with invalid JSON UTF-8 encoding that could be fixed with running the output through jq.

malarzm commented 4 years ago

Faced no issues when working with a quite big Symfony app and a functional test suite. Would be great to see this PR merged!

vudaltsov commented 4 years ago

Got a compilation problem, replacing ulong with zend_ulong on line 180 fixed the issue.

Corrected and rebased version in my fork: https://github.com/vudaltsov/php-meminfo/tree/php74_support