Bug #79270 [NEW]: segfault in libodbc.so.2.0.0 with ReflectionFunction($functio)->getParameters()
From: martin dot aschenbrenner at erwinmueller dot de
Operating system: Linux Ubuntu 18.04 x86_64
PHP version: 7.3.14
Package: PDO ODBC
Bug Type: Bug
Bug description:segfault in libodbc.so.2.0.0 with ReflectionFunction($functio)->getParameters()
Description:
------------
getting randomly (approximately each second request) following
segfault:
kernel: php-fpm7.3[17905]: segfault at 860 ip 00007f7e4e77cec0 sp
00007ffdcda8b040 error 4 in libodbc.so.2.0.0[7f7e4e765000+62000]
some strange behaviors:
- uncommenting line 17 fixes the issue.
- also execution someReflection() with same parameter and an even number
of times the issue doesn't occur.
additional info:
- libodbc1 package: 2.3.4-1.1ubuntu3
- php is executed by fpm
- affects php versions 7.1.33, 7.2.27, 7.3.14, 7.4.2 (not more tested)
Test script:
---------------
<?php
class Core {
public $conn;
public function __construct() {
$this->circularReference = $this;
}
public function connect() {
$this->conn = new PDO("odbc:mysql");
}
public $stm;
function createStm( string $foo ) {
$this->connect();
$this->stm = $this->conn->prepare("SELECT * FROM mytable");
// $this->stm = NULL;
}
}
function someReflection( $function ) {
$rParameters = (new \ReflectionFunction($function))->getParameters();
}
someReflection("implode");
$app = new Core;
$app->createStm("bar");
--
Edit bug report at https://bugs.php.net/bug.php?id=79270&edit=1
--
Fix committed: https://bugs.php.net/fix.php?id=79270&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=79270&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=79270&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=79270&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=79270&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=79270&r=support
Expected behavior: https://bugs.php.net/fix.php?id=79270&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=79270&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=79270&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=79270&r=globals
PHP version support discontinued: https://bugs.php.net/fix.php?id=79270&r=phptooold
Daylight Savings: https://bugs.php.net/fix.php?id=79270&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=79270&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=79270&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=79270&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=79270&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=79270&r=mysqlcfg
Thread (19 messages)
- martin dot aschenbrenner at erwinmueller dot de
- cmb@php.netBug #79270 [Opn->Fbk]: segfault in libodbc.so.2.0.0 with ReflectionFunction($functio)->getParameters()
- php-bugs at lists dot php dot netBug #79270 [Fbk->NoF]: segfault in libodbc.so.2.0.0 with ReflectionFunction($functio)->getParameters()
- alexander dot stix at erwinmueller dot deBug #79270 [Com]: segfault in libodbc.so.2.0.0 with ReflectionFunction($functio)->getParameters()
- cmb@php.netBug #79270 [NoF->Opn]: segfault in libodbc.so.2.0.0 with ReflectionFunction($functio)->getParameters()
- alexander dot stix at erwinmueller dot deBug #79270 [Com]: segfault in libodbc.so.2.0.0 with ReflectionFunction($functio)->getParameters()
- cmb@php.netBug #79270 [Asn->Fbk]: segfault in libodbc.so.2.0.0 with ReflectionFunction($functio)->getParameters()
- alexander dot stix at erwinmueller dot deBug #79270 [Com]: segfault in libodbc.so.2.0.0 with ReflectionFunction($functio)->getParameters()
- cmb@php.netBug #79270 [Fbk->Opn]: segfault in libodbc.so.2.0.0 with ReflectionFunction($functio)->getParameters()
- alexander dot stix at erwinmueller dot deBug #79270 [Com]: segfault in libodbc.so.2.0.0 with ReflectionFunction($functio)->getParameters()
- cmb@php.netBug #79270 [Opn]: segfault in libodbc.so.2.0.0 with ReflectionFunction($functio)->getParameters()
- cmb@php.netBug #79270 [Opn]: segfault in libodbc.so.2.0.0 with ReflectionFunction($functio)->getParameters()
- cmb@php.netBug #79270 [PATCH]: segfault in libodbc.so.2.0.0 with ReflectionFunction($functio)->getParameters()
- cmb@php.netBug #79270 [Asn]: segfault in libodbc.so.2.0.0 with ReflectionFunction($functio)->getParameters()
- cmb@php.netBug #79270 [PATCH]: segfault in libodbc.so.2.0.0 with ReflectionFunction($functio)->getParameters()
- alexander dot stix at erwinmueller dot deBug #79270 [Com]: segfault in libodbc.so.2.0.0 with ReflectionFunction($functio)->getParameters()
- cmb@php.netBug #79270 [Asn]: segfault in libodbc.so.2.0.0 with ReflectionFunction($functio)->getParameters()
- cmb@php.netBug #79270 [Asn->Opn]: segfault in libodbc.so.2.0.0 with ReflectionFunction($functio)->getParameters()
- alexander dot stix at erwinmueller dot deBug #79270 [Com]: segfault in libodbc.so.2.0.0 with ReflectionFunction($functio)->getParameters()