-
-
Notifications
You must be signed in to change notification settings - Fork 27
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
Compilation of mutated proc macros can hang #475
Comments
There are already build timeouts, in https://mutants.rs/timeouts.html?highlight=timeout#build-timeouts. Perhaps, or apparently, they're not working properly here? If you look in Are you using any options that might interfere with this, specifically It would help if you can share a small tree that reproduces the same problem. |
Here's more info:
|
It seems to be not setting a timeout to kill the process, and relying on rustc's internal detection of long running const eval. Maybe that doesn't cover proc macros? If you set |
Yep --build-timeout=60 did solve the problem, the specific case fails with a timeout. So I guess the issue I had is that the default build timeout is surprisingly large and so it appeared there was no timeout. |
Thanks for digging into this.
We primarily rely on rustc's built in detection of long running const eval.
But maybe this doesn't catch long-running proc macros, so we might need to
set a default build timeout too.
Martin
|
I think the way the
In a recent release it appears that the default for build timeouts was removed. |
Yes, I took out the default because it seemed hard to calculate a reasonable default, and I thought the The difficulty is that the initial clean build can be very long, much longer than we'd expect an incremental build can take. Also, especially with concurrent builds, there can be contention for cargo global caches that can cause particular builds to take longer. However the time for a clean build should give a reasonable upper bound. |
I'm working on a project that uses a lot of procedural macros and I'm trying to run mutation testing against the whole thing. This is unfortunately causing the compiler to enter into an infinite loop when certain mutations are applied.
Would it be possible to apply a timeout value to how long it takes to run the compiler for any given mutation, just like there is a timeout on the test execution?
Here's an example of this happening:
What's happening is that my test makes use of a procedural macro. The mutation performed has caused the execution of this procedural macro to get into an infinite loop, as sometimes happens during mutation. The problem is that since this logic is in a procedural macros, it gets used by the compiler, and so causes the compilation of the test crate to enter this infinite loop. And then we're stuck.
I think having a timeout on how long the compiler gets to run is the only clean way out of this. For the time being, I will exclude the specific functions that are causing this from mutation testing.
The text was updated successfully, but these errors were encountered: