Re: libpq block allocated before my malloc handler inits?

From: rob <rob(at)robstoddard(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: libpq block allocated before my malloc handler inits?
Date: 2008-06-30 00:58:47
Message-ID: 48682FC7.4020608@robstoddard.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

All I am doing at the moment is spawning a pool of threads each with
their own database connection. I am using PQconnectdb to create the
database connection when the offending block is deallocated (this is
largely to answer the other email I got with regards to this). I just
tried using sslmode=disable in the connection string, to no avail. It
still crashes with an invalid free. Perhaps I should try to compile the
database with no SSL in it at all? Would that make any difference?

Thanks for the input,

Rob Stoddard

Russell Smith wrote:
> rob wrote:
>
>> I am trying to build a small program with libpq as the interface to a
>> Postgre database. I am using the most current version. My program
>> uses malloc and free hooks to manage memory without having to request
>> memory from the system all the time. I expected that the init
>> function (__malloc_initialize_hook) would run before anything else,
>> but after opening a number of connections to the database with
>> PQconnectdb, my program blows up because of a free which refers to a
>> block of memory that wasn't allocated using my malloc function. My
>> program runs without a hitch if I comment out the PQconnectdb function
>> calls.
>>
> I've experienced an openSSL, libpq + other library using SSL bug
> recently. Do you get the same crash is you explicitly disable SSL in
> the connection string? sslmode=disable.
>
> Thanks
>
> Russell
>

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Pierre Thibaudeau 2008-06-30 01:33:42 tsearch strategy for incremental search
Previous Message Russell Smith 2008-06-29 23:36:11 Re: libpq block allocated before my malloc handler inits?