-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Add optional flag --propagage_exit_codes to reproduce #13133
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
base: master
Are you sure you want to change the base?
Conversation
This flag modifies the reproduce command to properly propagate the exit codes of the underlying command back to the caller of reproduce. This can be helpful when determining details of what happened during the reproduction of the testcase. This should fully preserve backwards compatibility when the flag is not used.
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
CLA signed. |
@jonathanmetzman WDYT about just making this the default behaviour? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks @authwait ! and sorry for the delay in following up on this.
@@ -482,6 +484,14 @@ def get_parser(): # pylint: disable=too-many-statements,too-many-locals | |||
reproduce_parser.add_argument('--valgrind', | |||
action='store_true', | |||
help='run with valgrind') | |||
reproduce_parser.add_argument('--propagate_exit_codes', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Discussed this with @jonathanmetzman offline -- this should be fine as default behaviour.
action='store_true', | ||
default=False, | ||
help='return underlying exit codes instead of True/False.') | ||
reproduce_parser.add_argument('--err_result', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rather than introduce another flag, perhaps we can just hardcode and document a specific error code for this?
i.e.
EXIT_CODE_FUZZER_NOT_EXISTS = 199
(probably need to pick an error code here is unlikely to clash generally)
This flag modifies the reproduce command to properly propagate the exit codes of the underlying command back to the caller of reproduce. This can be helpful when determining details of what happened during the reproduction of the testcase.
This also adds an optional
--err_result
to let the user use the previously unavailable err_result override provided by reproduce_impl.This should fully preserve backwards compatibility when the flag is not used.
This is a change currently implemented in the v1.0.0 of the AIxCC AFC public fork.
I wanted to open this PR in case it was desired to pull this into upstream.
Notably, this means the
reproduce_impl
function changes its return type based on an optional flag (from bool to int), which is... not ideal (although fully functional here). If we want to clean that up we can.