[erlang-bugs] gen_server and {spawn_opt, [monitor]}

Gunilla Arendt gunilla@REDACTED
Fri Nov 24 10:22:09 CET 2006


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




More information about the erlang-bugs mailing list