[php-src] Issue #12131: Bug caused by 1255 JIT
| From: | danog | Date: | Tue, 05 Sep 2023 13:51:24 +0000 |
| Subject: | [php-src] Issue #12131: Bug caused by 1255 JIT | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-245336@lists.php.net to get a copy of this message | ||
Issue: https://github.com/php/php-src/issues/12131
Author: danog
### Description
Using the reproducer @ https://paste.daniil.it/uv.tar.xz
(https://github.com/danog/MadelineProto @ commit 0e838c79a56f160143ad88f0dd65d64dc102d2c4 + an
aaa.php test file), running the following command on arch linux with JIT=1255 enabled
yields a total hang of the entire application around once every 10 tries, without even the periodic
"Still alive" message, manually set up using EventLoop::repeat(1.0, fn () =>
var_dump("Still alive")); in aaa.php.
```bash
rm -rf aaa.madeline; php aaa.php
```
Sending CTRL-C unblocks the application, gdb shows it's stuck on an epoll syscall inside uv.
Sometimes a partial hang occurs (i.e. reads on some sockets stop returning anything, but the
periodic messages are still printed), other times a full hang occurs.
Example gdb backtrace:
```
(gdb) back
#0 0x00007ffff732f5fd in epoll_pwait () from /usr/lib/libc.so.6
#1 0x00007ffff4d343f8 in uv__io_poll (loop=0x7ffff4879c38, timeout=322) at src/unix/linux.c:1359
#2 0x00007ffff4d1a20f in uv_run (loop=loop@entry=0x7ffff4879c38, mode=mode@entry=UV_RUN_ONCE) at
src/unix/core.c:447
#3 0x00007ffff7fa655b in zif_uv_run (execute_data=<optimized out>, return_value=<optimized
out>) at /home/daniil/repos/ext-uv/php_uv.c:3625
#4 0x000055555ee8b824 in ?? ()
#5 0x00007ffff4904540 in ?? ()
#6 0x00007fff00000001 in ?? ()
#7 0x0000000000000000 in ?? ()
(gdb) zback
[0x7ffff48ce200] uv_run(object[0x7ffff48ce250], 1) [internal function]
[0x7ffff48ce190] Revolt\EventLoop\Driver\UvDriver->dispatch(true)
/tmp/amp/vendor/revolt/event-loop/src/EventLoop/Driver/UvDriver.php:135
[0x7ffff48ce0f0] Revolt\EventLoop\Internal\AbstractDriver->tick(true)
/tmp/amp/vendor/revolt/event-loop/src/EventLoop/Internal/AbstractDriver.php:486
[0x7ffff48ce070] Revolt\EventLoop\Internal\AbstractDriver->Revolt\EventLoop\Internal\{closure}()
/tmp/amp/vendor/revolt/event-loop/src/EventLoop/Internal/AbstractDriver.php:548
[0x7ffff48ce020] (main) [internal function]
[0x7ffff4815100] Fiber->resume() [internal function]
[0x7ffff4815090] Revolt\EventLoop\Internal\AbstractDriver->Revolt\EventLoop\Internal\{closure}()
/tmp/amp/vendor/revolt/event-loop/src/EventLoop/Internal/AbstractDriver.php:93
[0x7ffff4814f90] Revolt\EventLoop\Internal\DriverSuspension->suspend()
/tmp/amp/vendor/revolt/event-loop/src/EventLoop/Internal/DriverSuspension.php:99
[0x7ffff4814ec0] Amp\Future->await(NULL) /tmp/amp/vendor/amphp/amp/src/Future.php:251
[0x7ffff4814e40] danog\MadelineProto\WrappedFuture->await() /tmp/amp/src/WrappedFuture.php:57
[0x7ffff4814d90] danog\MadelineProto\Connection->methodCallAsyncRead("req_DH_params",
array(6)[0x7ffff4814df0]) /tmp/amp/src/MTProtoSession/CallHandler.php:103
[0x7ffff4814930] danog\MadelineProto\Connection->createAuthKey(false)
/tmp/amp/src/MTProtoSession/AuthKeyHandler.php:200
[0x7ffff48147f0] danog\MadelineProto\DataCenterConnection->initAuthorization()
/tmp/amp/src/DataCenterConnection.php:163
[0x7ffff4814700] danog\MadelineProto\Connection->sendMessage(object[0x7ffff4814750], true)
/tmp/amp/src/Connection.php:439
[0x7ffff48145c0]
danog\MadelineProto\Connection->methodCallAsyncWrite("auth.exportLoginToken",
array(2)[0x7ffff4814620], array(2)[0x7ffff4814630])
/tmp/amp/src/MTProtoSession/CallHandler.php:194
[0x7ffff4814510]
danog\MadelineProto\Connection->methodCallAsyncRead("auth.exportLoginToken",
array(2)[0x7ffff4814570], array(1)[0x7ffff4814580]) /tmp/amp/src/MTProtoSession/CallHandler.php:99
[0x7ffff4814470]
danog\MadelineProto\MTProto->methodCallAsyncRead("auth.exportLoginToken",
array(2)[0x7ffff48144d0]) /tmp/amp/src/MTProtoTools/CallHandler.php:47
[0x7ffff48143c0] danog\MadelineProto\MTProto->qrLogin() /tmp/amp/src/Wrappers/Login.php:92
[0x7ffff48142e0] danog\MadelineProto\MTProto->start() /tmp/amp/src/Wrappers/Start.php:60
[0x7ffff4814280] danog\MadelineProto\InternalDoc->start() /tmp/amp/src/InternalDoc.php:1778
[0x7ffff4814200] danog\MadelineProto\AbstractAPI->startAndLoopLogic("a", reference)
/tmp/amp/src/AbstractAPI.php:76
[0x7ffff4814130] danog\MadelineProto\AbstractAPI->startAndLoopInternal("a")
/tmp/amp/src/AbstractAPI.php:65
[0x7ffff4814090] danog\MadelineProto\EventHandler->startAndLoop("aaa.madeline",
object[0x7ffff48140f0]) /tmp/amp/src/EventHandler.php:73
[0x7ffff4814020] (main) /tmp/amp/aaa.php:20
```
### PHP Version
8.2.10
### Operating System
Arch linux