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

Robert Raschke rtrlists@REDACTED
Tue Aug 19 15:57:09 CEST 2008


On Tue, Aug 19, 2008 at 2:33 PM, Colm Dougan <colm.dougan@REDACTED> wrote:
> 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

I think this is probably due to the shell having crashed in step 4.
The restarted shell (a new process) no longer knows about testtable. I
have been confused by crashed/restarted shells in the past. But I'm
not 100% sure that is what you're seeing. There's been threads about
this in the past.

Robby



More information about the erlang-questions mailing list