-
Notifications
You must be signed in to change notification settings - Fork 268
Open
Labels
P4not schedulednot scheduledtype=enhancementMake an existing feature betterMake an existing feature better
Description
Example
import com.google.common.truth.Truth;
import org.junit.jupiter.api.Test;
public class TruthTest {
@Test
void test() {
Truth.assertThat(new EvilThrowable()).isSameInstanceAs(new RuntimeException());
}
static class EvilThrowable extends Throwable {
@Override
public synchronized Throwable getCause() {
return new EvilThrowable();
}
}
}
This example does not terminate, it just spins forever.
I beleive this is because StackTraceCleaner does not implement any kind of hard limit (which is the only way I can think of of how to fix this).
I know this is a very specific edge case, it came up while trying to test code that does a similar thing (traverse a Throwable's causes) with a malicious/very broken implementation of a Throwable.
Metadata
Metadata
Assignees
Labels
P4not schedulednot scheduledtype=enhancementMake an existing feature betterMake an existing feature better