<div dir="ltr">My suggestion is to just cherry pick or use as examples the fuzzer targets in autotest2. Google is okay with them being contributed the core GDAL code base under the GDAL license. The LLVMFuzzerTestOneInput functions are super simple for drivers and calls that support vsimem.<div><br></div><div>As for autotest2...</div><div><br></div><div>I make assumptions in autotest2 that are just not valid (yet or anytime soon) in GDAL... especially C++11 support and a lot of Google's opensource libraries (e.g. gunit, gmock, logging, absl, bazel, etc.). I haven't been able to see a near term path of getting autotest2 into mainline GDAL, so I've just not worried about it. It's such a massive win for me, that it's okay for me now if it's stand alone. People are welcome to use that code in their projects or as examples of API use as it's all Apache 2.0 licensed. But if there is desire in the community, I'm definitely open to (and would prefer) if autotest2 was eventually a part of GDAL itself.</div><div><br></div><div>And if there are any parts of autotest2 that people want moved into GDAL, I'd be happy to commit them as a contribution to GDAL (it would then be under the GDAL license). e.g. I find VsiMemTempWrapper and WithQuietHandler super handy for testing and the CHECK's could be ported to GDAL, replaced with something from GDAL, or the class could be changed to expose error reporting.</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, May 9, 2017 at 1:21 PM, Mateusz Loskot <span dir="ltr"><<a href="mailto:mateusz@loskot.net" target="_blank">mateusz@loskot.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On 8 May 2017 at 20:58, Kurt Schwehr <<a href="mailto:schwehr@gmail.com">schwehr@gmail.com</a>> wrote:<br>
> Yup... <a href="https://lists.osgeo.org/pipermail/gdal-dev/2017-April/046495.html" rel="noreferrer" target="_blank">https://lists.osgeo.org/<wbr>pipermail/gdal-dev/2017-April/<wbr>046495.html</a><br>
><br>
> I'd be happy if anyone else wanted to take lead on it.<br>
<br>
</span>I'd really like to, but due to newborn & family duties I'm not going<br>
to promise anything.<br>
<span class=""><br>
> I've added a number of fuzz targets to<br>
> <a href="https://github.com/schwehr/gdal-autotest2/tree/master/cpp" rel="noreferrer" target="_blank">https://github.com/schwehr/<wbr>gdal-autotest2/tree/master/cpp</a> and modified GDAL<br>
> to make fuzzing more productive... e.g.<br>
><br>
> <a href="https://trac.osgeo.org/gdal/changeset/37592/" rel="noreferrer" target="_blank">https://trac.osgeo.org/gdal/<wbr>changeset/37592/</a> adds<br>
> FUZZING_BUILD_MODE_UNSAFE_FOR_<wbr>PRODUCTION to a driver<br>
> <a href="https://trac.osgeo.org/gdal/changeset/37909" rel="noreferrer" target="_blank">https://trac.osgeo.org/gdal/<wbr>changeset/37909</a> example fix<br>
<br>
</span>The autotest2 efforts are awesome, but huge'ish and without RFC(s)<br>
and lots of work, they won't make it into GDAL any time soon, I suspect.<br>
<br>
So, wonder if we could integrate with oss-fuzz at smaller scale:<br>
- create /fuzzer direcotry (next to /gdal and /autotest)<br>
- port fuzz targets only from Kurt's<br>
<a href="https://github.com/schwehr/gdal-autotest2/blob/master/cpp/" rel="noreferrer" target="_blank">https://github.com/schwehr/<wbr>gdal-autotest2/blob/master/<wbr>cpp/</a><br>
- add minimal integration with GDAL build config for Unix<br>
<br>
and basically follow<br>
<a href="https://github.com/google/oss-fuzz/blob/master/docs/ideal_integration.md" rel="noreferrer" target="_blank">https://github.com/google/oss-<wbr>fuzz/blob/master/docs/ideal_<wbr>integration.md</a><br>
<br>
Best regards,<br>
<span class="HOEnZb"><font color="#888888">--<br>
Mateusz Loskot, <a href="http://mateusz.loskot.net" rel="noreferrer" target="_blank">http://mateusz.loskot.net</a><br>
</font></span><div class="HOEnZb"><div class="h5">______________________________<wbr>_________________<br>
gdal-dev mailing list<br>
<a href="mailto:gdal-dev@lists.osgeo.org">gdal-dev@lists.osgeo.org</a><br>
<a href="https://lists.osgeo.org/mailman/listinfo/gdal-dev" rel="noreferrer" target="_blank">https://lists.osgeo.org/<wbr>mailman/listinfo/gdal-dev</a></div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature">--<div><a href="http://schwehr.org" target="_blank">http://schwehr.org</a></div></div>
</div>