Opened 13 years ago
Closed 13 years ago
#1432 closed defect (fixed)
[RASTER] segfaults on regression testing with --enable-cassert
Reported by: | strk | Owned by: | Bborie Park |
---|---|---|---|
Priority: | critical | Milestone: | PostGIS 2.0.0 |
Component: | raster | Version: | master |
Keywords: | Cc: |
Change History (11)
comment:1 by , 13 years ago
comment:2 by , 13 years ago
Owner: | changed from | to
---|
What happens is that RASTER_asGDALRaster builds the "options" variable to be NULL terminated but trims the allocated array to the exact number of items thus de-allocating he terminating null.
r8674 fixes this case, but there are more. --enable-cassert is your friend Bborie !
comment:3 by , 13 years ago
Next is RT_BandMetadata, segfaulting on this:
SELECT pixeltype, hasnodata, round(nodatavalue::numeric, 3), isoutdb, path FROM ST_BandMetaData( make_test_raster(10, 10, 0, 0, 0, 0, 5, TRUE), 6 );
Changing last arg to 5 prevents the crash
comment:4 by , 13 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
This one is fixed by properly switching memory context back before exiting prematurely from the function. I've seen other such cases but the testsuite doesn't react with a segfault. See r8678
comment:5 by , 13 years ago
Resolution: | fixed |
---|---|
Status: | closed → reopened |
I'm reopening this as I'll be auditing all the other raster functions.
comment:6 by , 13 years ago
Status: | reopened → new |
---|
Fixes for ST_Histogram, ST_Quantile, ST_Reclass, ST_SummaryStats and ST_ValueCount added in r8679.
comment:7 by , 13 years ago
Bborie,
I wonder if this will fix the crashing issue I was experiencing with my garden tests that you couldn't repelicate. That is almost always crashed on ST_reclass. I forgot that I don't test PostgreSQL on windows the normal way.
I use the zipped EDB builds and do not launch the instances as a service. So the EDB zipped builds may be a little different from the installer ones or the fact I launch them from a batch script rather than a service may also make a difference.
comment:8 by , 13 years ago
I'll give those tests a retry and close out that other ticket if this fixes it.
comment:9 by , 13 years ago
Regina,
That's the hope. It is absolutely plausible that the memory handling was causing crashes in your garden tests. I'm going to be auditing all the raster functions... hopefully have it done today and before you tag an alpha.
comment:10 by , 13 years ago
Status: | new → assigned |
---|
Added additional regression tests for ST_AsGDALRaster, ST_GDALDrivers, ST_AsRaster, ST_Resample, ST_Metadata in r8681.
comment:11 by , 13 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Last bit of code cleanup from auditing rt_pg.c in r8683.
One failure is in rt_asgdalraster and particularly this call:
Dropping the ARRAY parameter fixes the segfault