dets:insert() unexpectedly fails upon inserting the 2,097,176th element in a stress test program. It happens on Windows with R11B, and linux with R12B. It only seems to happen when inserting the term {N,{entry,N}}; the term {N,{entry,another_entry,N} got past the 2.1M mark without error. Anybody know what's going on here?<br>
<br><br>Consider this dets stress tester:<br><br>go(make_dets) -><br> {ok,Mydets}=dets:open_file(mydets,[]),<br> write_dets(Mydets),<br> dets:close(Mydets).<br><br>write_dets(Tab) -><br> write_dets(Tab,0).<br>
<br>write_dets(Tab,N) -><br> case N rem 10000 of<br> 0 -> io:format("inserting ~p~n",[N]);<br> _ -> ok<br> end, <br> ok=dets:insert(Tab,{N,{entry,N}}),<br> write_dets(Tab,N+1).<br>
<br><br><br>With R11B on Windows I get:<br><br>...<br>inserting 2070000<br>inserting 2080000<br>inserting 2090000<br><br>=ERROR REPORT==== 5-Feb-2008::09:54:40 ===<br>Error in process <0.30.0> with exit value: {badarg,[{dets,insert,[mydets,{209717<br>
5,{entry,2097175}}]},{disk_log_test,write_dets,2},{disk_log_test,go,1},{erl_eval<br>,do_apply,5},{shell,exprs,6},{shell,eval_loop,3}]}<br><br>** exited: {badarg,[{dets,insert,[mydets,{2097175,{entry,2097175}}]},<br> {disk_log_test,write_dets,2},<br>
{disk_log_test,go,1},<br> {erl_eval,do_apply,5},<br> {shell,exprs,6},<br> {shell,eval_loop,3}]} **<br><br><br><br>...and on R12B on gentoo linux (amd64) I get:<br>
<br><br>inserting 2070000<br>inserting 2080000<br>inserting 2090000<br>** exception error: bad argument<br> in function dets:insert/2<br> called as dets:insert(mydets,{2097175,{entry,2097175}})<br> in call from disk_log_test:write_dets/2<br>
in call from disk_log_test:go/1<br><br><br>Thanks,<br>Dan.<br><br>