Brilliant - worth a slide in a lecture<div><br></div><div>Here is code (dets) that is 1) battle tested 2) impossible to</div><div>prove correct 3) highly tested 4) believed reliable</div><div>but nevertheless buggy and you find the bug even though it has not been reported.</div>
<div><br></div><div>/Joe<br><br><div class="gmail_quote">On Mon, May 16, 2011 at 6:23 PM, John Hughes <span dir="ltr"><<a href="mailto:john.hughes@quviq.com">john.hughes@quviq.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div bgcolor="#ffffff">
<div><font size="2" face="Arial">QuickCheck found another error in dets. The
following test case shows how to provoke a bad object error by starting three
concurrent match_object traversals, at the same time as data is inserted into
the table.</font></div>
<div><font size="2" face="Arial"></font> </div>
<div><font size="2" face="Arial">test() -><br>
dets:close(dets_table),<br>
file:delete(dets_table), <br> {ok,dets_table} =
dets:open_file(dets_table,[{type,bag}]),<br> ok =
dets:insert(dets_table,[{0,0},{0,14},{1,0},{1,1},{39,0}]),
<br> {[{0,14}],Cont} =
dets:match_object(dets_table,{'$1',14},0),
<br> ok =
dets:insert(dets_table,{2,0}),
<br> {[{0,0},{0,14}],_} =
dets:match_object(dets_table,{0,'$2'},0),<br> ok =
dets:insert(dets_table,[{2,1},{39,1}]),
<br> {[{1,0}],_} =
dets:match_object(dets_table,{'$1',0},0),
<br> {error,{{bad_object,scan},"dets_table"}} =
dets:match_object(Cont).</font></div>
<div><font size="2" face="Arial"></font> </div>
<div><font size="2" face="Arial">This is 100% repeatable--and it seems to be a
minimal example.</font></div>
<div><font size="2" face="Arial"></font> </div><font color="#888888">
<div><font size="2" face="Arial">John</font></div></font></div>
<br>_______________________________________________<br>
erlang-bugs mailing list<br>
<a href="mailto:erlang-bugs@erlang.org">erlang-bugs@erlang.org</a><br>
<a href="http://erlang.org/mailman/listinfo/erlang-bugs" target="_blank">http://erlang.org/mailman/listinfo/erlang-bugs</a><br>
<br></blockquote></div><br></div>