[erlang-bugs] R16B - io:rows(self()), io:nl(self()) and io:colums(self()) never return .

PAILLEAU Eric eric.pailleau@REDACTED
Tue Jun 4 20:09:30 CEST 2013


Hi Patrick,

> The parameter has to be an "IO device" (type device() in the doc)? As
> the documentation states: "Either standard_io, standard_error, a
> registered name, or a pid handling IO protocols" (which maybe should
> read "a pid of a process handling the IO protocol", but anyway :)). The
> IO protocol is described in stdlib users guide, chapter "The Erlang
> I/O-protocol".
> 
> You basically send a message to a process that never responds, and as
> IO-servers are not required to respond within a certain time frame, the
> io-module will wait indefinitely for an answer from the process. This is
> not a bug.

I don't totally agree with you, with below arguments :

- Is there any way to know that a PID is of type io_device ?
- io:xxxx(<Pid.not.existing>) returns {error,enotsup}
- io:xxxx(<Pid.not.iodevice>) returns {error,enotsup}
   (so why self() don't have same error ?)
- A function should return, even an error or a timeout.
- this could be a serious security breach. (<troll>will Erlang ever talk
about security ?</troll> :>) ...)

So, I don't really care if my patch is graduated or not, but for me
 this is not a normal behaviour for such functions.

Regards.




More information about the erlang-bugs mailing list