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

Closes #446 #447

Merged
merged 1 commit into from
Mar 7, 2018
Merged

Closes #446 #447

merged 1 commit into from
Mar 7, 2018

Conversation

ethanpailes
Copy link
Contributor

Thanks @BurntSushi for doing all the legwork on cutting down the failing test case and laying out a clear set of execution steps. It really helped me zero in on the bug.

This patch fixes an issue where skip resolution would go strait
to the default value (the md2_shift) on a match failure after
the shift_loop. Now we do the right thing, and first check in
the skip table. The problem with going strait to the md2_shift
is that you can accidentally shift to far when window_end
actually is in the pattern (as is the case for the failing
match).

In the issue thread I promised better modularity, but it turns
out that shift resolution was a bit too decomposed in the other
places I had mentioned. Sorry :(.

This patch fixes an issue where skip resolution would go strait
to the default value (the md2_shift) on a match failure after
the shift_loop. Now we do the right thing, and first check in
the skip table. The problem with going strait to the md2_shift
is that you can accidentally shift to far when `window_end`
actually is in the pattern (as is the case for the failing
match).

In the issue thread I promised better modularity, but it turns
out that shift resolution was a bit too decomposed in the other
places I had mentioned. Sorry :(.
@ethanpailes
Copy link
Contributor Author

Local testing: I ran the unit tests both at just this commit and with TBM turned back on. I'm currently running the quickcheck tests in a loop.

Copy link
Member

@BurntSushi BurntSushi left a comment

Choose a reason for hiding this comment

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

Awesome! Thanks so much for such a quick fix. :-)

@BurntSushi
Copy link
Member

I'm currently running the quickcheck tests in a loop.

Did you see my comment about the quickcheck tests? Frankly, I'm surprised you got as much mileage out of them as you did. :-)

@ethanpailes
Copy link
Contributor Author

Yeah, I agree about the quickcheck tests not being that likely to catch any remaining bugs. I'm only running them because I already have a hammer, so why not thrash about to try to find a nail that this change could have turned up.

I think the principled thing to do would be to hook them into a fuzzer somehow? Those have an actual model of the state space and tweak the input to more fully exersise it right?

@ethanpailes
Copy link
Contributor Author

The custom arbitrary instance you suggest should definitly be part of the picture as well.

@BurntSushi
Copy link
Member

I don't have much experience with fuzzers, but with an Arbitrary instance, you can encode whatever model of state you choose. :)

@ethanpailes
Copy link
Contributor Author

I think fuzzers do some code coverage deep magic, but I also don't really have experience with them.

@ethanpailes
Copy link
Contributor Author

@BurntSushi bump

@BurntSushi BurntSushi merged commit 7645ff2 into rust-lang:master Mar 7, 2018
@BurntSushi
Copy link
Member

@ethanpailes Thanks again!

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.

2 participants