You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Original reporter: dotsimon.
Affected version: OTP-21.0
Fixed in versions: OTP-20.3.8.5, OTP-21.0.5, OTP-19.3.6.10
Component: erts
Migrated from: https://bugs.erlang.org/browse/ERL-690
#Ref ordering is broken in all versions since at least R13B03 (the earliest in github). It does work in R12B03.
The comparison takes the difference of two Uint32 and casts it to Sint32 which is the wrong thing to do. For example, 2200000000 - 1 is positive, but sadly (Sint32)(22000000000-1) is negative.
The scary thing here is that it can make terms "invisible" in ets or Mnesia ram_copies or disc_copies tables.
I will submit a PR with test cases and a fix for this today.
{{ W2s = [610350147,899574699,2994196869,686384822,2397690439, 923302211],
ExtRefBase = <<131,114,0,3,100,0,3,110,64,98,3>>,
ExtRefs = [<<ExtRefBase/binary, 1:32, W2:32, 0:32>> || W2 <- W2s],
Refs = [binary_to_term(Bin) || Bin <- ExtRefs],
Ets = ets:new(refbug, [ordered_set]),
ets:insert(Ets, [{Ref,Ref} || Ref <- Refs]),
0 = length([R || R<-ets:tab2list(Ets), ets:lookup(Ets, element(1,R)) == []]),
ok.
}}
The text was updated successfully, but these errors were encountered:
The double-brace notation only works on a single line (I think). For a block you can use {{{noformat\}}} or {{{code\}}}.
https://jira.atlassian.com/secure/WikiRendererHelpAction.jspa?section=all
{code:erlang}
W2s = [610350147,899574699,2994196869,686384822,2397690439, 923302211],
ExtRefBase = <<131,114,0,3,100,0,3,110,64,98,3>>,
ExtRefs = [<<ExtRefBase/binary, 1:32, W2:32, 0:32>> || W2 <- W2s],
Refs = [binary_to_term(Bin) || Bin <- ExtRefs],
Ets = ets:new(refbug, [ordered_set]),
ets:insert(Ets, [{Ref,Ref} || Ref <- Refs]),
0 = length([R || R <- ets:tab2list(Ets), ets:lookup(Ets, element(1,R)) == []]),
ok.
{code}
Original reporter:
dotsimon.
Affected version:
OTP-21.0
Fixed in versions:
OTP-20.3.8.5
,OTP-21.0.5
,OTP-19.3.6.10
Component:
erts
Migrated from: https://bugs.erlang.org/browse/ERL-690
The text was updated successfully, but these errors were encountered: