Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ExprPixelFunc(): fix memory leak in error code path #3

Closed

Conversation

rouault
Copy link

@rouault rouault commented Jan 11, 2025

Fixes https://github.com/OSGeo/gdal/actions/runs/12718613957/job/35457381239?pr=11209

2025-01-11T01:23:20.3982957Z =================================================================
2025-01-11T01:23:20.3983380Z ==11530==ERROR: LeakSanitizer: detected memory leaks
2025-01-11T01:23:20.3983629Z 
2025-01-11T01:23:20.3987049Z Direct leak of 8 byte(s) in 1 object(s) allocated from:
2025-01-11T01:23:20.3996994Z     #0 0x7fdd70b2f7a3 in malloc (/usr/lib/llvm-18/lib/clang/18/lib/linux/libclang_rt.asan-x86_64.so+0xf87a3) (BuildId: bf9e3747052c46cd49f7974555b1700dce30b8c0)
2025-01-11T01:23:20.3998358Z     #1 0x7fdd5acc7e3c in VSIMalloc /home/runner/work/gdal/gdal/port/cpl_vsisimple.cpp:555:12
2025-01-11T01:23:20.3999219Z     #2 0x7fdd5ac054f6 in CPLMalloc /home/runner/work/gdal/gdal/port/cpl_conv.cpp:193:21
2025-01-11T01:23:20.4000506Z     #3 0x7fdd5d569c6b in ExprPixelFunc(void**, int, void*, int, int, GDALDataType, GDALDataType, int, int, char const* const*) /home/runner/work/gdal/gdal/frmts/vrt/pixelfunctions.cpp:1685:31
2025-01-11T01:23:20.4003893Z     #4 0x7fdd5d3a8a20 in CPLErr std::__invoke_impl<CPLErr, CPLErr (*&)(void**, int, void*, int, int, GDALDataType, GDALDataType, int, int, char const* const*), void**, int, void*, int, int, GDALDataType, GDALDataType, int, int, char const* const*>(std::__invoke_other, CPLErr (*&)(void**, int, void*, int, int, GDALDataType, GDALDataType, int, int, char const* const*), void**&&, int&&, void*&&, int&&, int&&, GDALDataType&&, GDALDataType&&, int&&, int&&, char const* const*&&) /usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/invoke.h:61:14
2025-01-11T01:23:20.4009486Z     #5 0x7fdd5d3a830a in std::enable_if<is_invocable_r_v<CPLErr, CPLErr (*&)(void**, int, void*, int, int, GDALDataType, GDALDataType, int, int, char const* const*), void**, int, void*, int, int, GDALDataType, GDALDataType, int, int, char const* const*>, CPLErr>::type std::__invoke_r<CPLErr, CPLErr (*&)(void**, int, void*, int, int, GDALDataType, GDALDataType, int, int, char const* const*), void**, int, void*, int, int, GDALDataType, GDALDataType, int, int, char const* const*>(CPLErr (*&)(void**, int, void*, int, int, GDALDataType, GDALDataType, int, int, char const* const*), void**&&, int&&, void*&&, int&&, int&&, GDALDataType&&, GDALDataType&&, int&&, int&&, char const* const*&&) /usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/invoke.h:114:9
2025-01-11T01:23:20.4014368Z     #6 0x7fdd5d3a7c76 in std::_Function_handler<CPLErr (void**, int, void*, int, int, GDALDataType, GDALDataType, int, int, char const* const*), CPLErr (*)(void**, int, void*, int, int, GDALDataType, GDALDataType, int, int, char const* const*)>::_M_invoke(std::_Any_data const&, void**&&, int&&, void*&&, int&&, int&&, GDALDataType&&, GDALDataType&&, int&&, int&&, char const* const*&&) /usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/std_function.h:290:9
2025-01-11T01:23:20.4017879Z     #7 0x7fdd5d3a5c9f in std::function<CPLErr (void**, int, void*, int, int, GDALDataType, GDALDataType, int, int, char const* const*)>::operator()(void**, int, void*, int, int, GDALDataType, GDALDataType, int, int, char const* const*) const /usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/std_function.h:591:9
2025-01-11T01:23:20.4020358Z     #8 0x7fdd5d39a7be in VRTDerivedRasterBand::IRasterIO(GDALRWFlag, int, int, int, int, void*, int, int, GDALDataType, long long, long long, GDALRasterIOExtraArg*) /home/runner/work/gdal/gdal/frmts/vrt/vrtderivedrasterband.cpp:1392:16
2025-01-11T01:23:20.4022581Z     #9 0x7fdd630a0310 in GDALRasterBand::RasterIO(GDALRWFlag, int, int, int, int, void*, int, int, GDALDataType, long long, long long, GDALRasterIOExtraArg*) /home/runner/work/gdal/gdal/gcore/gdalrasterband.cpp:444:13
2025-01-11T01:23:20.4024168Z     #10 0x7fdd630a19ee in GDALRasterIOEx /home/runner/work/gdal/gdal/gcore/gdalrasterband.cpp:505:21
2025-01-11T01:23:20.4026217Z     #11 0x7fdd4a4ca40a in BandRasterIONumPy(void*, int, double, double, double, double, tagPyArrayObject*, GDALDataType, GDALRIOResampleAlg, int (*)(double, char const*, void*), void*) /home/runner/work/gdal/gdal/build-asan/swig/python/extensions/gdal_array_wrap.cpp:4769:27

@dbaston
Copy link
Owner

dbaston commented Jan 11, 2025

applied locally

@dbaston dbaston closed this Jan 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants