← Back to team overview

kicad-developers team mailing list archive

Re: [PATCH] Fuzzable PCB parsing test harness



I wrote "ms", I meant "us" - the times are in the handful-of-millsecond range.


On Mon, Oct 8, 2018 at 5:24 PM John Beard <john.j.beard@xxxxxxxxx> wrote:
> Hi,
> This is a patch to add a test program that allows to parse a Pcbnew
> file from command line params or stdin. This means you can use it for
> fuzz testing.
> I have done a little bit of fuzz testing so far (8 million execs,
> about 70% of a cycle), and have not found any crashes, but I can make
> it hang in a few ways. These all seem to be in streams which contain
> nul's. This is actually not reachable from the UI due to reading files
> into wxStrings first (nut quite sure why), whereas this program uses
> the parser directly. Thus, the bug is probably not very critical.
> Example hanging input attached (note there's a nul in it, so your
> editor may or may not like that).
> This program can also be fed a number of files, which means it could
> be used for automated testing that all files in a batch can be parsed
> successfully, and also provides a handy way to put GDB on a program
> when debugging the parser against specific input.
> There is timing on the parsing too, mostly for interest (use the -v
> flag). It takes about 150-3000ms per FP on my machine for the FPs in
> Connector_PinSocket_2.54mm.pretty.
> There's also some centralisation of some QA-related utils into a
> qa_utils library.
> Cheers,
> John

Follow ups