[erlang-patches] Fix io:xxxx(self()) no return

Stefan Zegenhagen stefan.zegenhagen@REDACTED
Mon Jun 3 11:17:06 CEST 2013


Dear Eric,

> here is a patch that fix the bug I found.
> 
> git fetch https://github.com/crownedgrouse/otp.git
> fix_io_noreturn_with_self_pid

I would like to note that there might be cases where

group_leader() =:= self()

In that case, your patch would cause an infinite loop.

Please note that the pid passed to io:xxx() should be the pid of an I/O
server that speaks the I/O protocol. The io:xxx() functions are not
meant to be passed *ANY* pid.

It surely is bad to have a process lock up easily just by calling
io:xxx(self(), ...), but I'd rather prefer to return {error, enotsup} in
that case. The caller should probably do the call to group_leader() if
it needs to.


Kind regards,

-- 
Dr. Stefan Zegenhagen

arcutronix GmbH
Garbsener Landstr. 10
30419 Hannover
Germany

Tel:   +49 511 277-2734
Fax:   +49 511 277-2709
Email: stefan.zegenhagen@REDACTED
Web:   www.arcutronix.com

*Synchronize the Ethernet*

General Managers: Dipl. Ing. Juergen Schroeder, Dr. Josef Gfrerer -
Legal Form: GmbH, Registered office: Hannover, HRB 202442, Amtsgericht
Hannover; Ust-Id: DE257551767.

Please consider the environment before printing this message.




More information about the erlang-patches mailing list