develooper Front page | perl.perl5.porters | Postings from June 2013

Re: reducing perl-crashing scripts to a minimum reproducer

Thread Previous
From:
Ed Avis
Date:
June 25, 2013 12:13
Subject:
Re: reducing perl-crashing scripts to a minimum reproducer
Message ID:
loom.20130625T140844-971@post.gmane.org
Greg Lindahl <greg <at> blekko.com> writes:

>Inspired by C-Reduce, perl-reduce takes a perl program that causes a
>bug in perl itself, such as a core-dump in the perl interpreter, and
>tries to reduce the program to the minimum program needed to cause the
>bug.
>
>https://github.com/blekko/perl-reduce

This looks very handy.  Until now I have used 'delta' for this job, but that
is a simple text-based tool that just removes whole lines.  Next time I will
try your tool instead.

A feature I've sometimes wished for is to automatically inline libraries,
replacing 'use Foo' with the contents of Foo.pm followed by 'package main;'.
Once you have a minimal test case, but it contains a 'use' line, you can
expand out that library and minimize again.

Sometimes, too, I will inline file contents as DATA sections.  They can then
be minimized line-by-line.  So as well as B::Deparse it might be useful to
try knocking out lines from DATA sections or here documents.

-- 
Ed Avis <eda@waniasset.com>


Thread Previous


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About