Extending the Typed Racket language creates an infinite loop
Nobody has claimed this yet.
- Dominant language
- Racket
- Stars
- 575
- Forks
- 106
- Avg merge
- 2h 1m
- Merged PRs (30d)
- 2
Description
What version of Racket are you using?
v6.12
What program did you run?
File a.rkt
#lang typed/racket
(require (for-syntax racket/base))
(provide
(rename-out [custom-module-begin #%module-begin]))
(define-syntax (custom-module-begin stx)
(syntax-case stx ()
[(_ _) #`(#%module-begin
(provide x)
(: x Integer)
(define x 5))]))
File b.rkt
#lang s-exp "a.rkt"
aoeu
What should have happened?
The program spins in an infinite loop, consuming an unbounded amount of memory until it is terminated. The #lang racket or #lang typed/racket/no-check languages do not have this behavior.
If you got an error message, please include it here.
The dmesg command outputs:
[3981528.508682] Out of memory: Kill process 27293 (pyramidc.rkt) score 980 or sacrifice child
[3981528.510976] Killed process 27293 (pyramidc.rkt) total-vm:129313452kB, anon-rss:129152020kB, file-rss:0kB
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the infinite loop using the custom-module-begin in a.rkt and the #lang s-exp program in b.rkt, then compare it with the stated racket and typed/racket/no-check behavior. Trace the Typed Racket language-extension entry point involved in expanding b.rkt. Done means the example terminates without unbounded memory growth.
Written by the indexing model from the issue text.
Assessment
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100