pramsey / pgsql-ogr-fdw

PostgreSQL foreign data wrapper for OGR
MIT License
237 stars 34 forks source link

import test gives alloc warning on PostgreSQL compiled with cassert/debug and if PostGIS installed #125

Closed robe2 closed 7 years ago

robe2 commented 7 years ago

@pramsey is the import test failing on you for PostgreSQL 10. I'm getting failures on that one at the moment on PostgreSQL 10 beta 1.

When I run this manually in my 10 instance:

` CREATE SCHEMA imp1; IMPORT FOREIGN SCHEMA ogr_all LIMIT TO (n2launder) FROM SERVER myserver INTO imp1;

` I get this:

` NOTICE: Number of tables to be created 1 WARNING: problem in alloc set PortalHeapMemory: req size > alloc size for chunk 000000000E5FCB48 in block 000000000E5FC850 WARNING: problem in alloc set PortalHeapMemory: bad size 0 for chunk 000000000E5FCB48 in block 000000000E5FC850 WARNING: problem in alloc set PortalHeapMemory: req size > alloc size for chunk 000000000E5FCB60 in block 000000000E5FC850 WARNING: problem in alloc set PortalHeapMemory: bad single-chunk 000000000E5FCB60 in block 000000000E5FC850 WARNING: problem in alloc set PortalHeapMemory: bogus aset link in block 000000000E5FC850, chunk 000000000E5FCB60 WARNING: problem in alloc set PortalHeapMemory: found inconsistent memory block 000000000E5FC850

`

The tables does get created and I can query it fine it seems.

My 9.6 instance seems to pass this test fine so I'm guessing its a change in 10 causing the issue. I thought it was the patch I was working on but my patched version works on 9.6 without warning. What's interesting is I tested some other IMPORT FOREIGN schema calls and those worked fine on 10, so not sure what's special about this one.

robe2 commented 7 years ago

I'm not sure if the above is anything to worry about or not. I had tried it in a database because the regression was failing. Turns out the regression was failing because the \d output in PostgreSQL added more columns, so after I revised to just use a query against the catalog, the regression import test started passing.

For the above error, I confirmed it only happens if I have postgis installed. Can you try installing postgis and see if you get the same issue. Might be just my postgis install cause I was in middle of changing postgis code and have it in a slightly experimental state.

My PostgreSQL 9.6 is fine even with PostGIS installed, but that has an older version of PostGIS 2.4.0dev on it.

robe2 commented 7 years ago

I was mistaken. This is not just a PostgreSQL 10 issue. I get a notice as well under PostgreSQL 9.6 if I have compiled with Cassert. I wasn't getting it before because I usually test my VC++ EDB production build, but switching to my mingw64 compiled with cassert, debug I get this for 9.6:

` create extension postgis; create extension ogr_fdw; CREATE SERVER myserver FOREIGN DATA WRAPPER ogr_fdw OPTIONS ( datasource 'c:/projects/sources/pgsql_ogr_fdw/data', format 'ESRI Shapefile' );

CREATE SCHEMA imp1; IMPORT FOREIGN SCHEMA ogr_all LIMIT TO (n2launder) FROM SERVER myserver INTO imp1; `

I set max_parallel_workers = 0 to rule out parallel stuff.

Output warning is this:

NOTICE: Number of tables to be created 1 WARNING: problem in alloc set PortalHeapMemory: bogus aset link in block 0000000004F6D9F0, chunk 0000000004F6DC00

Querying is fine and \dt looks as expected.

Could be a windows only issue I suppose.

pramsey commented 7 years ago

It's not a windows only issue, it shows up on OSX as well w/ cassert. The command runs, the foreign table is created, but with memory noise in cassert.