[erlang-bugs] io_lib format infinite loop

Richard Carlsson carlsson.richard@REDACTED
Tue May 20 14:50:56 CEST 2014


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-bugs/attachments/20140520/72d23795/attachment.htm>


More information about the erlang-bugs mailing list