php-meminfo icon indicating copy to clipboard operation
php-meminfo copied to clipboard

segfault using it with swoole

Open apinstein opened this issue 4 years ago • 1 comments

I was excited to try this to debug a long-lived script I am running with swoole.

However, about 50%+ of the time I run meminfo_dump() it segfaults.

Anything I can do to help you debug this?

I'm not sure how to capture the crash log...

apinstein avatar Mar 30 '21 02:03 apinstein

I tried a swoole mutex and that prevents the segfault but the dump is corrupted json about 50% of the time...

 57       $lock = new \Swoole\Lock(SWOOLE_MUTEX);
 58       $lock->lock();
 59       meminfo_dump(fopen("/tmp/book-memory-{$i}.json", 'w'));
 60       \Swoole\Coroutine\System::sleep(10);
 61       $lock->unlock();
 62       unset($lock);

apinstein avatar Mar 30 '21 03:03 apinstein