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

Confusing behavior between interesting exit code and interesting regexp, at least with treereduce-rust #195

Open
pacak opened this issue Jun 7, 2024 · 2 comments

Comments

@pacak
Copy link

pacak commented Jun 7, 2024

Consider options --interesting-exit-code and --interesting-stderr.

Right now the reduction is considered to be interesting when either condition matches:

let is_interesting = (interesting_code || stdout_match || stderr_match)

Suppose I'm tracking a specific compiler crash, I would pass --interesting-stderr my-error and don't specify any interesting exit code. This leaves it at a default value of 0 and treereduce-rust quickly reduces the example to empty file - "code 0 is interesting" according to default command line options.

Next attempt is me passing an expected exit code along with interesting stderr, but this can lead to minimization for some other compiler crash.

As a result to track a specific crash I need to pass --interesting-stderr my-error as well as --interesting-exit-code 12345 - some exit code that doesn't match.

There's several ways to solve it, least confusing would be to get rid of default code of 0 and ask user to specify at least one interesting criteria - exit code or regexp.

@langston-barrett
Copy link
Owner

Hey, thanks for the report! I agree that this is confusing.

least confusing would be to get rid of default code of 0 and ask user to specify at least one interesting criteria - exit code or regexp.

I agree that this would be very clear, but it would unfortunately make the CLI a bit more verbose, and less analogous with that of Halfempty.

Perhaps instead, we could have each interestingness condition be an Option, and && the Somes together, only falling back to the exit code of 0 when all of them are None?

@pacak
Copy link
Author

pacak commented Jun 7, 2024

Perhaps instead, we could have each interestingness condition be an Option, and && the Somes together, only falling back to the exit code of 0 when all of them are None?

Yea, this would work as well. "Default interesting exit code is 0 unless there are other criterias".

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