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

SIGSEGV with nested finally in closure iterator #23390

Open
arnetheduck opened this issue Mar 11, 2024 · 0 comments
Open

SIGSEGV with nested finally in closure iterator #23390

arnetheduck opened this issue Mar 11, 2024 · 0 comments

Comments

@arnetheduck
Copy link
Contributor

Description

proc p(self: int) =
  iterator p_738197581(): int {.
      closure, gcsafe, raises: [].} =
    var closureSucceeded_738197580 = true
    try:
      yield 0
    finally:
      if closureSucceeded_738197580:
        discard

  var internalClosure: iterator(): int {.raises: [], gcsafe.} = p_738197581

  while true:
    discard internalClosure()
    if internalClosure.finished(): break

try:
  try:
    raise (ref ValueError)()
  finally:
    p(0)
except CatchableError:
  discard

Nim Version

1.6.18, devel 773c066

Current Output

testit.nim(25) testit
excpt.nim(648) signalHandler
excpt.nim(330) _ZN6system18rawWriteStackTraceE3varI6stringE
stacktraces.nim(59) _ZN11stacktraces30auxWriteStackTraceWithOverrideE3varI6stringE
SIGSEGV: Illegal storage access. (Attempt to read from nil?)

Expected Output

No response

Possible Solution

No response

Additional Information

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants