php / php-src

The PHP Interpreter
https://www.php.net
Other
37.88k stars 7.72k forks source link

Memory allocation error: pdo-odbc #15113

Open ALPBRCH opened 1 month ago

ALPBRCH commented 1 month ago

Hello,

Since php version 8.1, the following error occurs when writing to the DB: Fehler SQL: SQLSTATE[HY001]: Memory allocation error: [IBM][System i Access ODBC-Treiber]Speicherzuordnungsfehler. (SQLPrepare[0] at /builddir/build/BUILD/php-8.2.21/ext/pdo_odbc/odbc_driver.c:200).

Situation: Linux-Oracle-Server: PHP 8.3.9 (x86_64) IBM iSeries: ibm-iaccess-1.1.0.28-1.0.x86_64

No problems with php-8.0!

Best regards Jürgen Immel

cmb69 commented 1 month ago

This is the repository of the German translation – I'm transferring to php-src.

cmb69 commented 1 month ago

The mentioned line would be

https://github.com/php/php-src/blob/482ca6c19c4d776c37bcdd5823edd524f4199cfa/ext/pdo_odbc/odbc_driver.c#L200-L200

Maybe @NattyNarwhal has an idea what might be wrong there. Other than that, we probably need a small self-contained reproduce script, and perhaps an ODBC trace would also be helpful.

ALPBRCH commented 1 month ago

test_odbc.txt This is a simple example of a script. Out of 10 inserts, 3 work.

NattyNarwhal commented 1 month ago

Do you have the CREATE TABLE definition?

ALPBRCH commented 1 month ago

bestkopf.sql.txt

ALPBRCH commented 1 month ago

Hi, some additional information: Linux Server-> unixODBC.x86_64 2.3.7-1.el8

IBM Power 9 Release V7R3M0

NattyNarwhal commented 1 month ago

I'll take a look at this this week; I was on vacation last week.

NattyNarwhal commented 1 month ago

I'm confused because I look at that CREATE TABLE definition and it's for MySQL, but the driver issue is for Db2i.

ALPBRCH commented 4 weeks ago

Hi, Sorry, you're right. The create is from Mysql. The DB2 database was created with a DDL description which unfortunately I cannot provide.

Regards, Jürgen Von: Calvin Buckley @.> Gesendet: Donnerstag, 8. August 2024 16:47 An: php/php-src @.> Cc: Jürgen Immel @.>; Author @.> Betreff: Re: [php/php-src] Memory allocation error: pdo-odbc (Issue #15113)

I'm confused because I look at that CREATE TABLE definition and it's for MySQL, but the driver issue is for Db2i.

— Reply to this email directly, view it on GitHubhttps://github.com/php/php-src/issues/15113#issuecomment-2276016037, or unsubscribehttps://github.com/notifications/unsubscribe-auth/A3DGO54UVRB4G42V4CDSG73ZQOAH5AVCNFSM6AAAAABLQEVUKOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDENZWGAYTMMBTG4. You are receiving this because you authored the thread.Message ID: @.***>

ALPBRCH commented 4 weeks ago

Hello, I asked the developer to give me a create or DDL of the tables.

best regards-Jürgen

ALPBRCH commented 3 weeks ago

bestpos.txt bestkopf.txt Hi, here the DDL of the tables. Regards

ALPBRCH commented 1 week ago

Any news?

NattyNarwhal commented 1 week ago

Sorry about this, I got busy with other projects. I'll take a look this week.

NattyNarwhal commented 1 week ago

That DDS is missing the record format. Can you provide the full PF source, including record formats, or the SQL DDL?

ALPBRCH commented 1 week ago

BESTPOSDD.txt BESTKOPF_DD.txt The record format is in the DDS. The line with “R” stands for record. says the developer

NattyNarwhal commented 1 week ago

I think BESTKOPF is missing the first line that indicates what file it references (the one with REF IIRC); there's the R in position 17 for the record format, and the subsequent lines in position 29 for fields.

ALPBRCH commented 5 days ago

[BESTKOPF_DD.txt](https://github.com/user-attachments/files/16832538/BESTKOPF_DD.txt)

ALPBRCH commented 5 days ago

REF01.txt

NattyNarwhal commented 3 days ago

There was some SEU issues in the copy and paste, but after manually cleaning it up, I've managed to create the tables on my system. I haven't been able to reproduce the issue on my systems yet (server with i 7.2, client with PHP 8.3.10 on macOS 14). I'll try to test on Linux soon.

ALPBRCH commented 2 days ago

Sorry, unfortunately I had no other option to pass on the data. I also suspect it is problem with php on Linux OS