<div dir="ltr"><div>Hi</div><div><br></div><div>Some times (unfortunately it is not reproducible every time) we got a crash when we cancel the overview generation.</div><div>I tried to reproduce it in my Ubuntu 20.04, but couldn't. My colleagues are able to reproduce some times on Mac and Windows.</div><div><br></div><div>In C++, with GDAL 3.3.1, calling BuildOverviews("AVERAGE", ...) to produce embedded overview and calling the cancel callback, it crashes on overviews.cpp:<br></div><div><br></div><div>~PointerHolder() { CPLFree(ptr); }. (line 3929)<br></div><div>The reason of the crash is : Thread 34: EXC_BAD_ACCESS (code=1, address=0x1d)</div><div><div>Yes, the debugger says the value of "ptr" is 0x1d... that does not make so much sense.</div><div><br></div></div><div>the debugger shows this steps on the back trace:<br></div><div>poJob->oDstBufferHolder.reset(new PointerHolder(poJob->pDstBuffer));  (line 4930)</div><div>GDALRegenerateOverviewsMultiBand (line 4638)<br><br></div><div><br></div><div>Before calling to BuildOverviews I am calling</div><div>CPLSetConfigOption("GDAL_NUM_THREADS", "ALL_CPUS");</div><div>to make it multithreaded.</div><div><br></div><div>The image is an RGBA 8bit with JPEG compression.</div><div><br></div><div>Is anything wrong there?<br></div><div><br></div><div>Thanks.<br></div><div><div><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature">.___ ._ ..._ .. . ._.  .___ .. __ . _. . __..  ... .... ._ .__<br>Entre dos pensamientos racionales <br>hay infinitos pensamientos irracionales.<br><br></div></div></div></div>