[lld] r308809 - Don't crash on an empty section with an ALIGN.

Davide Italiano via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 24 08:20:02 PDT 2017


On Mon, Jul 24, 2017 at 12:53 AM, George Rimar via llvm-commits
<llvm-commits at lists.llvm.org> wrote:
> I noticed that during last weeks we had several fixes committed to fix LLD crashes
> because of uncommon scripts. Like this one or discarding synthetic sections earlier.
>
> About a year ago we used AFL (http://lcamtuf.coredump.cx/afl/) for fuzzing LLD.
> That time we fuzzed input objects (binaries).
> As far I know it is possible to teach AFL about some syntax and provide a dictionary of keywords,
> and as a result it probably should be able to generate and test linkerscripts.
> Which probably can reveal more uncommon cases leading to crashes/hangs may be.
>

It shouldn't be particularly hard to do mutation based on the linker
script grammar.
Maybe you can use `libFuzzer`, but I havne't looked into it (IIRC Peter did).

You can also try something like what's described in
"Skeletal Program Enumeration for Rigorous Compiler Testing"
https://arxiv.org/abs/1610.03148 . For your first run(s), you can
probably ignore scoping, and just swap, e.g. directives.

Thanks,

--
Davide


More information about the llvm-commits mailing list