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

Add fsm_print_vmc mode to fuzzer. #410

Merged
merged 1 commit into from
Apr 24, 2023
Merged

Add fsm_print_vmc mode to fuzzer. #410

merged 1 commit into from
Apr 24, 2023

Conversation

silentbicycle
Copy link
Collaborator

While on an older branch I got some warnings for uninitialized memory in src/libfsm/vm/ir.c's initial_translate_state (for st->strategy). The issue seems to have been fixed already on main, but I added a fuzz harness to search for inputs that triggered abort()/assert.

I ran it for about an hour without finding any, but it's probably worth keeping the fuzzer code.

While on an older branch I got some warnings for uninitialized memory in
src/libfsm/vm/ir.c's `initial_translate_state` (for `st->strategy`). The
issue seems to have been fixed already on `main`, but I added a fuzz
harness to search for inputs that triggered `abort()`/assert.

I ran it for about an hour without finding any, but it's probably worth
keeping the fuzzer code.
@silentbicycle
Copy link
Collaborator Author

Rerunning CI, unrelated failures due to network errors in the documentation jobs.

}

/* see if this triggers any asserts */
fsm_print_vmc(f, fsm);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should call all fsm_print interfaces here. This fuzzer isn't really specific to the VM-based outputs, either. Let's run everything we have.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doing so immediately revealed that several of them assert or exit(EXIT_FAILURE) if called with an unsupported IO mode. Should they just return instead?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, no. That's part of their calling contract. I think really we should have them return -1 for failure (which they should be doing anyway, but aren't), and set ENOTSUPP. I'll take that on a separate PR, i want to bubble up other errors through that interface for e.g. when fprintf fails. Thanks!

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay. I can commit calling all of them that but not my local changes to make them not exit/assert, then.

@katef katef merged commit 911de88 into main Apr 24, 2023
@katef katef deleted the sv/fuzz-fsm_print_vmc branch April 24, 2023 19:56
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

Successfully merging this pull request may close these issues.

None yet

2 participants