Skip to content

Possible bugs involving CCBV.{set, diff, union} #370

Closed
@favonia

Description

@favonia

The program

let () =
  let v1 = CCBV.empty () in
  let () = CCBV.set v1 64 in
  let v2 = CCBV.diff (CCBV.empty ()) (CCBV.empty ()) in
  let v3 = CCBV.union v1 v2 in
  Format.printf "union (%a, %a)@.==>@.%a@." CCBV.pp v1 CCBV.pp v2 CCBV.pp v3

on at least one computer would output

union (bv {00000000000000000000000000000000000000000000000000000000000000001}, bv {})
==>
bv {00000000000000000000000000000000000000000000000000000000000000011}

Notice the two 1s at the end of the result of the union. There should only be one 1.

The bug was discovered in a relatively complicated program, and in the original context 64 can be replaced by a much smaller number (e.g., 5). However, 64 is the smallest number for the above standalone program to demonstrate the bug on my machine. By the way, I was using v3.4 but none of the later commits seemed to touch the CCBV module, and thus I believe the bug is still in the master branch.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions