[postgis-devel] [pgrouting] need help with std::bad_alloc issue

Bborie Park dustymugs at gmail.com
Tue Jun 11 07:58:20 PDT 2013


Steve,

On what platform? Windows? Linux?

By the looks of it (I'm not very good at C++), std::bad_alloc comes
from a failed new allocation. Run gdb or valgrind yet?

-bborie

On Tue, Jun 11, 2013 at 7:33 AM, Stephen Woodbridge
<woodbri at swoodbridge.com> wrote:
> 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
> _______________________________________________
> postgis-devel mailing list
> postgis-devel at lists.osgeo.org
> http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-devel



More information about the postgis-devel mailing list