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
Stack Overflow in Alt.choose #192
Comments
@haf I've made a research. It has to be linked with the compiler
I've created issue here: |
Amazingly enough, when I try to repro this I get the exact opposite result: I built the repro samples into a release mode console app:
|
@Szer thanks so much for putting in effort to research this issue. I think similar overflows affect a fair number of people using Hopac. I see that for this type of scenario, there is: Line 376 in 657a73d
For each recursive construct where overflow occurs on some platform or runtime, the questions for me are:
I think the solutions would be:
Let's hope the overflows are all caused by 1 and not 2. (Or something else I missed that isn't so bad to fix.) |
Description
Adding
Alt.choose
or<|>
in code somehow breaks tail calling and everything fails with SORerpo
run
good
codeIt will block forever which is good.
run
bad
codeIt fail with SO almost instantly
Expected
adding
<|> Alt.never
shouldn't break tail calling.Both examples should block forever.
Known workaround
None
Notes
Call stack is crawling with
(<|>).DoJob
calls. It means it never returns or not in tail position.Alt.tryIn
which calling everything from tail position (said so in description) doesn't help:The text was updated successfully, but these errors were encountered: