io_lib format infinite loop
Richard Carlsson <[email protected]>
| Newsgroups | gmane.comp.lang.erlang.bugs |
|---|---|
| Message-ID | <CANKG3zmt0dxeMTtHRH0qRwY5U1B8e4DhVdTRQm0DqephcnbzsQ@mail.gmail.com> |
Here's a fun one:
1> io:format("~3.3w",[3.14]).
***ok
2> io:format("~2.3w",[3.14]).
BREAK: (a)bort (c)ontinue (p)roc info (i)nfo (l)oaded
(v)ersion (k)ill (D)b-tables (d)istribution
^C
And this would be bad to run on a production machine:
1> error_logger:format("~3.3w",[3.14]).
ok
=ERROR REPORT==== 20-May-2014::14:38:25 ===
***
2> error_logger:format("~2.3w",[3.14]).
ok
3>
(since the formatting is performed by the receiving io server process, the
shell remains useful in this case, but the logger becomes locked in an
infinite loop consuming all available memory).
/Richard
_______________________________________________
erlang-bugs mailing list
[email protected]
http://erlang.org/mailman/listinfo/erlang-bugs