Closed apinstein closed 2 years ago
Was able to get it running in VSCode w/lldb and put a breakpoint in malloc_error_break...
I can repro this on-demand now.
I also thought it might be related to my using Co::sleep()
, which apparently isn't recommended if SWOOLE_HOOK_SLEEP
is enabled. It seemed plausible that when using Co::sleep()
instead of native sleep meant that this block of could could be skipped in some circumstances:
``` from ext-src/swoole_runtime.cc
if (Coroutine::get_current()) {
RETURN_LONG(System::sleep((double) num) < 0 ? num : 0);
} else {
RETURN_LONG(php_sleep(num));
}
```
but the bug still repro's once only native sleep functions are used.
My program routinely fails after 30-120 minutes of runtime. In fact, it has not run longer than that time frame for many months due to this error.
Any ideas appreciated, happy to try to run it down further.
@apinstein is it possible to provide a single file which can be used to reproduce the issue?
I wish I did. At one point I had a script that would cause it but it is not reproducing frequently.
Do you have any suspicions about what the bug might be from the breakpoint and other debug info? That might help me develop a reduced & reproducible test case to share.
Sent from my iPhone
On Oct 23, 2021, at 3:02 PM, Bruce Dou @.***> wrote:
@apinstein is it possible to provide a single file which can be used to reproduce the issue?
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android.
@apinstein it could be misusing locks with coroutines or other reason the variables is modified unintended, or under layer bugs. If you can provide a single simplest PHP file, it will be helpful to identify the issue.
Had a chance to run your script on Ubuntu & OpenSwoole master branch and can't reproduce this issue. Feel free to open this if you can provide a simple and easy script to reproduce.
Ok thank you
Sent from my iPhone
On Jan 13, 2022, at 5:00 PM, Bruce Dou @.***> wrote:
Had a chance to run your script on Ubuntu & OpenSwoole master branch and can't reproduce this issue. Feel free to open this if you can provide a simple and easy script to reproduce.
— Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android. You are receiving this because you were mentioned.
Please answer these questions before submitting your issue. Thanks!
I ran into an issue in a real application of mine, and managed to reduce it to a reproducible script:
https://github.com/apinstein/swoole-utils/blob/main/examples/cause-swoole-malloc.php
Should be able to just download that repo,
composer install
and runphp examples/cause-swoole-malloc.php
No crash :)
php(93377,0x10b853e00) malloc: error for object 0x7f9c5ff9a940: pointer being freed was not allocated php(93377,0x10b853e00) malloc: set a breakpoint in malloc_error_break to debug zsh: abort php examples/crash.php
Occurs after about 10 minutes.
php --ri swoole
)?uname -a
&php -v
&gcc -v
) ?