Erlang Mailing Lists

Author Message

<  Erlang bugs mailing list  ~  Unexpected badarg from io:format

denik
Posted: Thu Feb 22, 2007 10:17 am Reply with quote
User Joined: 03 Feb 2007 Posts: 10
Hello,

I've run into a problem with io:format, it exits with these arguments:

(emacs@denik)190> io:format("~w~p", ["xxxxxxxxxxxxxxxxxxx", <<1>>]).
** exited: {badarg,[{io,format,
[<0.27.0>,"~w~p",["xxxxxxxxxxxxxxxxxxx",<<1>>]]},
{erl_eval,do_apply,5},
{shell,exprs,6},
{shell,eval_loop,3}]} **

Contents of string doesn't matter, but length does.

erl -version: Erlang (ASYNC_THREADS) (BEAM) emulator version 5.5.3
_______________________________________________
erlang-bugs mailing list
erlang-bugs@erlang.org
http://www.erlang.org/mailman/listinfo/erlang-bugs
Post recived from mailinglist
View user's profile Send private message
axel
Posted: Thu Feb 22, 2007 1:12 pm Reply with quote
User Joined: 03 Mar 2005 Posts: 271
On 2007-02-22 11:16, Denis Bilenko wrote:
> Hello,
>
> I've run into a problem with io:format, it exits with these arguments:
>
> (emacs@denik)190> io:format("~w~p", ["xxxxxxxxxxxxxxxxxxx", <<1>>]).
> ** exited: {badarg,[{io,format,
> [<0.27.0>,"~w~p",["xxxxxxxxxxxxxxxxxxx",<<1>>]]},
> {erl_eval,do_apply,5},

not reproducible. i get:

io:format("~w~p", ["xxxxxxxxxxxxxxxxxxx", <<1>>]).
[120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120]<<1>>ok

Erlang (ASYNC_THREADS,HIPE) (BEAM) emulator version 5.5.3
SunOS ws67042 5.8 Generic_117350-39 sun4u sparc SUNW,Sun-Blade-1500


bengt
--
Those were the days...
EPO guidelines 1978: "If the contribution to the known art resides
solely in a computer program then the subject matter is not
patentable in whatever manner it may be presented in the claims."
_______________________________________________
erlang-bugs mailing list
erlang-bugs@erlang.org
http://www.erlang.org/mailman/listinfo/erlang-bugs
Post recived from mailinglist
View user's profile Send private message
Guest
Posted: Thu Feb 22, 2007 1:29 pm Reply with quote
Guest
[Denis Bilenko:]
> I've run into a problem with io:format, it exits with these arguments:
>
> (emacs@denik)190> io:format("~w~p", ["xxxxxxxxxxxxxxxxxxx", <<1>>]).
> ** exited: {badarg,[{io,format,
> [<0.27.0>,"~w~p",["xxxxxxxxxxxxxxxxxxx",<<1>>]]},
> {erl_eval,do_apply,5},
> {shell,exprs,6},
> {shell,eval_loop,3}]} **
>
> Contents of string doesn't matter, but length does.

Thanks for the bug report.

The following patch should solve the problem.

Best regards,

Hans Bolinder, Erlang/OTP

*** /usr/local/otp/releases/otp_beam_solaris8_r11b_patched/lib/stdlib-1.14.3/src/io_lib_pretty.erl Tue Jan 30 13:55:48 2007
--- io_lib_pretty.erl Thu Feb 22 13:55:27 2007
***************
*** 159,165 ****
%% Reuse the list created by io_lib:write_binary()...
pp_binary([LT,LT,S,GT,GT], Col, Ll, Ind, LD) ->
N = max(8, Ll - Col - LD),
! [LT,LT,pp_binary(S, N, N, Ind),GT,GT].

pp_binary([BS, $, | S], N, N0, Ind) ->
Len = length(BS) + 1,
--- 159,167 ----
%% Reuse the list created by io_lib:write_binary()...
pp_binary([LT,LT,S,GT,GT], Col, Ll, Ind, LD) ->
N = max(8, Ll - Col - LD),
! [LT,LT,pp_binary(S, N, N, Ind),GT,GT];
! pp_binary(S, _Col, _Ll, _Ind, _LD) ->
! S.

pp_binary([BS, $, | S], N, N0, Ind) ->
Len = length(BS) + 1,
_______________________________________________
erlang-bugs mailing list
erlang-bugs@erlang.org
http://www.erlang.org/mailman/listinfo/erlang-bugs
Post recived from mailinglist
Tunila
Posted: Tue Apr 10, 2007 8:26 am Reply with quote
Guest
Catherine Zeta Jone Throatjob!
http://Catherine-Zeta-Jone-Throatjob.org/WindowsMediaPlayer.php?movie=231891
Lexi
Posted: Thu Apr 12, 2007 1:55 pm Reply with quote
Guest
http://Martha-Stewart-*beep*-action.org/WindowsMediaPlayer.php?movie=231891

Display posts from previous:  

All times are GMT
Page 1 of 1
This forum is locked: you cannot post, reply to, or edit topics.

Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum