im currently investigating what i think is a compiler concurrency bug. it only happens:
- on the 5.7.3 release toolchain (5.8 branch is unaffected)
- on release builds (debug builds are unaffected)
it has something to do with coalescing a try result.get()
with the return value of an async
function call, like:
try await self.getResult().get()
the segfault can be prevented by placing print statements on both sides of the async function call.
print("_")
let result = await self.getResult()
print("_")
return try result.get()
this only seems to work if the print function prints at least one character to standard output.
i tried replacing the print("_")
s with:
- a call to an
@inline(never)
function in the same module - a call to an
@inline(never)
function in a different module
but neither of those things worked the way print("_")
does.
has anyone else run into something like this?