php / php/php-src

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).

Aperta
#9,145 8 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Bug Status: Needs Triage
Lingua principale
C
Stelle
40.4k
Fork
8.1k
Merge medio
2g 13h
PR unite (30g)
96

Descrizione

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

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Direzione di ricerca

Inizia esaminando Zend/zend_object_handlers.c alla riga 934 indicata e riproduci il crash di HTTP-loading di PHP 8.1.8 con GDB e PHPDebug. Confronta i parametri del core dump e il backtrace con il codice mostrato di zend_std_read_dimension; il lavoro è completato quando la causa del SIGSEGV è stata identificata e viene documentata una correzione verificata.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
c, php
Ambito
backend
Tipo di issue
Bug
Difficoltà
5/5
Tempo stimato
Più di una settimana
Stato di attività
Ferma
Chiarezza
Da chiarire
Idoneità per principianti
18/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.