[erlang-questions] repeatable dets:insert() error
Hans Bolinder
hans.bolinder@REDACTED
Thu Feb 7 13:30:02 CET 2008
[Daniel Goertzen:]
> dets:insert() unexpectedly fails upon inserting the 2,097,176th
> element in a stress test program.
Thanks for reporting this bug.
Patches for R11B-5 and R12B-1 attached below.
Best regards,
Hans Bolinder, Erlang/OTP team
*** /usr/local/otp/releases/otp_beam_solaris8_r11b_patched/lib/stdlib-1.14.5.5/src/dets_v9.erl Wed Jan 23 12:06:42 2008
--- dets_v9.erl Thu Feb 7 13:21:06 2008
***************
*** 1911,1916 ****
--- 1911,1918 ----
{Head, ok};
grow(Head, Extra, undefined) ->
grow(Head, Extra, seg_zero());
+ grow(Head, _Extra, _SegZero) when Head#head.next >= Head#head.max_no_slots ->
+ {Head, ok};
grow(Head, Extra, SegZero) ->
#head{n = N, next = Next, m = M} = Head,
SegNum = Next div ?SEGSZP,
*** /usr/local/otp/releases/otp_beam_solaris8_r12b_patched/lib/stdlib-1.15.1/src/dets_v9.erl Wed Feb 6 09:28:51 2008
--- dets_v9.erl Thu Feb 7 13:23:23 2008
***************
*** 1934,1939 ****
--- 1934,1941 ----
{Head, ok};
grow(Head, Extra, undefined) ->
grow(Head, Extra, seg_zero());
+ grow(Head, _Extra, _SegZero) when Head#head.next >= Head#head.max_no_slots ->
+ {Head, ok};
grow(Head, Extra, SegZero) ->
#head{n = N, next = Next, m = M} = Head,
SegNum = Next div ?SEGSZP,
More information about the erlang-questions
mailing list