Thread: psqlODBC crashes upon memory allocation failures

psqlODBC crashes upon memory allocation failures

From
"Tsunakawa, Takayuki"
Date:
Hello,

As I said here:

http://www.postgresql.org/message-id/0A3221C70F24FB45833433255569204D1F4DB1CF@G01JPEXMBYT05

psqlODBC ignores memory allocation failure in a number of places.  That causes the application crash due to NULL
dereference. Actually, I ran into the crash of my 32-bit application under high load. 

The attached patch is the fix for it.  I wish this will be included in the upcoming release.


Regards, Takayuki Tsunakawa


Attachment

Re: psqlODBC crashes upon memory allocation failures

From
"Inoue, Hiroshi"
Date:
On 2016/01/28 15:27, Tsunakawa, Takayuki wrote:
> Hello,
>
> As I said here:
>
> http://www.postgresql.org/message-id/0A3221C70F24FB45833433255569204D1F4DB1CF@G01JPEXMBYT05
>
> psqlODBC ignores memory allocation failure in a number of places.  That causes the application crash due to NULL
dereference. Actually, I ran into the crash of my 32-bit application under high load. 
>
> The attached patch is the fix for it.  I wish this will be included in the upcoming release.

Thanks.
I would take care of this patch.

regards,
Hiroshi Inoue


Re: psqlODBC crashes upon memory allocation failures

From
BenS
Date:
Tsunakawa, Takayuki wrote
> Hello,
>
> As I said here:
>
> http://www.postgresql.org/message-id/0A3221C70F24FB45833433255569204D1F4DB1CF@G01JPEXMBYT05
>
> psqlODBC ignores memory allocation failure in a number of places.  That
> causes the application crash due to NULL dereference.  Actually, I ran
> into the crash of my 32-bit application under high load.
>
> The attached patch is the fix for it.  I wish this will be included in the
> upcoming release.
>
>
> Regards, Takayuki Tsunakawa
>
>
>
> --
> Sent via pgsql-odbc mailing list (

> pgsql-odbc@

> )
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-odbc
>
>
> crash_on_nomem.patch (27K)
> <http://postgresql.nabble.com/attachment/5884572/0/crash_on_nomem.patch>

Hello,

i can confirm the crash in msvcr120.dll. It happens no-and-then by trivially
scrolling forward + backward a result set with psqlodbc-09.05.0100 /
postgresql30a.dll.

Where i can get a patched version?

Thanks for your help!

Regards, BenS







--
View this message in context:
http://postgresql.nabble.com/psqlODBC-crashes-upon-memory-allocation-failures-tp5884572p5885422.html
Sent from the PostgreSQL - odbc mailing list archive at Nabble.com.


Re: psqlODBC crashes upon memory allocation failures

From
"Inoue, Hiroshi"
Date:
Hi,

On 2016/02/03 1:47, BenS wrote:
> Tsunakawa, Takayuki wrote
>> Hello,
>>
>> As I said here:
>>
>> http://www.postgresql.org/message-id/0A3221C70F24FB45833433255569204D1F4DB1CF@G01JPEXMBYT05
>>
>> psqlODBC ignores memory allocation failure in a number of places.  That
>> causes the application crash due to NULL dereference.  Actually, I ran
>> into the crash of my 32-bit application under high load.
>>
>> The attached patch is the fix for it.  I wish this will be included in the
>> upcoming release.
>>
>>
>> Regards, Takayuki Tsunakawa
>>
>>
>>
>> --
>> Sent via pgsql-odbc mailing list (
>> pgsql-odbc@
>> )
>> To make changes to your subscription:
>> http://www.postgresql.org/mailpref/pgsql-odbc
>>
>>
>> crash_on_nomem.patch (27K)
>> <http://postgresql.nabble.com/attachment/5884572/0/crash_on_nomem.patch>
> Hello,
>
> i can confirm the crash in msvcr120.dll. It happens no-and-then by trivially
> scrolling forward + backward a result set with psqlodbc-09.05.0100 /
> postgresql30a.dll.
>
> Where i can get a patched version?

I'm suspicious if the patch is effective for your problem.
Do your application run with useDeclareFetch option on?
If so,  the drivers on testing for 9.5.0101 at
http://www.ne.jp/asahi/inocchichichi/entrance/psqlodbc/
have the possibility to fix your problem.

regards,
Hiroshi Inoue