Apache2 segfault in PHP extension pdo_mysql

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi all,

we experience a recurring problem with apache2 childs getting killed with
segmentation faults, likely caused by pdo_mysql. It's not reliably
reproducable, but we had the opportunity to examine the problem on a test
system.

The problem manifests as follows: Every request which is handled by PHP and
using a PDO MySQL connection causes the apache child to segfault. Restarting the
apache gracefully does not fix this. Only a complete restart of apache
(including the master process) helps.  The client only gets an empty response
from the server and the apache error_log says (exemplary):

```
[Mon May 10 09:22:47.358871 2021] [core:notice] [pid 30391] AH00052: child pid 16336 exit signal Segmentation fault (11)
```

The access_log does not contain any related lines, as you would expect. The
problem occurs in irregular intervals. We guess that the problem is caused by an
invalid state of the apache2 main process, which is either forked or directly
shared with the child processes.

This is our setup:
  - debian stretch
  - apache 2.4.25
  - php 7.2.34 (as apache2 module)

This is our minimal example script, which triggers the segmentation fault:
```
<?php
$obj_dbh = new PDO("mysql:dbname=test;host=x.x.x.x","foo","bar");
```

Request handling not including DB connects or DB operations do work, they don't
show signs of problems so far.

This is the link to an ltrace output of one apache process, which also contains
syscalls: https://pastebin.com/raw/nC3Ae8f7

We even experimented with gdb, but didn't get very far, because we aren't very
experienced, but we at least deem to have found the segfault-triggering library,
by sending the request via telnet while attaching to the corresponding apache
process with gdb:

gdb output:
```
(gdb) c
Program received signal SIGSEGV, Segmentation fault.
0x00007ff2bd9ed0aa in ?? () from /usr/lib/php7/pdo-mysql.so
```

Does anyone has a hint for us? We didn't find any useful bug reports, and also
don't know how to debug this problem further, so we are thankful for any input
on this topic.

Thanks in advance,
Marco Dickert



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux