Erlang Mailing Lists

Author Message

<  Erlang bugs mailing list  ~  gen_server and {spawn_opt, [monitor]}

Guest
Posted: Thu Nov 23, 2006 10:48 pm Reply with quote
Guest
Hi Erlangers

I found a bug in proc_lib, on windows (C:Program Fileserl5.5.2libstdlib-1.14.2srcproc_lib.erl).

If one call gen_server:start(Module, start, Args, [{spawn_opt, [monitor]}]) the call will not return !

Some analysis yields that the cause is that the gen_server:start() call ends up in erlang:spawn_opt(..., [monitor]) which return {Pid, Monitor}, making the proc_lib:sync_wait() wait for {Pid, Monitor} and not Pid which is what the newly spawned process sends in the ack-message.

My guess of a fix is that proc_lib:spawn_opt() checks the return value from erlang:spawn_opt(). I'm including an untested fix.

Cheers
/Fredrik

Post recived from mailinglist
Guest
Posted: Fri Nov 24, 2006 9:23 am Reply with quote
Guest
Hi,

Thanks for your bug report. The error will be corrected in R11B-3.

Regards,
Gunilla, Erlang/OTP team

Fredrik Linder wrote:
> Hi Erlangers
>
> I found a bug in proc_lib, on windows (C:\Program
> Files\erl5.5.2\lib\stdlib-1.14.2\src\proc_lib.erl).
>
> If one call gen_server:start(Module, start, Args, [{spawn_opt,
> [monitor]}]) the call will not return !
>
> Some analysis yields that the cause is that the gen_server:start() call
> ends up in erlang:spawn_opt(..., [monitor]) which return {Pid, Monitor},
> making the proc_lib:sync_wait() wait for {Pid, Monitor} and not Pid
> which is what the newly spawned process sends in the ack-message.
>
> My guess of a fix is that proc_lib:spawn_opt() checks the return value
> from erlang:spawn_opt(). I'm including an untested fix.
>
> Cheers
> /Fredrik

_______________________________________________
erlang-bugs mailing list
erlang-bugs@erlang.org
http://www.erlang.org/mailman/listinfo/erlang-bugs
Post recived from mailinglist

Display posts from previous:  

All times are GMT
Page 1 of 1
This forum is locked: you cannot post, reply to, or edit topics.

Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum