A core dump occurs frequently when PHP is loaded using HTTP. The core dump error log is AH00051: child pid 6663 exit signal Segmentation falult(11).
オープン
まだ誰も着手していません。
Bug
Status: Needs Triage
- 主要言語
- C
- スター
- 40.4k
- フォーク
- 8.2k
- 平均マージ
- 2日 13時間
- マージ済み PR(30日)
- 96
説明
Description
After the GDB and PHPDebug are enabled, the system reports the zend_object_handlers.c file based on the core information. An exception is reported: No such file or directory.
The error function is as follows:
ZEND_API zval *zend_std_read_dimension(zend_object *object, zval *offset, int type, zval *rv) /* {{{ */
{
zend_class_entry *ce = object->ce;
zval tmp_offset;
if (EXPECTED(zend_class_implements_interface(ce, zend_ce_arrayaccess) != 0)) {
if (offset == NULL) {
/* [] construct */
ZVAL_NULL(&tmp_offset);
} else {
ZVAL_COPY_DEREF(&tmp_offset, offset);
}
GC_ADDREF(object);
if (type == BP_VAR_IS) {
zend_call_method_with_1_params(object, ce, NULL, "offsetexists", rv, &tmp_offset);
if (UNEXPECTED(Z_ISUNDEF_P(rv))) {
OBJ_RELEASE(object);
zval_ptr_dtor(&tmp_offset);
return NULL;
}
if (!i_zend_is_true(rv)) {
OBJ_RELEASE(object);
zval_ptr_dtor(&tmp_offset);
zval_ptr_dtor(rv);
return &EG(uninitialized_zval);
}
zval_ptr_dtor(rv);
}
zend_call_method_with_1_params(object, ce, NULL, "offsetget", rv, &tmp_offset);
OBJ_RELEASE(object);
zval_ptr_dtor(&tmp_offset);
if (UNEXPECTED(Z_TYPE_P(rv) == IS_UNDEF)) {
if (UNEXPECTED(!EG(exception))) {
zend_throw_error(NULL, "Undefined offset for object of type %s used as array", ZSTR_VAL(ce->name));
}
return NULL;
}
return rv;
} else {
zend_bad_array_access(ce);
return NULL;
}
}
The following figure shows the GDB debugging error.
Unsupported JIT protocol version 3054402800 in descriptor (expected 1)
Core was generated by `/home/ivs_omu_portal/httpd/bin/httpd'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0 zend_std_read_dimension (object=0x100000000, offset=0xffff51ff94e0, type=65535, rv=0x0)
at /var/lib/docker/home/workspace/IVS_V1000_micloud/workcode/Micro_3rd_opensource/open_source/portalBuild/arm1620/code/php/Zend/zend_object_handlers.c:934
934 /var/lib/docker/home/workspace/IVS_V1000_micloud/workcode/Micro_3rd_opensource/open_source/portalBuild/arm1620/code/php/Zend/zend_object_handlers.c: No such file or directory.
[Current thread is 1 (LWP 3997154)]
(gdb) bt
#0 zend_std_read_dimension (object=0x100000000, offset=0xffff51ff94e0, type=65535, rv=0x0)
at /var/lib/docker/home/workspace/IVS_V1000_micloud/workcode/Micro_3rd_opensource/open_source/portalBuild/arm1620/code/php/Zend/zend_object_handlers.c:934
#1 <signal handler called>
#2 0x0000000000000000 in ?? ()
#3 0x0000000000000013 in ?? ()
Backtrace stopped: previous frame identical to this frame (corrupt stack?)
(gdb) bt
#0 zend_std_read_dimension (object=0x100000000, offset=0xffff51ff94e0, type=65535, rv=0x0)
at /var/lib/docker/home/workspace/IVS_V1000_micloud/workcode/Micro_3rd_opensource/open_source/portalBuild/arm1620/code/php/Zend/zend_object_handlers.c:934
#1 <signal handler called>
#2 0x0000000000000000 in ?? ()
#3 0x0000000000000013 in ?? ()
Backtrace stopped: previous frame identical to this frame (corrupt stack?)
PHP Version
PHP-8.1.8
Operating System
Eulter
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
まず、報告された 934 行目の Zend/zend_object_handlers.c を調査し、GDB と PHPDebug を使用して PHP 8.1.8 の HTTP-loading クラッシュを再現します。core dump のパラメーターと backtrace を、示されている zend_std_read_dimension コードと比較します。SIGSEGV の原因を特定し、検証済みの修正を文書化できれば完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- c, php
- 領域
- backend
- issue の種類
- バグ
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 活発さ
- 停滞
- 明瞭さ
- 説明が足りない
- 初心者へのやさしさ
- 18/100