Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

It looks better than Delta #1

Open
PenelopeFudd opened this issue Jul 15, 2013 · 2 comments
Open

It looks better than Delta #1

PenelopeFudd opened this issue Jul 15, 2013 · 2 comments

Comments

@PenelopeFudd
Copy link

Hi; I've been using 'Delta', from http://delta.tigris.org/using_delta.html , and I was wondering if perl-reduce is better. I guess it must be, since perl-reduce at least knows something about the language! Does perl-reduce do a binary search?

@wumpus
Copy link
Member

wumpus commented Jul 17, 2013

It's probably fair to say that Delta does better than perl-reduce some of the time, and vice versa. I am depending on B::Deparse for deformatting, but some of the original formatting sneaks through it. Sounds like Delta is less sensitive to that, but, since it doesn't know perl syntax it probably screws up some of the time. I should probably try stealing Delta's parser thingie to run after B::Deparse... B::Deparse at least makes all of the strings a lot more normalized.

perl-reduce does a line-at-a-time search right now, so it's not very fast.

What I really really really need is more real examples of crash-inducing code. Can you provide some?

@PenelopeFudd
Copy link
Author

Well, I've broadened my definition of crash-inducing to just 'has a bug', and I use delta to minimize for that. It's true that delta doesn't know anything about perl constructs, and wastes time testing things that couldn't possibly run. My solution was to write a minimal version of the c preprocessor CPP that only understands un-nested ifdefs and ifndefs, which is what diff -D generates, and the test script accepts a list of ifdef targets, uses my CPP to create a modified input file, checks it for syntax with perl -c, then runs it to see if it still exhibits the bug or other interesting behaviour. The ifdef targets have to be unique, or else they all get turned on or off at the same time, but I've got a gawk script to renumber them.

So, instead of crash-inducing code, it could look for code that runs differently before and after B::deparse, for instance. Of course, that would be tricky if B::deparse is the first step! :-). I used delta to minimize a program that decrypted a file and printed it to stdout, among many other things; the resulting program was simple and did only that which I tested for (grep for the decrypted plaintext from stdout).

What about modifying codesmith to emit perl instead?

Greg Lindahl [email protected] wrote:

It's probably fair to say that Delta does better than perl-reduce some of the time, and vice versa. I am depending on B::Deparse for deformatting, but some of the original formatting sneaks through it. Sounds like Delta is less sensitive to that, but, since it doesn't know perl syntax it probably screws up some of the time. I should probably try stealing Delta's parser thingie to run after B::Deparse... B::Deparse at least makes all of the strings a lot more normalized.

perl-reduce does a line-at-a-time search right now, so it's not very fast.

What I really really really need is more real examples of crash-inducing code. Can you provide some?


Reply to this email directly or view it on GitHub.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants