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
invoke-unit and unit-from-context can trigger an internal typechecker error #1305
Comments
Your timing is ... well, I'm just about to start the final build. I think that this has been failing for quite a while:
... so I'm going to suggest that this should not block the release, even if the fix is simple. |
Yes, I would not expect it to be a new issue. Definitely don’t worry about it for v8.8! |
That program is very worrying to me because I don't see how TR could ever be expected to handle that, and because I thought you had to define a unit from context to make that work. |
I don’t think I understand your comment. Why don’t you think TR could ever be expected to handle that, and what do you mean by “I thought you had to define a unit from context to make that work”? |
Here’s another related program that also triggers a segfault but does not require the definition of a local macro: #lang racket
(module untyped racket
(provide a^)
(define-signature a^
[x
(define-values-for-export [x] 'not-a-pair)]))
(module typed typed/racket
(require/typed (submod ".." untyped)
[#:signature a^ ([x : (Pairof Integer Integer)])])
(define-unit get-x@
(import a^)
(export)
x)
(define v : (Pairof Integer Integer)
(invoke-unit get-x@ (import a^)))
(+ (car v) (cdr v)))
(require 'typed) |
Some good news: #1306 downgrades this issue from a soundness hole to a typechecking failure. The first program now fails with the following error:
The second program fails with this one:
Both these programs are ultimately ill-typed, but they could in theory be modified to be well-typed. The second program probably ought to be rejected regardless, as TR is not supposed to support signatures containing definitions at all, which could be easily fixed. The first program, however, is more legitimate. To summarize, I think this is still a bug, but it is much less serious, and unless someone actually runs into it in a real program, it may not be worth worrying about. |
Update: this is no longer a soundness hole, see #1305 (comment).
The following program is accepted and produces garbage or segfaults on Racket 8.7:
The text was updated successfully, but these errors were encountered: