Skip to content

SIGSEV with try and closure iterators #25018

Closed
@Graveflo

Description

@Graveflo

Nim Version

latest devel

Description

This is as far as I have been able to isolate the issue:

import std/[asyncdispatch]

proc blahAsync() {.async.} =
  try:
    await sleepAsync(1)
  finally:
    discard

try:
  try:
    raise newException(ValueError, "")
  finally:
    waitFor blahAsync()
except:
  discard

edit: seems to have nothing to do with unittest

for some reason the finally in blahAsync causes something strange to happen.

Current Output

Traceback (most recent call last)
/usr/lib/nim/lib/pure/asyncfutures.nim(162) nimscraps
SIGSEGV: Illegal storage access. (Attempt to read from nil?)

Expected Output

Unhandled exception:  [ValueError]
  [FAILED] something

Known Workarounds

re-raise in blahAsync works but that is impractical

Additional Information

No response

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions