<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
I was fiddling with Even's geopackage <a
href="http://erouault.blogspot.com/2014/12/gdal-geopackage-raster-support.html">examples</a>
when I came across a core dump issue in gdal_translate<br>
<br>
gdal version is compiled from github trunk as of 15 February 2016
under Ubuntu 15.10 x64<br>
<blockquote>gdal_translate --version<br>
GDAL 2.1.0dev, released 2015/99/99<br>
</blockquote>
<br>
<br>
I can share the geotiff in question if need be. Let me know if I
can provide any other helpful information<br>
<br>
Basic command is:<br>
<br>
<blockquote>gdal_translate \<br>
Washington_SEC.tif \<br>
test.gpkg \<br>
-of GPKG \<br>
-co TILE_FORMAT=PNG \<br>
-co TILING_SCHEME=GoogleMapsCompatible<br>
</blockquote>
<br>
Out from Valgrind is:<br>
<blockquote>jlmcgraw@UbuntuMate1504:~/Documents/myPrograms/gdal_tests$
CPL_DEBUG=ON \<br>
> valgrind --tool=memcheck --leak-check=yes
--read-var-info=yes \<br>
> gdal_translate \<br>
> Washington_SEC.tif \<br>
> test.gpkg \<br>
> -of GPKG \<br>
> -co TILE_FORMAT=PNG \<br>
> -co TILING_SCHEME=GoogleMapsCompatible<br>
==30978== Memcheck, a memory error detector<br>
==30978== Copyright (C) 2002-2015, and GNU GPL'd, by Julian Seward
et al.<br>
==30978== Using Valgrind-3.11.0 and LibVEX; rerun with -h for
copyright info<br>
==30978== Command: gdal_translate Washington_SEC.tif test.gpkg -of
GPKG -co TILE_FORMAT=PNG -co TILING_SCHEME=GoogleMapsCompatible<br>
==30978== <br>
GDAL: GDALOpen(Washington_SEC.tif, this=0xf7e9d80) succeeds as
GTiff.<br>
Input file size is 15538, 11309<br>
GDAL: GDAL_CACHEMAX = 100 MB<br>
GDAL: GDALWarpKernel()::GWKGeneralCase()<br>
Src=0,0,1944x1415 Dst=0,0,2737x1992<br>
0GDAL: GDALWarpKernel()::GWKGeneralCase()<br>
Src=1941,0,1945x1415 Dst=2737,0,2737x1992<br>
.GDAL: GDALWarpKernel()::GWKGeneralCase()<br>
Src=3883,0,1945x1415 Dst=5474,0,2737x1992<br>
--30978-- warning: evaluate_Dwarf3_Expr: unhandled DW_OP_ 0xf2<br>
--30978-- warning: evaluate_Dwarf3_Expr: unhandled DW_OP_ 0xf2<br>
--30978-- warning: evaluate_Dwarf3_Expr: unhandled DW_OP_ 0xf2<br>
--30978-- warning: evaluate_Dwarf3_Expr: unhandled DW_OP_ 0xf2<br>
==30978== Invalid write of size 8<br>
==30978== at 0x4C3259F: memset (in
/usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)<br>
==30978== by 0x5692CD8: memset (string3.h:90)<br>
==30978== by 0x5692CD8: GDALGeoPackageDataset::ReadTile(int,
int, unsigned char*, bool*) (gdalgeopackagerasterband.cpp:641)<br>
==30978== by 0x5692FA2: GDALGeoPackageDataset::ReadTile(int,
int) (gdalgeopackagerasterband.cpp:489)<br>
==30978== by 0x5694B51:
GDALGeoPackageRasterBand::IReadBlock(int, int, void*)
(gdalgeopackagerasterband.cpp:733)<br>
==30978== by 0x5553B15: GDALRasterBand::GetLockedBlockRef(int,
int, int) (gdalrasterband.cpp:1142)<br>
==30978== by 0x5572525: GDALRasterBand::IRasterIO(GDALRWFlag,
int, int, int, int, void*, int, int, GDALDataType, long long, long
long, GDALRasterIOExtraArg*) (rasterio.cpp:307)<br>
==30978== by 0x557312A:
GDALDataset::BlockBasedRasterIO(GDALRWFlag, int, int, int, int,
void*, int, int, GDALDataType, int, int*, long long, long long,
long long, GDALRasterIOExtraArg*) (rasterio.cpp:2938)<br>
==30978== by 0x551B09C: GDALDataset::RasterIO(GDALRWFlag, int,
int, int, int, void*, int, int, GDALDataType, int, int*, long
long, long long, long long, GDALRasterIOExtraArg*)
(gdaldataset.cpp:1991)<br>
==30978== by 0x551B11D: GDALDatasetRasterIO
(gdaldataset.cpp:2034)<br>
==30978== by 0x56384C4: GDALWarpOperation::WarpRegion(int, int,
int, int, int, int, int, int, int, int, double, double)
(gdalwarpoperation.cpp:1370)<br>
==30978== by 0x56387C6:
GDALWarpOperation::ChunkAndWarpImage(int, int, int, int)
(gdalwarpoperation.cpp:720)<br>
==30978== by 0x57A9F5A: GDALGeoPackageDataset::CreateCopy(char
const*, GDALDataset*, int, char**, int (*)(double, char const*,
void*), void*) (ogrgeopackagedatasource.cpp:3242)<br>
==30978== Address 0x0 is not stack'd, malloc'd or (recently)
free'd<br>
==30978== <br>
==30978== <br>
==30978== Process terminating with default action of signal 11
(SIGSEGV)<br>
==30978== Access not within mapped region at address 0x0<br>
==30978== at 0x4C3259F: memset (in
/usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)<br>
==30978== by 0x5692CD8: memset (string3.h:90)<br>
==30978== by 0x5692CD8: GDALGeoPackageDataset::ReadTile(int,
int, unsigned char*, bool*) (gdalgeopackagerasterband.cpp:641)<br>
==30978== by 0x5692FA2: GDALGeoPackageDataset::ReadTile(int,
int) (gdalgeopackagerasterband.cpp:489)<br>
==30978== by 0x5694B51:
GDALGeoPackageRasterBand::IReadBlock(int, int, void*)
(gdalgeopackagerasterband.cpp:733)<br>
==30978== by 0x5553B15: GDALRasterBand::GetLockedBlockRef(int,
int, int) (gdalrasterband.cpp:1142)<br>
==30978== by 0x5572525: GDALRasterBand::IRasterIO(GDALRWFlag,
int, int, int, int, void*, int, int, GDALDataType, long long, long
long, GDALRasterIOExtraArg*) (rasterio.cpp:307)<br>
==30978== by 0x557312A:
GDALDataset::BlockBasedRasterIO(GDALRWFlag, int, int, int, int,
void*, int, int, GDALDataType, int, int*, long long, long long,
long long, GDALRasterIOExtraArg*) (rasterio.cpp:2938)<br>
==30978== by 0x551B09C: GDALDataset::RasterIO(GDALRWFlag, int,
int, int, int, void*, int, int, GDALDataType, int, int*, long
long, long long, long long, GDALRasterIOExtraArg*)
(gdaldataset.cpp:1991)<br>
==30978== by 0x551B11D: GDALDatasetRasterIO
(gdaldataset.cpp:2034)<br>
==30978== by 0x56384C4: GDALWarpOperation::WarpRegion(int, int,
int, int, int, int, int, int, int, int, double, double)
(gdalwarpoperation.cpp:1370)<br>
==30978== by 0x56387C6:
GDALWarpOperation::ChunkAndWarpImage(int, int, int, int)
(gdalwarpoperation.cpp:720)<br>
==30978== by 0x57A9F5A: GDALGeoPackageDataset::CreateCopy(char
const*, GDALDataset*, int, char**, int (*)(double, char const*,
void*), void*) (ogrgeopackagedatasource.cpp:3242)<br>
==30978== If you believe this happened as a result of a stack<br>
==30978== overflow in your program's main thread (unlikely but<br>
==30978== possible), you can try to increase the size of the<br>
==30978== main thread stack using the --main-stacksize= flag.<br>
==30978== The main thread stack size used in this run was
8388608.<br>
==30978== <br>
==30978== HEAP SUMMARY:<br>
==30978== in use at exit: 138,658,730 bytes in 10,473 blocks<br>
==30978== total heap usage: 58,500 allocs, 48,027 frees,
326,332,504 bytes allocated<br>
==30978== <br>
==30978== 1,032 bytes in 1 blocks are possibly lost in loss record
4,171 of 4,283<br>
==30978== at 0x4C2BBCF: malloc (in
/usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)<br>
==30978== by 0x7CECC56: ??? (in
/usr/lib/x86_64-linux-gnu/libsqlite3.so.0.8.6)<br>
==30978== by 0x7CC92F5: ??? (in
/usr/lib/x86_64-linux-gnu/libsqlite3.so.0.8.6)<br>
==30978== by 0x7CCC5A6: ??? (in
/usr/lib/x86_64-linux-gnu/libsqlite3.so.0.8.6)<br>
==30978== by 0x7CEB222: ??? (in
/usr/lib/x86_64-linux-gnu/libsqlite3.so.0.8.6)<br>
==30978== by 0x7D200D7: ??? (in
/usr/lib/x86_64-linux-gnu/libsqlite3.so.0.8.6)<br>
==30978== by 0x7D29826: sqlite3_step (in
/usr/lib/x86_64-linux-gnu/libsqlite3.so.0.8.6)<br>
==30978== by 0x7D2A899: sqlite3_exec (in
/usr/lib/x86_64-linux-gnu/libsqlite3.so.0.8.6)<br>
==30978== by 0x57B297B: SQLCommand(sqlite3*, char const*)
(ogrgeopackageutility.cpp:41)<br>
==30978== by 0x57A4D5C:
GDALGeoPackageDataset::FinalizeRasterRegistration()
(ogrgeopackagedatasource.cpp:1383)<br>
==30978== by 0x57A9CBA: GDALGeoPackageDataset::CreateCopy(char
const*, GDALDataset*, int, char**, int (*)(double, char const*,
void*), void*) (ogrgeopackagedatasource.cpp:3150)<br>
==30978== by 0x5522F48: GDALDriver::CreateCopy(char const*,
GDALDataset*, int, char**, int (*)(double, char const*, void*),
void*) (gdaldriver.cpp:803)<br>
==30978== <br>
==30978== 1,032 bytes in 1 blocks are possibly lost in loss record
4,172 of 4,283<br>
==30978== at 0x4C2BBCF: malloc (in
/usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)<br>
==30978== by 0x7CECC56: ??? (in
/usr/lib/x86_64-linux-gnu/libsqlite3.so.0.8.6)<br>
==30978== by 0x7CC92F5: ??? (in
/usr/lib/x86_64-linux-gnu/libsqlite3.so.0.8.6)<br>
==30978== by 0x7CCC5A6: ??? (in
/usr/lib/x86_64-linux-gnu/libsqlite3.so.0.8.6)<br>
==30978== by 0x7CEB222: ??? (in
/usr/lib/x86_64-linux-gnu/libsqlite3.so.0.8.6)<br>
==30978== by 0x7D200D7: ??? (in
/usr/lib/x86_64-linux-gnu/libsqlite3.so.0.8.6)<br>
==30978== by 0x7D29826: sqlite3_step (in
/usr/lib/x86_64-linux-gnu/libsqlite3.so.0.8.6)<br>
==30978== by 0x7D2A899: sqlite3_exec (in
/usr/lib/x86_64-linux-gnu/libsqlite3.so.0.8.6)<br>
==30978== by 0x57B297B: SQLCommand(sqlite3*, char const*)
(ogrgeopackageutility.cpp:41)<br>
==30978== by 0x5695415:
GDALGeoPackageDataset::WriteShiftedTile(int, int, int, int, int,
int, int) (gdalgeopackagerasterband.cpp:1645)<br>
==30978== by 0x5695CAC:
GDALGeoPackageRasterBand::IWriteBlock(int, int, void*)
(gdalgeopackagerasterband.cpp:2121)<br>
==30978== by 0x555805F: GDALRasterBlock::Write()
(gdalrasterblock.cpp:743)<br>
==30978== <br>
==30978== 1,304 bytes in 1 blocks are possibly lost in loss record
4,186 of 4,283<br>
==30978== at 0x4C2BBCF: malloc (in
/usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)<br>
==30978== by 0x7CECC56: ??? (in
/usr/lib/x86_64-linux-gnu/libsqlite3.so.0.8.6)<br>
==30978== by 0x7CC92F5: ??? (in
/usr/lib/x86_64-linux-gnu/libsqlite3.so.0.8.6)<br>
==30978== by 0x7CCC5A6: ??? (in
/usr/lib/x86_64-linux-gnu/libsqlite3.so.0.8.6)<br>
==30978== by 0x7CCD0FF: ??? (in
/usr/lib/x86_64-linux-gnu/libsqlite3.so.0.8.6)<br>
==30978== by 0x7D003AE: ??? (in
/usr/lib/x86_64-linux-gnu/libsqlite3.so.0.8.6)<br>
==30978== by 0x7D007FA: ??? (in
/usr/lib/x86_64-linux-gnu/libsqlite3.so.0.8.6)<br>
==30978== by 0x7D012E8: ??? (in
/usr/lib/x86_64-linux-gnu/libsqlite3.so.0.8.6)<br>
==30978== by 0x7D0374F: ??? (in
/usr/lib/x86_64-linux-gnu/libsqlite3.so.0.8.6)<br>
==30978== by 0x7D06D63: ??? (in
/usr/lib/x86_64-linux-gnu/libsqlite3.so.0.8.6)<br>
==30978== by 0x7D09554: ??? (in
/usr/lib/x86_64-linux-gnu/libsqlite3.so.0.8.6)<br>
==30978== by 0x7D2346A: ??? (in
/usr/lib/x86_64-linux-gnu/libsqlite3.so.0.8.6)<br>
==30978== <br>
==30978== 3,912 bytes in 3 blocks are possibly lost in loss record
4,228 of 4,283<br>
==30978== at 0x4C2BBCF: malloc (in
/usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)<br>
==30978== by 0x7CECC56: ??? (in
/usr/lib/x86_64-linux-gnu/libsqlite3.so.0.8.6)<br>
==30978== by 0x7CC92F5: ??? (in
/usr/lib/x86_64-linux-gnu/libsqlite3.so.0.8.6)<br>
==30978== by 0x7CCC5A6: ??? (in
/usr/lib/x86_64-linux-gnu/libsqlite3.so.0.8.6)<br>
==30978== by 0x7CCD0FF: ??? (in
/usr/lib/x86_64-linux-gnu/libsqlite3.so.0.8.6)<br>
==30978== by 0x7D003AE: ??? (in
/usr/lib/x86_64-linux-gnu/libsqlite3.so.0.8.6)<br>
==30978== by 0x7D007FA: ??? (in
/usr/lib/x86_64-linux-gnu/libsqlite3.so.0.8.6)<br>
==30978== by 0x7D012E8: ??? (in
/usr/lib/x86_64-linux-gnu/libsqlite3.so.0.8.6)<br>
==30978== by 0x7D0374F: ??? (in
/usr/lib/x86_64-linux-gnu/libsqlite3.so.0.8.6)<br>
==30978== by 0x7D06EB7: ??? (in
/usr/lib/x86_64-linux-gnu/libsqlite3.so.0.8.6)<br>
==30978== by 0x7D09554: ??? (in
/usr/lib/x86_64-linux-gnu/libsqlite3.so.0.8.6)<br>
==30978== by 0x7D2346A: ??? (in
/usr/lib/x86_64-linux-gnu/libsqlite3.so.0.8.6)<br>
==30978== <br>
==30978== 710,680 bytes in 545 blocks are possibly lost in loss
record 4,275 of 4,283<br>
==30978== at 0x4C2BBCF: malloc (in
/usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)<br>
==30978== by 0x7CECC56: ??? (in
/usr/lib/x86_64-linux-gnu/libsqlite3.so.0.8.6)<br>
==30978== by 0x7CC92F5: ??? (in
/usr/lib/x86_64-linux-gnu/libsqlite3.so.0.8.6)<br>
==30978== by 0x7CCC5A6: ??? (in
/usr/lib/x86_64-linux-gnu/libsqlite3.so.0.8.6)<br>
==30978== by 0x7CCD0FF: ??? (in
/usr/lib/x86_64-linux-gnu/libsqlite3.so.0.8.6)<br>
==30978== by 0x7D003AE: ??? (in
/usr/lib/x86_64-linux-gnu/libsqlite3.so.0.8.6)<br>
==30978== by 0x7D007FA: ??? (in
/usr/lib/x86_64-linux-gnu/libsqlite3.so.0.8.6)<br>
==30978== by 0x7D012E8: ??? (in
/usr/lib/x86_64-linux-gnu/libsqlite3.so.0.8.6)<br>
==30978== by 0x7D0374F: ??? (in
/usr/lib/x86_64-linux-gnu/libsqlite3.so.0.8.6)<br>
==30978== by 0x7D09228: ??? (in
/usr/lib/x86_64-linux-gnu/libsqlite3.so.0.8.6)<br>
==30978== by 0x7D2346A: ??? (in
/usr/lib/x86_64-linux-gnu/libsqlite3.so.0.8.6)<br>
==30978== by 0x7D29826: sqlite3_step (in
/usr/lib/x86_64-linux-gnu/libsqlite3.so.0.8.6)<br>
==30978== <br>
==30978== LEAK SUMMARY:<br>
==30978== definitely lost: 0 bytes in 0 blocks<br>
==30978== indirectly lost: 0 bytes in 0 blocks<br>
==30978== possibly lost: 717,960 bytes in 551 blocks<br>
==30978== still reachable: 137,940,770 bytes in 9,922 blocks<br>
==30978== of which reachable via heuristic:<br>
==30978== length64 : 483,616
bytes in 2,334 blocks<br>
==30978== suppressed: 0 bytes in 0 blocks<br>
==30978== Reachable blocks (those to which a pointer was found)
are not shown.<br>
==30978== To see them, rerun with: --leak-check=full
--show-leak-kinds=all<br>
==30978== <br>
==30978== For counts of detected and suppressed errors, rerun
with: -v<br>
==30978== ERROR SUMMARY: 6 errors from 6 contexts (suppressed: 0
from 0)<br>
Segmentation fault (core dumped)<br>
</blockquote>
<br>
</body>
</html>