Opened 6 years ago

Closed 5 years ago

#7177 closed defect (wontfix)

Memory leak in kmlsuperoverlay

Reported by: Robert Coup Owned by: warmerdam
Priority: normal Milestone: closed_because_of_github_migration
Component: GDAL_Raster Version: 2.2.3
Severity: normal Keywords: kmlsuperoverlay
Cc:

Description (last modified by Robert Coup)

Running gdal_translate over a vrt with

gdal_translate --config GDAL_CACHEMAX 128 -of kmlsuperoverlay -co RESAMPLE=CUBICSPLINE -co FORMAT=AUTO in.vrt out.kml

gdalinfo of the VRT & a source tile is attached.

memleax net output over 5 mins below, got up to 20+GB over the space of a few hours. Don't have debug symbols on this one atm, but maybe it rings bells:

== 1000 memory blocks leaked at CallStack[2].
== Callstack statistics: (in ascending order)

CallStack[1]: may-leak=334 (26720 bytes)
    expired=334 (26720 bytes), free_expired=0 (0 bytes)
    alloc=57996 (4639680 bytes), free=2905 (232400 bytes)
    freed memory live time: min=33 max=42 average=38
    un-freed memory live time: max=301
    0x00007feac6d6ca80  libc-2.19.so  malloc()+0
    0x00007feac7327e3d  libstdc++.so  _ZnwmRKSt9nothrow_t()+29
    0x00007feac7f931c1  libgdal.so  _ZN26GDALAbstractBandBlockCache11CreateBlockEi()+129
    0x00007feac7fdeee2  libgdal.so  _ZN14GDALRasterBand17GetLockedBlockRefEiii()+130
    0x00007feac7ffa139  libgdal.so  _ZN14GDALRasterBand9IRasterIOE10GDALRWFlagiiii()+2505
    0x00007feac7c8a5ab  libgdal.so  _ZN15GTiffRasterBand9IRasterIOE10GDALRWFlagiii()+235
    0x00007feac7fd91ca  libgdal.so  _ZN19GDALProxyRasterBand9IRasterIOE10GDALRWFla()+330
    0x00007feac7fdead7  libgdal.so  _ZN14GDALRasterBand8RasterIOE10GDALRWFlagiiiiP()+951
    0x00007feac7f51e08  libgdal.so  _ZN15VRTSimpleSource8RasterIOEiiiiPvii12GDALDa()+680
    0x00007feac7f4c0c6  libgdal.so  _ZN20VRTSourcedRasterBand9IRasterIOE10GDALRWFl()+374
    0x00007feac7fdead7  libgdal.so  _ZN14GDALRasterBand8RasterIOE10GDALRWFlagiiiiP()+951
    0x00007feac7d7a639  libgdal.so  _ZN26KmlSuperOverlayReadDataset18DetectTranspa()+585
    0x00007feac7d80b40  libgdal.so
    0x00007feac7fb33ee  libgdal.so  _ZN10GDALDriver10CreateCopyEPKcP11GDALDataseti()+510
    0x00007feac7b39d79  libgdal.so  GDALTranslate()+13993
    0x00000000004019f0  gdal_translate
    0x00007feac6d0bf45  libc-2.19.so  __libc_start_main()+245
    0x00000000004020bc  gdal_translate

CallStack[2]: may-leak=1000 (80000 bytes)
    expired=1000 (80000 bytes), free_expired=0 (0 bytes)
    alloc=176495 (14119600 bytes), free=2786 (222880 bytes)
    freed memory live time: min=39 max=46 average=42
    un-freed memory live time: max=301
    0x00007feac6d6ca80  libc-2.19.so  malloc()+0
    0x00007feac7327e3d  libstdc++.so  _ZnwmRKSt9nothrow_t()+29
    0x00007feac7f931c1  libgdal.so  _ZN26GDALAbstractBandBlockCache11CreateBlockEi()+129
    0x00007feac7fdeee2  libgdal.so  _ZN14GDALRasterBand17GetLockedBlockRefEiii()+130
    0x00007feac7c79474  libgdal.so  _ZN15GTiffRasterBand22FillCacheForOtherBandsEi()+164
    0x00007feac7c872e3  libgdal.so  _ZN15GTiffRasterBand10IReadBlockEiiPv()+627
    0x00007feac7fdef7c  libgdal.so  _ZN14GDALRasterBand17GetLockedBlockRefEiii()+284
    0x00007feac7ffa139  libgdal.so  _ZN14GDALRasterBand9IRasterIOE10GDALRWFlagiiii()+2505
    0x00007feac7c8a5ab  libgdal.so  _ZN15GTiffRasterBand9IRasterIOE10GDALRWFlagiii()+235
    0x00007feac7fd91ca  libgdal.so  _ZN19GDALProxyRasterBand9IRasterIOE10GDALRWFla()+330
    0x00007feac7fdead7  libgdal.so  _ZN14GDALRasterBand8RasterIOE10GDALRWFlagiiiiP()+951
    0x00007feac7f51e08  libgdal.so  _ZN15VRTSimpleSource8RasterIOEiiiiPvii12GDALDa()+680
    0x00007feac7f4c0c6  libgdal.so  _ZN20VRTSourcedRasterBand9IRasterIOE10GDALRWFl()+374
    0x00007feac7fdead7  libgdal.so  _ZN14GDALRasterBand8RasterIOE10GDALRWFlagiiiiP()+951
    0x00007feac7d7a639  libgdal.so  _ZN26KmlSuperOverlayReadDataset18DetectTranspa()+585
    0x00007feac7d80b40  libgdal.so
    0x00007feac7fb33ee  libgdal.so  _ZN10GDALDriver10CreateCopyEPKcP11GDALDataseti()+510
    0x00007feac7b39d79  libgdal.so  GDALTranslate()+13993
    0x00000000004019f0  gdal_translate
    0x00007feac6d0bf45  libc-2.19.so  __libc_start_main()+245
    0x00000000004020bc  gdal_translate

Attachments (1)

kmlso-gdalinfo.txt (2.9 KB ) - added by Robert Coup 6 years ago.

Download all attachments as: .zip

Change History (9)

by Robert Coup, 6 years ago

Attachment: kmlso-gdalinfo.txt added

comment:1 by Robert Coup, 6 years ago

Description: modified (diff)

comment:2 by Even Rouault, 6 years ago

KMLSUPEROVERLAY driver has no RESAMPLE creation option in trunk. Now I remember there might be old enhancement patches files in Trac regarding the driver, that may be in your build but not in trunk. Perhaps the leak is in the ?

Version 0, edited 6 years ago by Even Rouault (next)

comment:3 by Robert Coup, 6 years ago

KMLSUPEROVERLAY driver has no RESAMPLE creation option in trunk. Now I remember there might be old enhancement patches files in Trac regarding the driver, that may be in your build but not in trunk. Perhaps the leak is in them ?

Sorry, should have left that out — gdal_translate reports that there's no RESAMPLE option at startup :) Doing some regression testing and the resample patch clearly isn't applied! I'm testing against recentish trunk, the only kmlsuperoverlay patch atm allows slightly larger tile sizes (https://github.com/OSGeo/gdal/commit/99f31ee31e18e3a3881faeb92ca7ee30b9be0d13)

DetectTransparency() is in there, but AFAICT the new/delete there should clean up cleanly?

comment:4 by Even Rouault, 6 years ago

Well a reproducer would be a start. With tiny datasets, I can't see leaks.

comment:5 by Robert Coup, 6 years ago

Yeah, I'll figure out how to make it small and against latest trunk. And symbols for good measure :)

comment:6 by Even Rouault, 6 years ago

Any update on this ?

comment:7 by Even Rouault, 6 years ago

Ping again

comment:8 by Even Rouault, 5 years ago

Milestone: closed_because_of_github_migration
Resolution: wontfix
Status: newclosed

This ticket has been automatically closed because Trac is no longer used for GDAL bug tracking, since the project has migrated to GitHub. If you believe this ticket is still valid, you may file it to https://github.com/OSGeo/gdal/issues if it is not already reported there.

Note: See TracTickets for help on using tickets.