[erlang-questions] Possible bug after ets:insert exception

Primanathan Reddy [ MTN - Innovation Centre ] Reddy_P@REDACTED
Tue Aug 19 16:16:57 CEST 2008


Hi Colm

It is not a bug. You crashed the shell(Owner of the table) at 4>

See Below:

6> ets:tab2list(testtable).
[{foo,10}]
7> 
7> catch ets:insert(testtable, bar).
{'EXIT',{badarg,[{ets,insert,[testtable,bar]},
                 {erl_eval,do_apply,5},
                 {erl_eval,expr,5},
                 {shell,exprs,6},
                 {shell,eval_loop,3}]}}
8> 
8> ets:tab2list(testtable).         
[{foo,10}]
9> self().
<0.34.0>
10> ets:insert(testtable, bar).      

=ERROR REPORT==== 19-Aug-2008::16:13:15 ===
Error in process <0.34.0> with exit value:
{badarg,[{ets,insert,[testtable,bar]}
,{erl_eval,do_apply,5},{shell,exprs,6},{shell,eval_loop,3}]}

** exited: {badarg,[{ets,insert,[testtable,bar]},
                    {erl_eval,do_apply,5},
                    {shell,exprs,6},
                    {shell,eval_loop,3}]} **
11> self().                    
<0.42.0>
12>


Regards
Primanathan Reddy


-----Original Message-----
From: erlang-questions-bounces@REDACTED
[mailto:erlang-questions-bounces@REDACTED] On Behalf Of Colm Dougan
Sent: Tuesday, 19 August 2008 03:34 PM
To: erlang-questions@REDACTED
Subject: [erlang-questions] Possible bug after ets:insert exception

Hi,

I'm running 12B-3.  Below is a console session.  Everything worked as
expected until "4>" where I unintentionally provided an atom in my
insert and I get a bad arg.  Again that was expected.  What I didn't
expect, however, was that from then on the ets table seemed to be in a
bad state and couldn't be queried.  I realise this is an edge case.
Is this a bug?

Colm

Eshell V5.6.3  (abort with ^G)
1> ets:new(testtable,[set,named_table,private]).
testtable
2> ets:insert(testtable, [{foo, 10}]).
true
3> ets:tab2list(testtable).
[{foo,10}]
4> ets:insert(testtable, bar).
** exception error: bad argument
     in function  ets:insert/2
        called as ets:insert(testtable,bar)
5> ets:tab2list(testtable).
** exception error: bad argument
     in function  ets:match_object/2
        called as ets:match_object(testtable,'_')
     in call from ets:tab2list/1
_______________________________________________
erlang-questions mailing list
erlang-questions@REDACTED
http://www.erlang.org/mailman/listinfo/erlang-questions

NOTE: This e-mail message is subject to the MTN Group disclaimer see http://www.mtn.co.za/default.aspx?pid=34411 



More information about the erlang-questions mailing list