-
-
Notifications
You must be signed in to change notification settings - Fork 415
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
Segfault when using a recoverd trn Array #1983
Comments
In my larger code, it sometimes doesn't segfault but in that case the objects in the Array hava inconsistent field values (a random number instead of the expected value). It looks like a bad pointer or use-after-free error. |
This is similar to #1979. I'm not sure what could be causing the segfault though. |
I think the error is here: foos = recover val foos end foos is possibly not sendable (trn). My solution here is turning class FooGenerator
var foos: (None | Array[Foo val] trn) = recover trn Array[Foo val] end
let _notify: Bar val
fun ref stop() =>
try
let foos' = (foos = None) as Array[Foo val] trn
_notify.result(consume val foos')
end
... However, the compiler should spot the original programing error. |
* remove old-style lanbda functions * fix many occurences of ponylang/ponyc#1983 * fixes in the batch mechanism
The code in the issue description shows the resulting segfault. The fact that this much shorter chunk compiles is the real issue. actor Main
var foo: (String trn| String val) = recover trn String end
var bar: (String trn| I32) = recover trn String end
new create(e: Env) =>
let foo' = recover val foo end
// let bar' = recover val bar end This compiles as long as |
this code segfaults in Bar.result
Notes, so far:
actor Caller
is removed and its apply and stop behaviours are implemented inMain
foos
is an(Array[I32] trn | Array[I32] val)
instead of (Array[Foo val] trn | Array[Foo val] val)Main.create()
is small (< 20)_notify.result(foos)
inFooGenerator.stop()
is not called, even if the debug statement usesfoos
as a recovered valThe text was updated successfully, but these errors were encountered: