0

The setup is Debian (or more precisely, the php:8.1-apache docker image with is Debian based.) The problem is not new in php:8.1[...], but also occurs on php:8.0[...]

I have the odbcinst1debian2, libodbc1, odbcinst and unixodbc packages installed.

ODBC and its datasource appear to be set up correctly at the command line and I have a data source creatively named "testodbc1" working...

I can validate that this is working, because running 'isql -v testodbc1 ' works, and I can run command line SQL in it.

So, I'm fairly confident the problem is in the PHP->PDO->ODBC chain, not between ODBC and the (remote) database server.

I have the PHP odbc and pdo_odbc extensions installed.

When I try to correct in PHP using the correct ODBC connector, the right username but the wrong password, I get the desired error.

However, when I then use the correct password, the browser tells me that Apache failed, and I get a segfault appearing in the server logs.

The PHP code required to reproduce is very very simple:

error_log("HERE1");
$dsn = "odbc:testodbc1";
error_log("HERE2");
$conn = new \PDO($dsn, "<myusername>", "<mypassword>");
error_log("HERE3");

Which gives the console output:

[php:notice] [pid 22] [client 172.18.0.1:60572] HERE1
[php:notice] [pid 22] [client 172.18.0.1:60572] HERE2
[core:notice] [pid 1] AH00052: child pid 20 exit signal Segmentation fault (11)
  • 1
    As far as I know segfaults can only occur due to buggy implementation. There's nothing you can do in your code to change this. You must report it as a bug https://github.com/php/php-src/issues/new/choose – Dharman Feb 17 '22 at 13:37
  • Dharman - thanks. I've logged - my bug ID is 8112. – Mark Harrison Feb 17 '22 at 20:25

0 Answers0