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 reproducible sources of panic to tests #10144

Open
jdm opened this issue Mar 23, 2016 · 9 comments
Open

Add reproducible sources of panic to tests #10144

jdm opened this issue Mar 23, 2016 · 9 comments
Labels

Comments

@jdm
Copy link
Member

@jdm jdm commented Mar 23, 2016

Ideas:

  • window.panic() for script
  • -servo-panic property for CSS parsing/layout
  • about:panic URL for network fetches
  • some layout feature that generates a display list that triggers a panic
@jdm jdm added the A-testing label Mar 23, 2016
@jdm
Copy link
Member Author

@jdm jdm commented Mar 23, 2016

I also played around with a chaos mode idea that involved randomly simulating channel send/receive failure with some measure of probability. I tried to make the ChaosSender/ChaosReceiver interface identical to Sender/Receiver but got burned by our use of select!, so I never finished it.

@asajeffrey
Copy link
Member

@asajeffrey asajeffrey commented Mar 23, 2016

As discussed on IRC, we need to make sure we're not adding an attack surface by doing this, perhaps by putting the injected panics behind a build flag?

@larsbergstrom
Copy link
Contributor

@larsbergstrom larsbergstrom commented Mar 23, 2016

It would be super-nifty if we could create a fuzzing tool that randomly instrumented the binary with panic calls, but I suspect that won't work due to differences in compilation (e.g., exception hander frames) when a function can panic. So we can't just do like a debugger and overwrite with int 3 and see what happens... or can we? @alexcrichton might know.

If there's some way to make a generally-usable tool for Rust that would do this, I'd probably be willing to help find and fund a graduate student for a summer to work on it.

@alexcrichton
Copy link
Contributor

@alexcrichton alexcrichton commented Mar 23, 2016

Ah yeah unfortunately I don't know of any great way to inject a panic into already-compiled code (it would probably be unsound though?).

@asajeffrey
Copy link
Member

@asajeffrey asajeffrey commented Mar 23, 2016

Could we add a "chaos" cfg, which components could use to add random failure, with the idea that if we compile servo with chaos enabled, the resulting binary shouldn't panic?

@asajeffrey
Copy link
Member

@asajeffrey asajeffrey commented Mar 23, 2016

I started on a patch which would add randomly closing pipelines: asajeffrey@a9fb350

@asajeffrey
Copy link
Member

@asajeffrey asajeffrey commented Mar 25, 2016

The patch is now PR #10179, which has been r+d. This doesn't inject panic directly, but it does randomly kill pipelines without the usual clean-up, which results in panic.

@nox
Copy link
Member

@nox nox commented Oct 1, 2017

Is this still something we want?

@jdm
Copy link
Member Author

@jdm jdm commented Oct 1, 2017

I still believe that it's a good idea.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
5 participants
You can’t perform that action at this time.