[php-src] Issue #8112: PDO_ODBC segfaults on "new \PDO"
| From: | yourpropertyexpert | Date: | Thu, 17 Feb 2022 20:25:03 +0000 |
| Subject: | [php-src] Issue #8112: PDO_ODBC segfaults on "new \PDO" | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-239855@lists.php.net to get a copy of this message | ||
Issue: https://github.com/php/php-src/issues/8112
Author: yourpropertyexpert
### Description
The following code:
```php
<?php
$dsn = "odbc:testodbc1";
$conn = new \PDO($dsn, "<myusername>", "<mycorrectpassword>");
```
Resulted in this output:
```
Nothing on screen, but the following appears in the log:
[core:notice] [pid 1] AH00052: child pid 27 exit signal Segmentation fault (11)
```
But I expected this output instead:
```
The code actually continuing to the next line :-)
```
Other info / debugging already done:
If I type the wrong password, I get an appropriate error thrown, telling me that I've entered
the wrong password. **The segfault is only thrown if I enter the correct authentication info.**
I am using unixodbc as my driver manager, and have everything set up within there to the extent that
if I run "isql -v testodbc1 <user> <password>" from the command line, I can
log in and run commands on a SQL console. So I know the issue is somewhere between the ODBC and PHP.
phpinfo gives the following (in the various places):
PDO drivers | sqlite, odbc
ODBCVER | 0x0380
ODBC Connection Pooling | Enabled, strict matching
### PHP Version
PHP 8.1.2
### Operating System
Debian GNU/Linux 11 (bullseye)