doublec / aliceml-abandoned

Moved to aliceml/aliceml
30 stars 1 forks source link

Unpickled proxy function call fails with Hole.Hole exception #2

Closed ardeujho closed 9 years ago

ardeujho commented 10 years ago

If an alice instance unpickles and calls a proxy function it will sometimes fail with a Hole.Hole exception. To reproduce, in alice instance A do:

val f = Remote.proxy (fn s => print (s ^ "\n"));
Pickle.save ("/tmp/a.pickle", pack (val it = f) : (val it : string -> unit));  

In alice instance B do:

structure H = unpack Pickle.load "/tmp/a.pickle" : (val it : string -> unit);
H.it "foo";

The exception gets raised in instance B:

Uncaught exception
   Hole.Hole

If the Remote structure is used in instance B before calling the deserialized proxy function then it works fine:

await Remote.port;
H.it "foo";

This can be any use of Remote. Opening it, calling a function in it, etc. It seems like something in Remote needs to be initialized that doesn't occur when just deserializing and calling the proxy function.

doublec commented 9 years ago

Following up at aliceml/aliceml#3.