-
Notifications
You must be signed in to change notification settings - Fork 25
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
Add various strategies to minimize different patterns. #2
Conversation
I had tested this previously, and you've fixed the issues I've found. Nice work! Jesse would be the one to review this, though. |
…and line switches.
I'm using on some of the production instances, and found the following bug: time python -u ~/nbp-lithium/lithium/lithium.py --chunksize=2 --strategy=minimize-balanced crashes --timeout=3 $tmd --fuzzing-safe --no-threads --no-baseline --no-ion bb218522.js real 0m2.729s Used m-c rev f0c0480732d3, testcase is in: |
I've had to stop using --strategy=minimize-balanced on production for now. For some reason testcases were only showing up as Q10 (non-reduced) on FuzzManager and I've yet to debug this. |
@nbp, as discussed in-person, do you mind rebasing this to lithium tip? |
This pull request do multiple things, such as removing unused strategies, and add new strategies, add a
--symbols
way to split the test cases.Added strategies:
minimize-around: This Strategy attempt at removing pairs of chuncks which might be surrounding interesting code, but which cannot be removed independently of the other. This happens frequently with patterns such as:
minimize-balanced: This Strategy attempt at removing balanced chuncks which might be surrounding interesting code, but which cannot be removed independently of the other. This happens frequently with patterns such as:
The value of the condition might not be interesting, but in order to reach the interesting code we still have to compute it, and keep extra code alive.
replace-properties-by-globals: This Strategy attempt at removing members, such as other strategies can then move the lines out-side the functions. The goal is to rename variable at the same time, such as the program remains valid, while removing the dependency on the object on which the member is.
Which might transform the previous example to something like:
replace-arguments-by-globals: This Strategy attempt at replacing arguments by globals, for each named argument of a function we add a setter of the global of the same name before the function call. The goal is to remove functions by making empty arguments lists instead.
becomes:
These patches are also adding the
--symbols
command line to lithium.This option let lithium treat the file as a sequence of strings separated by tokens. The characters by which the strings are delimited are defined by the
--cutBefore
, and--cutAfter
command-line options which default to any of?=;{[
, and]}:
. The cut before options, is used to stop a string if the next character is one of the character defined, The cut after options, is used to stop a string if the last character is one of the character defined. Note, the closing square braces (]
) should be listed first, and the opening square braces ([
) should be listed last in both of these options.