[pgrouting-dev] [pgrouting] need help with std::bad_alloc issue

Stephen Woodbridge woodbri at swoodbridge.com
Tue Jun 11 07:33:18 PDT 2013


Hi devs,

I have run into a strange problem with some pgrouting functions that you 
guys might have already seen in postgis.

We have stored procedures that are C and C++ and in general they work 
fine, but if I create a database, connect to it, create extensions and 
run some commands I get std::bad_alloc error. If I simply reconnect to 
the database, the same command does not generate an error, and, in fact, 
if I reconnect after installing the extension, I never get this error.

I have traced this down to the particular statement that is throwing the 
error, but there is nothing unique or particular about it. And we have 
seen this behavior in multiple commands.

So I have to conclude that:

1. we use the same pattern for most of our commands so that might be 
flawed in some basic way regarding memory

2. that there  is something strange about create extension in that the 
libraries are not getting initialized correctly (or completely?) until a 
connection is made. We are trying to verify this is or is not unique to 
pg 9.2.

3. pgrouting installs multiple shared libraries in our extension and 
maybe postgresql assumes there is only going to be one shared library

4. or something else totally different that we are missing

So has anyone seen anything like this with postgis code?
Any thoughts on what this might be? or how to run it down?

I did post post a inquiry to the postgresql list and Tom responded with 
not enough information and to compile the server with --enable-cassert 
which I did (assuming my Debian recompile worked correctly), but since 
this is a C++ error and not a postgresql palloc issue we have not seen 
and cassert errors.

Thoughts?

-Steve


More information about the pgrouting-dev mailing list