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

Symbolic json library support #30

Closed
pschanely opened this issue Apr 28, 2020 · 1 comment
Closed

Symbolic json library support #30

pschanely opened this issue Apr 28, 2020 · 1 comment
Labels
missed bug CrossHair does not report a problem that it (possibly) could have.

Comments

@pschanely
Copy link
Owner

pschanely commented Apr 28, 2020

Expected vs actual behavior
Because the json module is implemented in C by default, CrossHair cannot analyze it symbolically. (instead, it falls back to testing with a few concrete values)

To Reproduce
This is an example where we'd like to find a counterexample, but cannot.

Ideas for fixing
Cpython actually contains both a pure python implementation and a C implementation. By dropping the appropriate C internal module, we can force use of the pure python version. We did this with the datetime module here, and presumably could do a similar thing for the json module. Note that I'm not completely confident this will be enough to demonstrate the example above, but it'll get us quite a bit closer.

@pschanely pschanely added the missed bug CrossHair does not report a problem that it (possibly) could have. label Apr 28, 2020
@pschanely
Copy link
Owner Author

It's not super performant, but finding counterexamples through JSON encode and decode has been working for a while now! Closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
missed bug CrossHair does not report a problem that it (possibly) could have.
Projects
None yet
Development

No branches or pull requests

1 participant