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

Fuzz for panics #51

Open
petervdonovan opened this issue Mar 7, 2024 · 1 comment
Open

Fuzz for panics #51

petervdonovan opened this issue Mar 7, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@petervdonovan
Copy link
Contributor

petervdonovan commented Mar 7, 2024

This is a proposal for an testing enhancement that might help us eliminate panics.

I should preface this by saying that this issue is not urgent and I am not asking any one specific person to worry about it right now. The purpose of this issue is to document an idea in case we later decide to pursue it.

Probably lingo should not panic.

Here is an example of lingo panicking:

lfc: fatal error: /home/peter/xronos/tracing-plugin-reproducible-example/lf/laggy: No such file or directory.
thread 'main' panicked at lingo/src/backends/mod.rs:160:21:
build step failed because of laggy with main reactor /home/peter/xronos/tracing-plugin-reproducible-example/lf/laggy!
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

If the branch that creates liblingo gets merged, the library part of lingo should be fuzzed by injecting mock file system access functions that sometimes but not always misbehave/fail. This is representative of a real file system, because real file systems will be concurrently accessed by other processes on the system, making them inherently unpredictable. This is easy to fuzz because panics are easy to detect without any false positives or false negatives. This issue would have been addressed when we hit all the error paths. It is possible to just grab a mutex and record which error paths have been hit as a way to track coverage without needing any fancy build system tricks.

There are other properties that would be easy to fuzz for, like not going for more than ten seconds without producing any output on stdout or stderr.

@petervdonovan petervdonovan added the enhancement New feature or request label Mar 7, 2024
@tanneberger
Copy link
Member

tanneberger commented Mar 13, 2024

right now the panic is explicit see: https://github.com/lf-lang/lingo/blob/main/src/backends/mod.rs#L155 if you set --keep-going then it wont. But probably smart to just propagate the error to the main function and return an error code.

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

No branches or pull requests

2 participants