From 55f51df4b8f91081ae084fedf65c0ced53107668 Mon Sep 17 00:00:00 2001 From: Karoliine Holter Date: Thu, 28 Dec 2023 13:20:57 +0200 Subject: [PATCH 01/35] Add test for not repeating constants in intervals in warning outputs --- .../74-invalid_deref/08-memset-memcpy-array.t | 30 +++++++++++++++++++ tests/regression/74-invalid_deref/dune | 2 ++ 2 files changed, 32 insertions(+) create mode 100644 tests/regression/74-invalid_deref/08-memset-memcpy-array.t create mode 100644 tests/regression/74-invalid_deref/dune diff --git a/tests/regression/74-invalid_deref/08-memset-memcpy-array.t b/tests/regression/74-invalid_deref/08-memset-memcpy-array.t new file mode 100644 index 0000000000..a30a703a97 --- /dev/null +++ b/tests/regression/74-invalid_deref/08-memset-memcpy-array.t @@ -0,0 +1,30 @@ + $ goblint --set ana.activated[+] memOutOfBounds --enable ana.int.interval 08-memset-memcpy-array.c + Option warning: The memOutOfBounds analysis enables cil.addNestedScopeAttr. + [Warning][Behavior > Undefined > MemoryOutOfBoundsAccess][CWE-823] Size of (void *)b in function memset is 168 (in bytes) with an address offset of 0 (in bytes). Count is 169 (in bytes). Memory out-of-bounds access must occur (08-memset-memcpy-array.c:14:5-14:22) + [Warning][Behavior > Undefined > MemoryOutOfBoundsAccess][CWE-823] Size of (void *)b in function memset is 168 (in bytes) with an address offset of 0 (in bytes). Count is 169 (in bytes). Memory out-of-bounds access must occur (08-memset-memcpy-array.c:15:5-15:34) + [Warning][Behavior > Undefined > MemoryOutOfBoundsAccess][CWE-823] Size of (void const * __restrict )c in function memcpy is 168 (in bytes) with an address offset of 0 (in bytes). Count is 169 (in bytes). Memory out-of-bounds access must occur (08-memset-memcpy-array.c:20:5-20:22) + [Warning][Behavior > Undefined > MemoryOutOfBoundsAccess][CWE-823] Size of (void * __restrict )b in function memcpy is 168 (in bytes) with an address offset of 0 (in bytes). Count is 169 (in bytes). Memory out-of-bounds access must occur (08-memset-memcpy-array.c:20:5-20:22) + [Warning][Behavior > Undefined > MemoryOutOfBoundsAccess][CWE-823] Size of (void const * __restrict )c in function memcpy is 168 (in bytes) with an address offset of 0 (in bytes). Count is 169 (in bytes). Memory out-of-bounds access must occur (08-memset-memcpy-array.c:21:5-21:34) + [Warning][Behavior > Undefined > MemoryOutOfBoundsAccess][CWE-823] Size of (void * __restrict )b in function memcpy is 168 (in bytes) with an address offset of 0 (in bytes). Count is 169 (in bytes). Memory out-of-bounds access must occur (08-memset-memcpy-array.c:21:5-21:34) + [Warning][Unknown] Pointer argv has a points-to-set of top. An invalid memory access might occur (08-memset-memcpy-array.c:25:9-25:20) + [Warning][Unknown] Size of lval dereference expression argv is top. Out-of-bounds memory access may occur (08-memset-memcpy-array.c:25:9-25:20) + [Warning][Behavior > Undefined > Other] Pointer argv contains an unknown address. Invalid dereference may occur (08-memset-memcpy-array.c:25:9-25:20) + [Warning][Behavior > Undefined > MemoryOutOfBoundsAccess][CWE-823] Size of pointer argv is top. Memory out-of-bounds access might occur due to pointer arithmetic (08-memset-memcpy-array.c:25:9-25:20) + [Warning][Behavior > Undefined > MemoryOutOfBoundsAccess][CWE-823] Size of (void *)b in function memset is 4 (in bytes) with an address offset of 0 (in bytes). Count is 168 (in bytes). Memory out-of-bounds access must occur (08-memset-memcpy-array.c:27:9-27:26) + [Warning][Behavior > Undefined > MemoryOutOfBoundsAccess][CWE-823] Size of (void * __restrict )b in function memcpy is 4 (in bytes) with an address offset of 0 (in bytes). Count is 168 (in bytes). Memory out-of-bounds access must occur (08-memset-memcpy-array.c:28:9-28:26) + [Warning][Unknown] Pointer argv + 5 has a points-to-set of top. An invalid memory access might occur (08-memset-memcpy-array.c:29:16-29:27) + [Warning][Unknown] Size of lval dereference expression argv + 5 is top. Out-of-bounds memory access may occur (08-memset-memcpy-array.c:29:16-29:27) + [Warning][Behavior > Undefined > Other] Pointer argv contains an unknown address. Invalid dereference may occur (08-memset-memcpy-array.c:29:16-29:27) + [Warning][Unknown] Pointer argv has a points-to-set of top. An invalid memory access might occur (08-memset-memcpy-array.c:29:16-29:27) + [Warning][Integer > Overflow][CWE-190] Signed integer overflow (08-memset-memcpy-array.c:29:16-29:27) + [Warning][Behavior > Undefined > MemoryOutOfBoundsAccess][CWE-823] Size of pointer argv in expression argv + 5 is top. Memory out-of-bounds access might occur (08-memset-memcpy-array.c:29:16-29:27) + [Warning][Behavior > Undefined > MemoryOutOfBoundsAccess][CWE-823] Size of (void *)b in function memset is 4 (in bytes) with an address offset of 0 (in bytes). Count is 168 (in bytes). Memory out-of-bounds access must occur (08-memset-memcpy-array.c:32:9-32:26) + [Warning][Behavior > Undefined > MemoryOutOfBoundsAccess][CWE-823] Size of (void * __restrict )b in function memcpy is 4 (in bytes) with an address offset of 0 (in bytes). Count is 168 (in bytes). Memory out-of-bounds access must occur (08-memset-memcpy-array.c:33:9-33:26) + [Warning][Behavior > Undefined > MemoryOutOfBoundsAccess][CWE-823] Could not compare size of dest ((Not {0}([0,8]),[4,168]) with address offset (0) count (168) in function memset. Memory out-of-bounds access may occur (08-memset-memcpy-array.c:36:5-36:30) + [Warning][Behavior > Undefined > MemoryOutOfBoundsAccess][CWE-823] Could not compare size of dest ((Not {0}([0,8]),[4,168]) with address offset (0) count (168) in function memcpy. Memory out-of-bounds access may occur (08-memset-memcpy-array.c:37:5-37:30) + [Warning][Behavior > Undefined > MemoryOutOfBoundsAccess][CWE-823] Could not compare size of dest ((Not {0}([0,8]),[4,168]) with address offset (0) count (5) in function memset. Memory out-of-bounds access may occur (08-memset-memcpy-array.c:40:5-40:34) + [Warning][Behavior > Undefined > MemoryOutOfBoundsAccess][CWE-823] Could not compare size of dest ((Not {0}([0,8]),[4,168]) with address offset (0) count (5) in function memcpy. Memory out-of-bounds access may occur (08-memset-memcpy-array.c:41:5-41:34) + [Info][Deadcode] Logical lines of code (LLoC) summary: + live: 27 + dead: 0 + total lines: 27 diff --git a/tests/regression/74-invalid_deref/dune b/tests/regression/74-invalid_deref/dune new file mode 100644 index 0000000000..23c0dd3290 --- /dev/null +++ b/tests/regression/74-invalid_deref/dune @@ -0,0 +1,2 @@ +(cram + (deps (glob_files *.c))) From 4d31efa73f0f1dfa6b664f8950fcdc7085f35626 Mon Sep 17 00:00:00 2001 From: Karoliine Holter Date: Thu, 28 Dec 2023 13:28:05 +0200 Subject: [PATCH 02/35] Move functions same and to_int upwards --- src/cdomains/intDomain.ml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/cdomains/intDomain.ml b/src/cdomains/intDomain.ml index 376dab71c2..f994f8676e 100644 --- a/src/cdomains/intDomain.ml +++ b/src/cdomains/intDomain.ml @@ -3590,6 +3590,13 @@ module IntDomTupleImpl = struct in mapp2 { fp2 = fun (type a) (module I:SOverflow with type t = a and type int_t = int_t) -> I.to_incl_list } x |> flat merge + let same show x = let xs = to_list_some x in let us = List.unique xs in let n = List.length us in + if n = 1 then Some (List.hd xs) + else ( + if n>1 then Messages.info ~category:Unsound "Inconsistent state! %a" (Pretty.docList ~sep:(Pretty.text ",") (Pretty.text % show)) us; (* do not want to abort *) + None + ) + let to_int = same BI.to_string % mapp2 { fp2 = fun (type a) (module I:SOverflow with type t = a and type int_t = int_t) -> I.to_int } let pretty () = (fun xs -> text "(" ++ (try List.reduce (fun a b -> a ++ text "," ++ b) xs with Invalid_argument _ -> nil) ++ text ")") % to_list % mapp { fp = fun (type a) (module I:SOverflow with type t = a) -> (* assert sf==I.short; *) I.pretty () } (* NOTE: the version above does something else. also, we ignore the sf-argument here. *) @@ -3688,13 +3695,6 @@ module IntDomTupleImpl = struct if List.mem `Eq xs then `Eq else if List.mem `Neq xs then `Neq else `Top - let same show x = let xs = to_list_some x in let us = List.unique xs in let n = List.length us in - if n = 1 then Some (List.hd xs) - else ( - if n>1 then Messages.info ~category:Unsound "Inconsistent state! %a" (Pretty.docList ~sep:(Pretty.text ",") (Pretty.text % show)) us; (* do not want to abort *) - None - ) - let to_int = same BI.to_string % mapp2 { fp2 = fun (type a) (module I:SOverflow with type t = a and type int_t = int_t) -> I.to_int } let to_bool = same string_of_bool % mapp { fp = fun (type a) (module I:SOverflow with type t = a) -> I.to_bool } let minimal = flat (List.max ~cmp:BI.compare) % mapp2 { fp2 = fun (type a) (module I:SOverflow with type t = a and type int_t = int_t) -> I.minimal } let maximal = flat (List.min ~cmp:BI.compare) % mapp2 { fp2 = fun (type a) (module I:SOverflow with type t = a and type int_t = int_t) -> I.maximal } From 3713f67179569f41aa8f868c52f66d12197f81ad Mon Sep 17 00:00:00 2001 From: Karoliine Holter Date: Thu, 28 Dec 2023 13:29:31 +0200 Subject: [PATCH 03/35] Do not repeat constants in intervals in warning outputs --- src/cdomains/intDomain.ml | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/cdomains/intDomain.ml b/src/cdomains/intDomain.ml index f994f8676e..9d8afd108e 100644 --- a/src/cdomains/intDomain.ml +++ b/src/cdomains/intDomain.ml @@ -3598,8 +3598,19 @@ module IntDomTupleImpl = struct ) let to_int = same BI.to_string % mapp2 { fp2 = fun (type a) (module I:SOverflow with type t = a and type int_t = int_t) -> I.to_int } - let pretty () = (fun xs -> text "(" ++ (try List.reduce (fun a b -> a ++ text "," ++ b) xs with Invalid_argument _ -> nil) ++ text ")") % to_list % mapp { fp = fun (type a) (module I:SOverflow with type t = a) -> (* assert sf==I.short; *) I.pretty () } (* NOTE: the version above does something else. also, we ignore the sf-argument here. *) - + let pretty () x = + match to_int x with + | Some v -> Pretty.text (BI.to_string v) + | None -> + mapp { fp = fun (type a) (module I:SOverflow with type t = a) -> (* assert sf==I.short; *) I.pretty () } x + |> to_list + |> (fun xs -> + text "(" ++ ( + try + List.reduce (fun a b -> a ++ text "," ++ b) xs + with Invalid_argument _ -> + nil) + ++ text ")") (* NOTE: the version above does something else. also, we ignore the sf-argument here. *) let refine_functions ik : (t -> t) list = let maybe reffun ik domtup dom = From 74a333a8864234c43c3553409a1628f44c3678bf Mon Sep 17 00:00:00 2001 From: Karoliine Holter Date: Thu, 28 Dec 2023 15:10:59 +0200 Subject: [PATCH 04/35] Fix missing parentheses in cram test --- .../regression/74-invalid_deref/08-memset-memcpy-array.t | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/regression/74-invalid_deref/08-memset-memcpy-array.t b/tests/regression/74-invalid_deref/08-memset-memcpy-array.t index a30a703a97..c776bfe3bd 100644 --- a/tests/regression/74-invalid_deref/08-memset-memcpy-array.t +++ b/tests/regression/74-invalid_deref/08-memset-memcpy-array.t @@ -20,10 +20,10 @@ [Warning][Behavior > Undefined > MemoryOutOfBoundsAccess][CWE-823] Size of pointer argv in expression argv + 5 is top. Memory out-of-bounds access might occur (08-memset-memcpy-array.c:29:16-29:27) [Warning][Behavior > Undefined > MemoryOutOfBoundsAccess][CWE-823] Size of (void *)b in function memset is 4 (in bytes) with an address offset of 0 (in bytes). Count is 168 (in bytes). Memory out-of-bounds access must occur (08-memset-memcpy-array.c:32:9-32:26) [Warning][Behavior > Undefined > MemoryOutOfBoundsAccess][CWE-823] Size of (void * __restrict )b in function memcpy is 4 (in bytes) with an address offset of 0 (in bytes). Count is 168 (in bytes). Memory out-of-bounds access must occur (08-memset-memcpy-array.c:33:9-33:26) - [Warning][Behavior > Undefined > MemoryOutOfBoundsAccess][CWE-823] Could not compare size of dest ((Not {0}([0,8]),[4,168]) with address offset (0) count (168) in function memset. Memory out-of-bounds access may occur (08-memset-memcpy-array.c:36:5-36:30) - [Warning][Behavior > Undefined > MemoryOutOfBoundsAccess][CWE-823] Could not compare size of dest ((Not {0}([0,8]),[4,168]) with address offset (0) count (168) in function memcpy. Memory out-of-bounds access may occur (08-memset-memcpy-array.c:37:5-37:30) - [Warning][Behavior > Undefined > MemoryOutOfBoundsAccess][CWE-823] Could not compare size of dest ((Not {0}([0,8]),[4,168]) with address offset (0) count (5) in function memset. Memory out-of-bounds access may occur (08-memset-memcpy-array.c:40:5-40:34) - [Warning][Behavior > Undefined > MemoryOutOfBoundsAccess][CWE-823] Could not compare size of dest ((Not {0}([0,8]),[4,168]) with address offset (0) count (5) in function memcpy. Memory out-of-bounds access may occur (08-memset-memcpy-array.c:41:5-41:34) + [Warning][Behavior > Undefined > MemoryOutOfBoundsAccess][CWE-823] Could not compare size of dest ((Not {0}([0,8]),[4,168])) with address offset (0) count (168) in function memset. Memory out-of-bounds access may occur (08-memset-memcpy-array.c:36:5-36:30) + [Warning][Behavior > Undefined > MemoryOutOfBoundsAccess][CWE-823] Could not compare size of dest ((Not {0}([0,8]),[4,168])) with address offset (0) count (168) in function memcpy. Memory out-of-bounds access may occur (08-memset-memcpy-array.c:37:5-37:30) + [Warning][Behavior > Undefined > MemoryOutOfBoundsAccess][CWE-823] Could not compare size of dest ((Not {0}([0,8]),[4,168])) with address offset (0) count (5) in function memset. Memory out-of-bounds access may occur (08-memset-memcpy-array.c:40:5-40:34) + [Warning][Behavior > Undefined > MemoryOutOfBoundsAccess][CWE-823] Could not compare size of dest ((Not {0}([0,8]),[4,168])) with address offset (0) count (5) in function memcpy. Memory out-of-bounds access may occur (08-memset-memcpy-array.c:41:5-41:34) [Info][Deadcode] Logical lines of code (LLoC) summary: live: 27 dead: 0 From b41967d68b7ecfeaa51dc9cf20827f6e11dfdb0f Mon Sep 17 00:00:00 2001 From: Karoliine Holter Date: Thu, 28 Dec 2023 15:43:18 +0200 Subject: [PATCH 05/35] Add --disable warn.info hack for MacOS CI build --- tests/regression/74-invalid_deref/08-memset-memcpy-array.t | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/tests/regression/74-invalid_deref/08-memset-memcpy-array.t b/tests/regression/74-invalid_deref/08-memset-memcpy-array.t index c776bfe3bd..3c1d475b44 100644 --- a/tests/regression/74-invalid_deref/08-memset-memcpy-array.t +++ b/tests/regression/74-invalid_deref/08-memset-memcpy-array.t @@ -1,4 +1,4 @@ - $ goblint --set ana.activated[+] memOutOfBounds --enable ana.int.interval 08-memset-memcpy-array.c + $ goblint --set ana.activated[+] memOutOfBounds --enable ana.int.interval --disable warn.info 08-memset-memcpy-array.c Option warning: The memOutOfBounds analysis enables cil.addNestedScopeAttr. [Warning][Behavior > Undefined > MemoryOutOfBoundsAccess][CWE-823] Size of (void *)b in function memset is 168 (in bytes) with an address offset of 0 (in bytes). Count is 169 (in bytes). Memory out-of-bounds access must occur (08-memset-memcpy-array.c:14:5-14:22) [Warning][Behavior > Undefined > MemoryOutOfBoundsAccess][CWE-823] Size of (void *)b in function memset is 168 (in bytes) with an address offset of 0 (in bytes). Count is 169 (in bytes). Memory out-of-bounds access must occur (08-memset-memcpy-array.c:15:5-15:34) @@ -24,7 +24,3 @@ [Warning][Behavior > Undefined > MemoryOutOfBoundsAccess][CWE-823] Could not compare size of dest ((Not {0}([0,8]),[4,168])) with address offset (0) count (168) in function memcpy. Memory out-of-bounds access may occur (08-memset-memcpy-array.c:37:5-37:30) [Warning][Behavior > Undefined > MemoryOutOfBoundsAccess][CWE-823] Could not compare size of dest ((Not {0}([0,8]),[4,168])) with address offset (0) count (5) in function memset. Memory out-of-bounds access may occur (08-memset-memcpy-array.c:40:5-40:34) [Warning][Behavior > Undefined > MemoryOutOfBoundsAccess][CWE-823] Could not compare size of dest ((Not {0}([0,8]),[4,168])) with address offset (0) count (5) in function memcpy. Memory out-of-bounds access may occur (08-memset-memcpy-array.c:41:5-41:34) - [Info][Deadcode] Logical lines of code (LLoC) summary: - live: 27 - dead: 0 - total lines: 27 From adafde1f65cc3472a26c3bd568daf2c1b5346bc2 Mon Sep 17 00:00:00 2001 From: Karoliine Holter Date: Tue, 2 Jan 2024 13:01:50 +0200 Subject: [PATCH 06/35] Remove initial cram test --- .../74-invalid_deref/08-memset-memcpy-array.t | 26 ------------------- 1 file changed, 26 deletions(-) delete mode 100644 tests/regression/74-invalid_deref/08-memset-memcpy-array.t diff --git a/tests/regression/74-invalid_deref/08-memset-memcpy-array.t b/tests/regression/74-invalid_deref/08-memset-memcpy-array.t deleted file mode 100644 index 3c1d475b44..0000000000 --- a/tests/regression/74-invalid_deref/08-memset-memcpy-array.t +++ /dev/null @@ -1,26 +0,0 @@ - $ goblint --set ana.activated[+] memOutOfBounds --enable ana.int.interval --disable warn.info 08-memset-memcpy-array.c - Option warning: The memOutOfBounds analysis enables cil.addNestedScopeAttr. - [Warning][Behavior > Undefined > MemoryOutOfBoundsAccess][CWE-823] Size of (void *)b in function memset is 168 (in bytes) with an address offset of 0 (in bytes). Count is 169 (in bytes). Memory out-of-bounds access must occur (08-memset-memcpy-array.c:14:5-14:22) - [Warning][Behavior > Undefined > MemoryOutOfBoundsAccess][CWE-823] Size of (void *)b in function memset is 168 (in bytes) with an address offset of 0 (in bytes). Count is 169 (in bytes). Memory out-of-bounds access must occur (08-memset-memcpy-array.c:15:5-15:34) - [Warning][Behavior > Undefined > MemoryOutOfBoundsAccess][CWE-823] Size of (void const * __restrict )c in function memcpy is 168 (in bytes) with an address offset of 0 (in bytes). Count is 169 (in bytes). Memory out-of-bounds access must occur (08-memset-memcpy-array.c:20:5-20:22) - [Warning][Behavior > Undefined > MemoryOutOfBoundsAccess][CWE-823] Size of (void * __restrict )b in function memcpy is 168 (in bytes) with an address offset of 0 (in bytes). Count is 169 (in bytes). Memory out-of-bounds access must occur (08-memset-memcpy-array.c:20:5-20:22) - [Warning][Behavior > Undefined > MemoryOutOfBoundsAccess][CWE-823] Size of (void const * __restrict )c in function memcpy is 168 (in bytes) with an address offset of 0 (in bytes). Count is 169 (in bytes). Memory out-of-bounds access must occur (08-memset-memcpy-array.c:21:5-21:34) - [Warning][Behavior > Undefined > MemoryOutOfBoundsAccess][CWE-823] Size of (void * __restrict )b in function memcpy is 168 (in bytes) with an address offset of 0 (in bytes). Count is 169 (in bytes). Memory out-of-bounds access must occur (08-memset-memcpy-array.c:21:5-21:34) - [Warning][Unknown] Pointer argv has a points-to-set of top. An invalid memory access might occur (08-memset-memcpy-array.c:25:9-25:20) - [Warning][Unknown] Size of lval dereference expression argv is top. Out-of-bounds memory access may occur (08-memset-memcpy-array.c:25:9-25:20) - [Warning][Behavior > Undefined > Other] Pointer argv contains an unknown address. Invalid dereference may occur (08-memset-memcpy-array.c:25:9-25:20) - [Warning][Behavior > Undefined > MemoryOutOfBoundsAccess][CWE-823] Size of pointer argv is top. Memory out-of-bounds access might occur due to pointer arithmetic (08-memset-memcpy-array.c:25:9-25:20) - [Warning][Behavior > Undefined > MemoryOutOfBoundsAccess][CWE-823] Size of (void *)b in function memset is 4 (in bytes) with an address offset of 0 (in bytes). Count is 168 (in bytes). Memory out-of-bounds access must occur (08-memset-memcpy-array.c:27:9-27:26) - [Warning][Behavior > Undefined > MemoryOutOfBoundsAccess][CWE-823] Size of (void * __restrict )b in function memcpy is 4 (in bytes) with an address offset of 0 (in bytes). Count is 168 (in bytes). Memory out-of-bounds access must occur (08-memset-memcpy-array.c:28:9-28:26) - [Warning][Unknown] Pointer argv + 5 has a points-to-set of top. An invalid memory access might occur (08-memset-memcpy-array.c:29:16-29:27) - [Warning][Unknown] Size of lval dereference expression argv + 5 is top. Out-of-bounds memory access may occur (08-memset-memcpy-array.c:29:16-29:27) - [Warning][Behavior > Undefined > Other] Pointer argv contains an unknown address. Invalid dereference may occur (08-memset-memcpy-array.c:29:16-29:27) - [Warning][Unknown] Pointer argv has a points-to-set of top. An invalid memory access might occur (08-memset-memcpy-array.c:29:16-29:27) - [Warning][Integer > Overflow][CWE-190] Signed integer overflow (08-memset-memcpy-array.c:29:16-29:27) - [Warning][Behavior > Undefined > MemoryOutOfBoundsAccess][CWE-823] Size of pointer argv in expression argv + 5 is top. Memory out-of-bounds access might occur (08-memset-memcpy-array.c:29:16-29:27) - [Warning][Behavior > Undefined > MemoryOutOfBoundsAccess][CWE-823] Size of (void *)b in function memset is 4 (in bytes) with an address offset of 0 (in bytes). Count is 168 (in bytes). Memory out-of-bounds access must occur (08-memset-memcpy-array.c:32:9-32:26) - [Warning][Behavior > Undefined > MemoryOutOfBoundsAccess][CWE-823] Size of (void * __restrict )b in function memcpy is 4 (in bytes) with an address offset of 0 (in bytes). Count is 168 (in bytes). Memory out-of-bounds access must occur (08-memset-memcpy-array.c:33:9-33:26) - [Warning][Behavior > Undefined > MemoryOutOfBoundsAccess][CWE-823] Could not compare size of dest ((Not {0}([0,8]),[4,168])) with address offset (0) count (168) in function memset. Memory out-of-bounds access may occur (08-memset-memcpy-array.c:36:5-36:30) - [Warning][Behavior > Undefined > MemoryOutOfBoundsAccess][CWE-823] Could not compare size of dest ((Not {0}([0,8]),[4,168])) with address offset (0) count (168) in function memcpy. Memory out-of-bounds access may occur (08-memset-memcpy-array.c:37:5-37:30) - [Warning][Behavior > Undefined > MemoryOutOfBoundsAccess][CWE-823] Could not compare size of dest ((Not {0}([0,8]),[4,168])) with address offset (0) count (5) in function memset. Memory out-of-bounds access may occur (08-memset-memcpy-array.c:40:5-40:34) - [Warning][Behavior > Undefined > MemoryOutOfBoundsAccess][CWE-823] Could not compare size of dest ((Not {0}([0,8]),[4,168])) with address offset (0) count (5) in function memcpy. Memory out-of-bounds access may occur (08-memset-memcpy-array.c:41:5-41:34) From 45d818bbc39da05c0e89857783019de2aabacb06 Mon Sep 17 00:00:00 2001 From: Karoliine Holter Date: Tue, 2 Jan 2024 13:02:31 +0200 Subject: [PATCH 07/35] Modify regtest 01 74 to include unknown case --- tests/regression/74-invalid_deref/01-oob-heap-simple.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/regression/74-invalid_deref/01-oob-heap-simple.c b/tests/regression/74-invalid_deref/01-oob-heap-simple.c index 10c7864184..1137e86ec6 100644 --- a/tests/regression/74-invalid_deref/01-oob-heap-simple.c +++ b/tests/regression/74-invalid_deref/01-oob-heap-simple.c @@ -3,10 +3,12 @@ int main(int argc, char const *argv[]) { char *ptr = malloc(5 * sizeof(char)); + long r; *ptr = 'a';//NOWARN *(ptr + 1) = 'b';//NOWARN *(ptr + 10) = 'c';//WARN + *(ptr + r) = 'd';//WARN free(ptr); From 151bf5f076828a5ce2e72cf3821a5aed5e70f078 Mon Sep 17 00:00:00 2001 From: Karoliine Holter Date: Tue, 2 Jan 2024 13:07:38 +0200 Subject: [PATCH 08/35] Add cram test for 01-oob-heap-simple --- tests/regression/74-invalid_deref/01-oob-heap-simple.t | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 tests/regression/74-invalid_deref/01-oob-heap-simple.t diff --git a/tests/regression/74-invalid_deref/01-oob-heap-simple.t b/tests/regression/74-invalid_deref/01-oob-heap-simple.t new file mode 100644 index 0000000000..96989ad0ce --- /dev/null +++ b/tests/regression/74-invalid_deref/01-oob-heap-simple.t @@ -0,0 +1,8 @@ + $ goblint --set ana.activated[+] memOutOfBounds --enable ana.int.interval 01-oob-heap-simple.c + Option warning: The memOutOfBounds analysis enables cil.addNestedScopeAttr. + [Warning][Behavior > Undefined > MemoryOutOfBoundsAccess][CWE-823] Size of pointer in expression ptr + 10 is 5 (in bytes). It is offset by 10 (in bytes). Memory out-of-bounds access must occur (01-oob-heap-simple.c:10:5-10:22) + [Warning][Behavior > Undefined > MemoryOutOfBoundsAccess][CWE-823] Could not compare pointer size (5) with offset (⊤). Memory out-of-bounds access may occur (01-oob-heap-simple.c:11:5-11:21) + [Info][Deadcode] Logical lines of code (LLoC) summary: + live: 8 + dead: 0 + total lines: 8 From 68f5fba0e9afba568b1e5af88d071f4327fb9d9f Mon Sep 17 00:00:00 2001 From: Karoliine Holter Date: Tue, 2 Jan 2024 13:07:47 +0200 Subject: [PATCH 09/35] =?UTF-8?q?Prettify=20top=20intervals=20(Unknown=20i?= =?UTF-8?q?nt([-63,63]),[-9223372036854775808,9223372036854775807])=20?= =?UTF-8?q?=E2=86=92=20=E2=8A=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/cdomains/intDomain.ml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/cdomains/intDomain.ml b/src/cdomains/intDomain.ml index 9d8afd108e..8b798a2441 100644 --- a/src/cdomains/intDomain.ml +++ b/src/cdomains/intDomain.ml @@ -408,7 +408,11 @@ struct let narrow = lift2 I.narrow let show x = I.show x.v (* TODO add ikind to output *) - let pretty () x = I.pretty () x.v (* TODO add ikind to output *) + let pretty () x = + if I.is_top_of x.ikind x.v then + Pretty.text "⊤" + else + I.pretty () x.v (* TODO add ikind to output *) let pretty_diff () (x, y) = I.pretty_diff () (x.v, y.v) (* TODO check ikinds, add them to output *) let printXml o x = I.printXml o x.v (* TODO add ikind to output *) (* This is for debugging *) From 5b00197eb07f4454c52d138ea08f741868a4b109 Mon Sep 17 00:00:00 2001 From: Karoliine Holter Date: Tue, 2 Jan 2024 13:27:36 +0200 Subject: [PATCH 10/35] Add cram test for not printing malloc uniqueness counter when disabled --- tests/regression/45-escape/51-fresh-global.t | 13 +++++++++++++ tests/regression/45-escape/dune | 2 ++ 2 files changed, 15 insertions(+) create mode 100644 tests/regression/45-escape/51-fresh-global.t create mode 100644 tests/regression/45-escape/dune diff --git a/tests/regression/45-escape/51-fresh-global.t b/tests/regression/45-escape/51-fresh-global.t new file mode 100644 index 0000000000..233862a9b5 --- /dev/null +++ b/tests/regression/45-escape/51-fresh-global.t @@ -0,0 +1,13 @@ + $ goblint --set ana.activated[+] mallocFresh --set ana.activated[-] mhp --set ana.thread.domain plain 51-fresh-global.c + [Info][Deadcode] Logical lines of code (LLoC) summary: + live: 15 + dead: 0 + total lines: 15 + [Warning][Race] Memory location (alloc@sid:21@tid:main) (race with conf. 110): (51-fresh-global.c:25:7-25:31) + write with lock:{A} (conf. 110) (exp: & *i) (51-fresh-global.c:10:3-10:10) + write with thread:main (conf. 110) (exp: & *i) (51-fresh-global.c:27:3-27:9) + [Info][Race] Memory locations race summary: + safe: 1 + vulnerable: 0 + unsafe: 1 + total memory locations: 2 diff --git a/tests/regression/45-escape/dune b/tests/regression/45-escape/dune new file mode 100644 index 0000000000..23c0dd3290 --- /dev/null +++ b/tests/regression/45-escape/dune @@ -0,0 +1,2 @@ +(cram + (deps (glob_files *.c))) From 47e11eecdfce9afc8c4b33e2840467457b4a4935 Mon Sep 17 00:00:00 2001 From: Karoliine Holter Date: Tue, 2 Jan 2024 13:29:11 +0200 Subject: [PATCH 11/35] Do not print disabled malloc uniqueness counter --- src/analyses/wrapperFunctionAnalysis.ml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/analyses/wrapperFunctionAnalysis.ml b/src/analyses/wrapperFunctionAnalysis.ml index 2e068329ea..63f506fbb4 100644 --- a/src/analyses/wrapperFunctionAnalysis.ml +++ b/src/analyses/wrapperFunctionAnalysis.ml @@ -131,7 +131,10 @@ module MallocWrapper : MCPSpec = struct CilType.Location.show loc let name_varinfo (t, node, c) = - Format.asprintf "(alloc@sid:%s@tid:%s(#%s))" (Node.show_id node) (ThreadLifted.show t) (UniqueCount.show c) + if UniqueCount.is_top c then + Format.asprintf "(alloc@sid:%s@tid:%s)" (Node.show_id node) (ThreadLifted.show t) + else + Format.asprintf "(alloc@sid:%s@tid:%s(#%s))" (Node.show_id node) (ThreadLifted.show t) (UniqueCount.show c) end From 53f8cc254fe1e7c949c32451bc43397f88407d25 Mon Sep 17 00:00:00 2001 From: Karoliine Holter Date: Tue, 2 Jan 2024 13:50:44 +0200 Subject: [PATCH 12/35] Add cram test for 87-casts-dep-on-param.c --- tests/regression/02-base/87-casts-dep-on-param.t | 13 +++++++++++++ tests/regression/02-base/dune | 2 ++ 2 files changed, 15 insertions(+) create mode 100644 tests/regression/02-base/87-casts-dep-on-param.t create mode 100644 tests/regression/02-base/dune diff --git a/tests/regression/02-base/87-casts-dep-on-param.t b/tests/regression/02-base/87-casts-dep-on-param.t new file mode 100644 index 0000000000..461be05be5 --- /dev/null +++ b/tests/regression/02-base/87-casts-dep-on-param.t @@ -0,0 +1,13 @@ + $ goblint --set ana.activated "['base', 'mallocWrapper']" --set ana.ctx_insens[+] 'base' --set ana.ctx_insens[+] 'mallocWrapper' --set ana.base.privatization none --enable warn.debug 87-casts-dep-on-param.c + Option warning: Without thread escape analysis, every local variable whose address is taken is considered escaped, i.e., global! + [Info][Unsound] Unknown address in {&i} has escaped. (87-casts-dep-on-param.c:11:3-11:11) + [Info][Unsound] Unknown value in {?} could be an escaped pointer address! (87-casts-dep-on-param.c:11:3-11:11) + [Debug][Analyzer] Base EvalInt i query answering bot instead of {?, NULL, &(alloc@sid:22)} (87-casts-dep-on-param.c:13:7-13:15) + [Debug][Analyzer] Base EvalInt i query answering bot instead of {?, NULL, &(alloc@sid:22)} (87-casts-dep-on-param.c:14:3-14:11) + [Info][Unsound] Unknown address in {&p} has escaped. (87-casts-dep-on-param.c:17:7-17:19) + [Info][Unsound] Unknown address in {&i} has escaped. (87-casts-dep-on-param.c:17:7-17:19) + [Info][Unsound] Unknown value in {?} could be an escaped pointer address! (87-casts-dep-on-param.c:17:7-17:19) + [Info][Deadcode] Logical lines of code (LLoC) summary: + live: 15 + dead: 0 + total lines: 15 diff --git a/tests/regression/02-base/dune b/tests/regression/02-base/dune new file mode 100644 index 0000000000..23c0dd3290 --- /dev/null +++ b/tests/regression/02-base/dune @@ -0,0 +1,2 @@ +(cram + (deps (glob_files *.c))) From 5e1053975dfe9b1e297fc5b1b1a6d09b3b837eaf Mon Sep 17 00:00:00 2001 From: Karoliine Holter Date: Tue, 2 Jan 2024 13:51:12 +0200 Subject: [PATCH 13/35] Do not print top thread ID in warnings --- src/analyses/wrapperFunctionAnalysis.ml | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/src/analyses/wrapperFunctionAnalysis.ml b/src/analyses/wrapperFunctionAnalysis.ml index 63f506fbb4..6b8eee648e 100644 --- a/src/analyses/wrapperFunctionAnalysis.ml +++ b/src/analyses/wrapperFunctionAnalysis.ml @@ -131,11 +131,19 @@ module MallocWrapper : MCPSpec = struct CilType.Location.show loc let name_varinfo (t, node, c) = - if UniqueCount.is_top c then - Format.asprintf "(alloc@sid:%s@tid:%s)" (Node.show_id node) (ThreadLifted.show t) - else - Format.asprintf "(alloc@sid:%s@tid:%s(#%s))" (Node.show_id node) (ThreadLifted.show t) (UniqueCount.show c) - + let uniq_count = + if UniqueCount.is_top c then + Format.dprintf "" + else + Format.dprintf "(#%s)" (UniqueCount.show c) + in + let tid = + if ThreadLifted.is_top t then + Format.dprintf "" + else + Format.dprintf "@tid:%s%t" (ThreadLifted.show t) uniq_count + in + Format.asprintf "(alloc@sid:%s%t)" (Node.show_id node) tid end module NodeVarinfoMap = RichVarinfo.BiVarinfoMap.Make(ThreadNode) From df5a698a7514dcb9e4eeb47e428cec79495f0177 Mon Sep 17 00:00:00 2001 From: Karoliine Holter Date: Tue, 2 Jan 2024 14:12:00 +0200 Subject: [PATCH 14/35] Add cram test for 14-list_entry_rc.c --- tests/regression/06-symbeq/14-list_entry_rc.t | 1 + 1 file changed, 1 insertion(+) create mode 100644 tests/regression/06-symbeq/14-list_entry_rc.t diff --git a/tests/regression/06-symbeq/14-list_entry_rc.t b/tests/regression/06-symbeq/14-list_entry_rc.t new file mode 100644 index 0000000000..8982c01c7f --- /dev/null +++ b/tests/regression/06-symbeq/14-list_entry_rc.t @@ -0,0 +1 @@ + $ goblint --enable ana.race.direct-arithmetic --set ana.activated[+] "'var_eq'" --set ana.activated[+] "'symb_locks'" 14-list_entry_rc.c From 19fe5fc22168a699ac7598b35148207d9d91d5a3 Mon Sep 17 00:00:00 2001 From: Karoliine Holter Date: Tue, 2 Jan 2024 14:13:06 +0200 Subject: [PATCH 15/35] Do not print def_exc domain name in case of constant --- src/cdomains/intDomain.ml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/cdomains/intDomain.ml b/src/cdomains/intDomain.ml index 8b798a2441..76074dd333 100644 --- a/src/cdomains/intDomain.ml +++ b/src/cdomains/intDomain.ml @@ -3714,7 +3714,12 @@ module IntDomTupleImpl = struct let minimal = flat (List.max ~cmp:BI.compare) % mapp2 { fp2 = fun (type a) (module I:SOverflow with type t = a and type int_t = int_t) -> I.minimal } let maximal = flat (List.min ~cmp:BI.compare) % mapp2 { fp2 = fun (type a) (module I:SOverflow with type t = a and type int_t = int_t) -> I.maximal } (* others *) - let show = String.concat "; " % to_list % mapp { fp = fun (type a) (module I:SOverflow with type t = a) x -> I.name () ^ ":" ^ (I.show x) } + let show x = + match to_int x with + | Some v -> BI.to_string v + | None -> mapp { fp = fun (type a) (module I:SOverflow with type t = a) x -> I.name () ^ ":" ^ (I.show x) } x + |> to_list + |> String.concat "; " let to_yojson = [%to_yojson: Yojson.Safe.t list] % to_list % mapp { fp = fun (type a) (module I:SOverflow with type t = a) x -> I.to_yojson x } let hash = List.fold_left (lxor) 0 % to_list % mapp { fp = fun (type a) (module I:SOverflow with type t = a) -> I.hash } From 1864fed7225a5db0762f400b2ad854c98ce8983b Mon Sep 17 00:00:00 2001 From: Karoliine Holter Date: Tue, 2 Jan 2024 14:15:51 +0200 Subject: [PATCH 16/35] Make IntDomLifter show similar to pretty --- src/cdomains/intDomain.ml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/cdomains/intDomain.ml b/src/cdomains/intDomain.ml index 76074dd333..492a0890e0 100644 --- a/src/cdomains/intDomain.ml +++ b/src/cdomains/intDomain.ml @@ -407,7 +407,11 @@ struct let widen = lift2 I.widen let narrow = lift2 I.narrow - let show x = I.show x.v (* TODO add ikind to output *) + let show x = + if I.is_top_of x.ikind x.v then + "⊤" + else + I.show x.v (* TODO add ikind to output *) let pretty () x = if I.is_top_of x.ikind x.v then Pretty.text "⊤" From 4a90a9746d6e7aff493f16b8312a1840e9c4ab8d Mon Sep 17 00:00:00 2001 From: Karoliine Holter Date: Tue, 2 Jan 2024 14:25:29 +0200 Subject: [PATCH 17/35] Promote cram test 14-list_entry_rc --- tests/regression/06-symbeq/14-list_entry_rc.t | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/tests/regression/06-symbeq/14-list_entry_rc.t b/tests/regression/06-symbeq/14-list_entry_rc.t index 8982c01c7f..cfdc54c94c 100644 --- a/tests/regression/06-symbeq/14-list_entry_rc.t +++ b/tests/regression/06-symbeq/14-list_entry_rc.t @@ -1 +1,17 @@ $ goblint --enable ana.race.direct-arithmetic --set ana.activated[+] "'var_eq'" --set ana.activated[+] "'symb_locks'" 14-list_entry_rc.c + [Info][Imprecise] Invalidating expressions: & mutexattr (14-list_entry_rc.c:37:3-37:37) + [Warning][Unknown] unlocking mutex ((alloc@sid:29@tid:[main])[1].mutex) which may not be held (14-list_entry_rc.c:28:3-28:34) + [Info][Deadcode] Logical lines of code (LLoC) summary: + live: 23 + dead: 0 + total lines: 23 + [Warning][Race] Memory location (alloc@sid:29@tid:[main])[?].datum (race with conf. 110): (14-list_entry_rc.c:41:3-41:35) + write with [mhp:{tid=[main, t_fun@14-list_entry_rc.c:45:3-45:40#top]}, thread:[main, t_fun@14-list_entry_rc.c:45:3-45:40#top]] (conf. 110) (exp: & s->datum) (14-list_entry_rc.c:27:3-27:13) + write with [mhp:{tid=[main]; created={[main, t_fun@14-list_entry_rc.c:45:3-45:40#top]}}, thread:[main]] (conf. 110) (exp: & s->datum) (14-list_entry_rc.c:27:3-27:13) + read with [mhp:{tid=[main, t_fun@14-list_entry_rc.c:45:3-45:40#top]}, thread:[main, t_fun@14-list_entry_rc.c:45:3-45:40#top]] (conf. 110) (exp: & s->datum) (14-list_entry_rc.c:27:3-27:13) + read with [mhp:{tid=[main]; created={[main, t_fun@14-list_entry_rc.c:45:3-45:40#top]}}, thread:[main]] (conf. 110) (exp: & s->datum) (14-list_entry_rc.c:27:3-27:13) + [Info][Race] Memory locations race summary: + safe: 1 + vulnerable: 0 + unsafe: 1 + total memory locations: 2 From cf8d5885d683d817d4eb63331d041a793363af00 Mon Sep 17 00:00:00 2001 From: Karoliine Holter Date: Wed, 3 Jan 2024 15:20:47 +0200 Subject: [PATCH 18/35] Modify cram tests to not repeat tid in mhp in warnings --- tests/regression/04-mutex/01-simple_rc.t | 8 ++++---- tests/regression/04-mutex/49-type-invariants.t | 12 ++++++------ tests/regression/04-mutex/77-type-nested-fields.t | 6 +++--- .../04-mutex/79-type-nested-fields-deep1.t | 6 +++--- .../04-mutex/80-type-nested-fields-deep2.t | 6 +++--- tests/regression/04-mutex/84-distribute-fields-1.t | 6 +++--- tests/regression/04-mutex/85-distribute-fields-2.t | 6 +++--- tests/regression/04-mutex/86-distribute-fields-3.t | 6 +++--- tests/regression/04-mutex/87-distribute-fields-4.t | 4 ++-- tests/regression/04-mutex/88-distribute-fields-5.t | 4 ++-- tests/regression/04-mutex/89-distribute-fields-6.t | 4 ++-- .../04-mutex/90-distribute-fields-type-1.t | 8 ++++---- .../04-mutex/91-distribute-fields-type-2.t | 8 ++++---- .../04-mutex/92-distribute-fields-type-deep.t | 8 ++++---- .../04-mutex/93-distribute-fields-type-global.t | 8 ++++---- tests/regression/06-symbeq/14-list_entry_rc.t | 8 ++++---- tests/regression/06-symbeq/16-type_rc.t | 6 +++--- tests/regression/06-symbeq/21-mult_accs_rc.t | 6 +++--- 18 files changed, 60 insertions(+), 60 deletions(-) diff --git a/tests/regression/04-mutex/01-simple_rc.t b/tests/regression/04-mutex/01-simple_rc.t index b61650c6d3..b5f09616a7 100644 --- a/tests/regression/04-mutex/01-simple_rc.t +++ b/tests/regression/04-mutex/01-simple_rc.t @@ -1,9 +1,9 @@ $ goblint --enable warn.deterministic 01-simple_rc.c [Warning][Race] Memory location myglobal (race with conf. 110): (01-simple_rc.c:4:5-4:13) - write with [mhp:{tid=[main, t_fun@01-simple_rc.c:17:3-17:40#top]}, lock:{mutex1}, thread:[main, t_fun@01-simple_rc.c:17:3-17:40#top]] (conf. 110) (exp: & myglobal) (01-simple_rc.c:10:3-10:22) - write with [mhp:{tid=[main]; created={[main, t_fun@01-simple_rc.c:17:3-17:40#top]}}, lock:{mutex2}, thread:[main]] (conf. 110) (exp: & myglobal) (01-simple_rc.c:19:3-19:22) - read with [mhp:{tid=[main, t_fun@01-simple_rc.c:17:3-17:40#top]}, lock:{mutex1}, thread:[main, t_fun@01-simple_rc.c:17:3-17:40#top]] (conf. 110) (exp: & myglobal) (01-simple_rc.c:10:3-10:22) - read with [mhp:{tid=[main]; created={[main, t_fun@01-simple_rc.c:17:3-17:40#top]}}, lock:{mutex2}, thread:[main]] (conf. 110) (exp: & myglobal) (01-simple_rc.c:19:3-19:22) + write with [lock:{mutex1}, thread:[main, t_fun@01-simple_rc.c:17:3-17:40#top]] (conf. 110) (exp: & myglobal) (01-simple_rc.c:10:3-10:22) + write with [mhp:{created={[main, t_fun@01-simple_rc.c:17:3-17:40#top]}}, lock:{mutex2}, thread:[main]] (conf. 110) (exp: & myglobal) (01-simple_rc.c:19:3-19:22) + read with [lock:{mutex1}, thread:[main, t_fun@01-simple_rc.c:17:3-17:40#top]] (conf. 110) (exp: & myglobal) (01-simple_rc.c:10:3-10:22) + read with [mhp:{created={[main, t_fun@01-simple_rc.c:17:3-17:40#top]}}, lock:{mutex2}, thread:[main]] (conf. 110) (exp: & myglobal) (01-simple_rc.c:19:3-19:22) [Info][Race] Memory locations race summary: safe: 0 vulnerable: 0 diff --git a/tests/regression/04-mutex/49-type-invariants.t b/tests/regression/04-mutex/49-type-invariants.t index b6c43d21bc..33db951684 100644 --- a/tests/regression/04-mutex/49-type-invariants.t +++ b/tests/regression/04-mutex/49-type-invariants.t @@ -1,15 +1,15 @@ $ goblint --enable warn.deterministic --enable ana.race.direct-arithmetic --enable allglobs 49-type-invariants.c [Warning][Behavior > Undefined > NullPointerDereference][CWE-476] May dereference NULL pointer (49-type-invariants.c:21:3-21:21) [Warning][Race] Memory location s.field (race with conf. 110): (49-type-invariants.c:8:10-8:11) - write with [mhp:{tid=[main]; created={[main, t_fun@49-type-invariants.c:20:3-20:40#top]}}, thread:[main]] (conf. 100) (exp: & tmp->field) (49-type-invariants.c:21:3-21:21) - read with [mhp:{tid=[main, t_fun@49-type-invariants.c:20:3-20:40#top]}, thread:[main, t_fun@49-type-invariants.c:20:3-20:40#top]] (conf. 110) (exp: & s.field) (49-type-invariants.c:11:3-11:23) + write with [mhp:{created={[main, t_fun@49-type-invariants.c:20:3-20:40#top]}}, thread:[main]] (conf. 100) (exp: & tmp->field) (49-type-invariants.c:21:3-21:21) + read with thread:[main, t_fun@49-type-invariants.c:20:3-20:40#top] (conf. 110) (exp: & s.field) (49-type-invariants.c:11:3-11:23) [Info][Race] Memory locations race summary: safe: 1 vulnerable: 0 unsafe: 1 total memory locations: 2 [Success][Race] Memory location (struct S).field (safe): - write with [mhp:{tid=[main]; created={[main, t_fun@49-type-invariants.c:20:3-20:40#top]}}, thread:[main]] (conf. 100) (exp: & tmp->field) (49-type-invariants.c:21:3-21:21) + write with [mhp:{created={[main, t_fun@49-type-invariants.c:20:3-20:40#top]}}, thread:[main]] (conf. 100) (exp: & tmp->field) (49-type-invariants.c:21:3-21:21) [Info][Deadcode] Logical lines of code (LLoC) summary: live: 7 dead: 0 @@ -24,15 +24,15 @@ $ goblint --enable warn.deterministic --disable ana.race.direct-arithmetic --enable allglobs 49-type-invariants.c [Warning][Behavior > Undefined > NullPointerDereference][CWE-476] May dereference NULL pointer (49-type-invariants.c:21:3-21:21) [Warning][Race] Memory location s.field (race with conf. 110): (49-type-invariants.c:8:10-8:11) - write with [mhp:{tid=[main]; created={[main, t_fun@49-type-invariants.c:20:3-20:40#top]}}, thread:[main]] (conf. 100) (exp: & tmp->field) (49-type-invariants.c:21:3-21:21) - read with [mhp:{tid=[main, t_fun@49-type-invariants.c:20:3-20:40#top]}, thread:[main, t_fun@49-type-invariants.c:20:3-20:40#top]] (conf. 110) (exp: & s.field) (49-type-invariants.c:11:3-11:23) + write with [mhp:{created={[main, t_fun@49-type-invariants.c:20:3-20:40#top]}}, thread:[main]] (conf. 100) (exp: & tmp->field) (49-type-invariants.c:21:3-21:21) + read with thread:[main, t_fun@49-type-invariants.c:20:3-20:40#top] (conf. 110) (exp: & s.field) (49-type-invariants.c:11:3-11:23) [Info][Race] Memory locations race summary: safe: 1 vulnerable: 0 unsafe: 1 total memory locations: 2 [Success][Race] Memory location (struct S).field (safe): - write with [mhp:{tid=[main]; created={[main, t_fun@49-type-invariants.c:20:3-20:40#top]}}, thread:[main]] (conf. 100) (exp: & tmp->field) (49-type-invariants.c:21:3-21:21) + write with [mhp:{created={[main, t_fun@49-type-invariants.c:20:3-20:40#top]}}, thread:[main]] (conf. 100) (exp: & tmp->field) (49-type-invariants.c:21:3-21:21) [Info][Deadcode] Logical lines of code (LLoC) summary: live: 7 dead: 0 diff --git a/tests/regression/04-mutex/77-type-nested-fields.t b/tests/regression/04-mutex/77-type-nested-fields.t index 0ecf051578..e2afc34125 100644 --- a/tests/regression/04-mutex/77-type-nested-fields.t +++ b/tests/regression/04-mutex/77-type-nested-fields.t @@ -2,15 +2,15 @@ [Warning][Behavior > Undefined > NullPointerDereference][CWE-476] May dereference NULL pointer (77-type-nested-fields.c:31:3-31:20) [Warning][Behavior > Undefined > NullPointerDereference][CWE-476] May dereference NULL pointer (77-type-nested-fields.c:38:3-38:22) [Warning][Race] Memory location (struct T).s.field (race with conf. 100): - write with [mhp:{tid=[main, t_fun@77-type-nested-fields.c:37:3-37:40#top]}, thread:[main, t_fun@77-type-nested-fields.c:37:3-37:40#top]] (conf. 100) (exp: & tmp->field) (77-type-nested-fields.c:31:3-31:20) - write with [mhp:{tid=[main]; created={[main, t_fun@77-type-nested-fields.c:37:3-37:40#top]}}, thread:[main]] (conf. 100) (exp: & tmp->s.field) (77-type-nested-fields.c:38:3-38:22) + write with thread:[main, t_fun@77-type-nested-fields.c:37:3-37:40#top] (conf. 100) (exp: & tmp->field) (77-type-nested-fields.c:31:3-31:20) + write with [mhp:{created={[main, t_fun@77-type-nested-fields.c:37:3-37:40#top]}}, thread:[main]] (conf. 100) (exp: & tmp->s.field) (77-type-nested-fields.c:38:3-38:22) [Info][Race] Memory locations race summary: safe: 1 vulnerable: 0 unsafe: 1 total memory locations: 2 [Success][Race] Memory location (struct S).field (safe): - write with [mhp:{tid=[main, t_fun@77-type-nested-fields.c:37:3-37:40#top]}, thread:[main, t_fun@77-type-nested-fields.c:37:3-37:40#top]] (conf. 100) (exp: & tmp->field) (77-type-nested-fields.c:31:3-31:20) + write with thread:[main, t_fun@77-type-nested-fields.c:37:3-37:40#top] (conf. 100) (exp: & tmp->field) (77-type-nested-fields.c:31:3-31:20) [Info][Deadcode] Logical lines of code (LLoC) summary: live: 7 dead: 0 diff --git a/tests/regression/04-mutex/79-type-nested-fields-deep1.t b/tests/regression/04-mutex/79-type-nested-fields-deep1.t index 611a70a7c3..9b6337a032 100644 --- a/tests/regression/04-mutex/79-type-nested-fields-deep1.t +++ b/tests/regression/04-mutex/79-type-nested-fields-deep1.t @@ -2,15 +2,15 @@ [Warning][Behavior > Undefined > NullPointerDereference][CWE-476] May dereference NULL pointer (79-type-nested-fields-deep1.c:36:3-36:20) [Warning][Behavior > Undefined > NullPointerDereference][CWE-476] May dereference NULL pointer (79-type-nested-fields-deep1.c:43:3-43:24) [Warning][Race] Memory location (struct U).t.s.field (race with conf. 100): - write with [mhp:{tid=[main, t_fun@79-type-nested-fields-deep1.c:42:3-42:40#top]}, thread:[main, t_fun@79-type-nested-fields-deep1.c:42:3-42:40#top]] (conf. 100) (exp: & tmp->field) (79-type-nested-fields-deep1.c:36:3-36:20) - write with [mhp:{tid=[main]; created={[main, t_fun@79-type-nested-fields-deep1.c:42:3-42:40#top]}}, thread:[main]] (conf. 100) (exp: & tmp->t.s.field) (79-type-nested-fields-deep1.c:43:3-43:24) + write with thread:[main, t_fun@79-type-nested-fields-deep1.c:42:3-42:40#top] (conf. 100) (exp: & tmp->field) (79-type-nested-fields-deep1.c:36:3-36:20) + write with [mhp:{created={[main, t_fun@79-type-nested-fields-deep1.c:42:3-42:40#top]}}, thread:[main]] (conf. 100) (exp: & tmp->t.s.field) (79-type-nested-fields-deep1.c:43:3-43:24) [Info][Race] Memory locations race summary: safe: 1 vulnerable: 0 unsafe: 1 total memory locations: 2 [Success][Race] Memory location (struct S).field (safe): - write with [mhp:{tid=[main, t_fun@79-type-nested-fields-deep1.c:42:3-42:40#top]}, thread:[main, t_fun@79-type-nested-fields-deep1.c:42:3-42:40#top]] (conf. 100) (exp: & tmp->field) (79-type-nested-fields-deep1.c:36:3-36:20) + write with thread:[main, t_fun@79-type-nested-fields-deep1.c:42:3-42:40#top] (conf. 100) (exp: & tmp->field) (79-type-nested-fields-deep1.c:36:3-36:20) [Info][Deadcode] Logical lines of code (LLoC) summary: live: 7 dead: 0 diff --git a/tests/regression/04-mutex/80-type-nested-fields-deep2.t b/tests/regression/04-mutex/80-type-nested-fields-deep2.t index 7ddbdc4fd7..1a191fa076 100644 --- a/tests/regression/04-mutex/80-type-nested-fields-deep2.t +++ b/tests/regression/04-mutex/80-type-nested-fields-deep2.t @@ -2,15 +2,15 @@ [Warning][Behavior > Undefined > NullPointerDereference][CWE-476] May dereference NULL pointer (80-type-nested-fields-deep2.c:36:3-36:22) [Warning][Behavior > Undefined > NullPointerDereference][CWE-476] May dereference NULL pointer (80-type-nested-fields-deep2.c:43:3-43:24) [Warning][Race] Memory location (struct U).t.s.field (race with conf. 100): - write with [mhp:{tid=[main, t_fun@80-type-nested-fields-deep2.c:42:3-42:40#top]}, thread:[main, t_fun@80-type-nested-fields-deep2.c:42:3-42:40#top]] (conf. 100) (exp: & tmp->s.field) (80-type-nested-fields-deep2.c:36:3-36:22) - write with [mhp:{tid=[main]; created={[main, t_fun@80-type-nested-fields-deep2.c:42:3-42:40#top]}}, thread:[main]] (conf. 100) (exp: & tmp->t.s.field) (80-type-nested-fields-deep2.c:43:3-43:24) + write with thread:[main, t_fun@80-type-nested-fields-deep2.c:42:3-42:40#top] (conf. 100) (exp: & tmp->s.field) (80-type-nested-fields-deep2.c:36:3-36:22) + write with [mhp:{created={[main, t_fun@80-type-nested-fields-deep2.c:42:3-42:40#top]}}, thread:[main]] (conf. 100) (exp: & tmp->t.s.field) (80-type-nested-fields-deep2.c:43:3-43:24) [Info][Race] Memory locations race summary: safe: 1 vulnerable: 0 unsafe: 1 total memory locations: 2 [Success][Race] Memory location (struct T).s.field (safe): - write with [mhp:{tid=[main, t_fun@80-type-nested-fields-deep2.c:42:3-42:40#top]}, thread:[main, t_fun@80-type-nested-fields-deep2.c:42:3-42:40#top]] (conf. 100) (exp: & tmp->s.field) (80-type-nested-fields-deep2.c:36:3-36:22) + write with thread:[main, t_fun@80-type-nested-fields-deep2.c:42:3-42:40#top] (conf. 100) (exp: & tmp->s.field) (80-type-nested-fields-deep2.c:36:3-36:22) [Info][Deadcode] Logical lines of code (LLoC) summary: live: 7 dead: 0 diff --git a/tests/regression/04-mutex/84-distribute-fields-1.t b/tests/regression/04-mutex/84-distribute-fields-1.t index 7c79572d88..708d676d1a 100644 --- a/tests/regression/04-mutex/84-distribute-fields-1.t +++ b/tests/regression/04-mutex/84-distribute-fields-1.t @@ -1,14 +1,14 @@ $ goblint --enable warn.deterministic --enable allglobs 84-distribute-fields-1.c [Warning][Race] Memory location s.data (race with conf. 110): (84-distribute-fields-1.c:9:10-9:11) - write with [mhp:{tid=[main, t_fun@84-distribute-fields-1.c:18:3-18:40#top]}, thread:[main, t_fun@84-distribute-fields-1.c:18:3-18:40#top]] (conf. 110) (exp: & s.data) (84-distribute-fields-1.c:12:3-12:13) - write with [mhp:{tid=[main]; created={[main, t_fun@84-distribute-fields-1.c:18:3-18:40#top]}}, thread:[main]] (conf. 110) (exp: & s) (84-distribute-fields-1.c:20:3-20:9) + write with thread:[main, t_fun@84-distribute-fields-1.c:18:3-18:40#top] (conf. 110) (exp: & s.data) (84-distribute-fields-1.c:12:3-12:13) + write with [mhp:{created={[main, t_fun@84-distribute-fields-1.c:18:3-18:40#top]}}, thread:[main]] (conf. 110) (exp: & s) (84-distribute-fields-1.c:20:3-20:9) [Info][Race] Memory locations race summary: safe: 1 vulnerable: 0 unsafe: 1 total memory locations: 2 [Success][Race] Memory location s (safe): (84-distribute-fields-1.c:9:10-9:11) - write with [mhp:{tid=[main]; created={[main, t_fun@84-distribute-fields-1.c:18:3-18:40#top]}}, thread:[main]] (conf. 110) (exp: & s) (84-distribute-fields-1.c:20:3-20:9) + write with [mhp:{created={[main, t_fun@84-distribute-fields-1.c:18:3-18:40#top]}}, thread:[main]] (conf. 110) (exp: & s) (84-distribute-fields-1.c:20:3-20:9) [Info][Deadcode] Logical lines of code (LLoC) summary: live: 8 dead: 0 diff --git a/tests/regression/04-mutex/85-distribute-fields-2.t b/tests/regression/04-mutex/85-distribute-fields-2.t index 303c10dccd..6bd8abc1cf 100644 --- a/tests/regression/04-mutex/85-distribute-fields-2.t +++ b/tests/regression/04-mutex/85-distribute-fields-2.t @@ -1,14 +1,14 @@ $ goblint --enable warn.deterministic --enable allglobs 85-distribute-fields-2.c [Warning][Race] Memory location t.s.data (race with conf. 110): (85-distribute-fields-2.c:15:10-15:11) - write with [mhp:{tid=[main, t_fun@85-distribute-fields-2.c:24:3-24:40#top]}, thread:[main, t_fun@85-distribute-fields-2.c:24:3-24:40#top]] (conf. 110) (exp: & t.s.data) (85-distribute-fields-2.c:18:3-18:15) - write with [mhp:{tid=[main]; created={[main, t_fun@85-distribute-fields-2.c:24:3-24:40#top]}}, thread:[main]] (conf. 110) (exp: & t.s) (85-distribute-fields-2.c:26:3-26:11) + write with thread:[main, t_fun@85-distribute-fields-2.c:24:3-24:40#top] (conf. 110) (exp: & t.s.data) (85-distribute-fields-2.c:18:3-18:15) + write with [mhp:{created={[main, t_fun@85-distribute-fields-2.c:24:3-24:40#top]}}, thread:[main]] (conf. 110) (exp: & t.s) (85-distribute-fields-2.c:26:3-26:11) [Info][Race] Memory locations race summary: safe: 1 vulnerable: 0 unsafe: 1 total memory locations: 2 [Success][Race] Memory location t.s (safe): (85-distribute-fields-2.c:15:10-15:11) - write with [mhp:{tid=[main]; created={[main, t_fun@85-distribute-fields-2.c:24:3-24:40#top]}}, thread:[main]] (conf. 110) (exp: & t.s) (85-distribute-fields-2.c:26:3-26:11) + write with [mhp:{created={[main, t_fun@85-distribute-fields-2.c:24:3-24:40#top]}}, thread:[main]] (conf. 110) (exp: & t.s) (85-distribute-fields-2.c:26:3-26:11) [Info][Deadcode] Logical lines of code (LLoC) summary: live: 8 dead: 0 diff --git a/tests/regression/04-mutex/86-distribute-fields-3.t b/tests/regression/04-mutex/86-distribute-fields-3.t index 084148392c..ea57fd2ba5 100644 --- a/tests/regression/04-mutex/86-distribute-fields-3.t +++ b/tests/regression/04-mutex/86-distribute-fields-3.t @@ -1,14 +1,14 @@ $ goblint --enable warn.deterministic --enable allglobs 86-distribute-fields-3.c [Warning][Race] Memory location t.s.data (race with conf. 110): (86-distribute-fields-3.c:15:10-15:11) - write with [mhp:{tid=[main, t_fun@86-distribute-fields-3.c:24:3-24:40#top]}, thread:[main, t_fun@86-distribute-fields-3.c:24:3-24:40#top]] (conf. 110) (exp: & t.s.data) (86-distribute-fields-3.c:18:3-18:15) - write with [mhp:{tid=[main]; created={[main, t_fun@86-distribute-fields-3.c:24:3-24:40#top]}}, thread:[main]] (conf. 110) (exp: & t) (86-distribute-fields-3.c:26:3-26:9) + write with thread:[main, t_fun@86-distribute-fields-3.c:24:3-24:40#top] (conf. 110) (exp: & t.s.data) (86-distribute-fields-3.c:18:3-18:15) + write with [mhp:{created={[main, t_fun@86-distribute-fields-3.c:24:3-24:40#top]}}, thread:[main]] (conf. 110) (exp: & t) (86-distribute-fields-3.c:26:3-26:9) [Info][Race] Memory locations race summary: safe: 1 vulnerable: 0 unsafe: 1 total memory locations: 2 [Success][Race] Memory location t (safe): (86-distribute-fields-3.c:15:10-15:11) - write with [mhp:{tid=[main]; created={[main, t_fun@86-distribute-fields-3.c:24:3-24:40#top]}}, thread:[main]] (conf. 110) (exp: & t) (86-distribute-fields-3.c:26:3-26:9) + write with [mhp:{created={[main, t_fun@86-distribute-fields-3.c:24:3-24:40#top]}}, thread:[main]] (conf. 110) (exp: & t) (86-distribute-fields-3.c:26:3-26:9) [Info][Deadcode] Logical lines of code (LLoC) summary: live: 8 dead: 0 diff --git a/tests/regression/04-mutex/87-distribute-fields-4.t b/tests/regression/04-mutex/87-distribute-fields-4.t index 5c26e80592..3c8ac025b0 100644 --- a/tests/regression/04-mutex/87-distribute-fields-4.t +++ b/tests/regression/04-mutex/87-distribute-fields-4.t @@ -1,7 +1,7 @@ $ goblint --enable warn.deterministic --enable allglobs 87-distribute-fields-4.c [Warning][Race] Memory location s (race with conf. 110): (87-distribute-fields-4.c:9:10-9:11) - write with [mhp:{tid=[main, t_fun@87-distribute-fields-4.c:19:3-19:40#top]}, thread:[main, t_fun@87-distribute-fields-4.c:19:3-19:40#top]] (conf. 110) (exp: & s) (87-distribute-fields-4.c:13:3-13:9) - write with [mhp:{tid=[main]; created={[main, t_fun@87-distribute-fields-4.c:19:3-19:40#top]}}, thread:[main]] (conf. 110) (exp: & s) (87-distribute-fields-4.c:21:3-21:9) + write with thread:[main, t_fun@87-distribute-fields-4.c:19:3-19:40#top] (conf. 110) (exp: & s) (87-distribute-fields-4.c:13:3-13:9) + write with [mhp:{created={[main, t_fun@87-distribute-fields-4.c:19:3-19:40#top]}}, thread:[main]] (conf. 110) (exp: & s) (87-distribute-fields-4.c:21:3-21:9) [Info][Race] Memory locations race summary: safe: 0 vulnerable: 0 diff --git a/tests/regression/04-mutex/88-distribute-fields-5.t b/tests/regression/04-mutex/88-distribute-fields-5.t index 8f0014e34c..1c32b2ac23 100644 --- a/tests/regression/04-mutex/88-distribute-fields-5.t +++ b/tests/regression/04-mutex/88-distribute-fields-5.t @@ -1,7 +1,7 @@ $ goblint --enable warn.deterministic --enable allglobs 88-distribute-fields-5.c [Warning][Race] Memory location t.s (race with conf. 110): (88-distribute-fields-5.c:15:10-15:11) - write with [mhp:{tid=[main, t_fun@88-distribute-fields-5.c:25:3-25:40#top]}, thread:[main, t_fun@88-distribute-fields-5.c:25:3-25:40#top]] (conf. 110) (exp: & t.s) (88-distribute-fields-5.c:19:3-19:11) - write with [mhp:{tid=[main]; created={[main, t_fun@88-distribute-fields-5.c:25:3-25:40#top]}}, thread:[main]] (conf. 110) (exp: & t.s) (88-distribute-fields-5.c:27:3-27:11) + write with thread:[main, t_fun@88-distribute-fields-5.c:25:3-25:40#top] (conf. 110) (exp: & t.s) (88-distribute-fields-5.c:19:3-19:11) + write with [mhp:{created={[main, t_fun@88-distribute-fields-5.c:25:3-25:40#top]}}, thread:[main]] (conf. 110) (exp: & t.s) (88-distribute-fields-5.c:27:3-27:11) [Info][Race] Memory locations race summary: safe: 0 vulnerable: 0 diff --git a/tests/regression/04-mutex/89-distribute-fields-6.t b/tests/regression/04-mutex/89-distribute-fields-6.t index aeb5050395..56996b4e26 100644 --- a/tests/regression/04-mutex/89-distribute-fields-6.t +++ b/tests/regression/04-mutex/89-distribute-fields-6.t @@ -1,7 +1,7 @@ $ goblint --enable warn.deterministic --enable allglobs 89-distribute-fields-6.c [Warning][Race] Memory location t (race with conf. 110): (89-distribute-fields-6.c:15:10-15:11) - write with [mhp:{tid=[main, t_fun@89-distribute-fields-6.c:25:3-25:40#top]}, thread:[main, t_fun@89-distribute-fields-6.c:25:3-25:40#top]] (conf. 110) (exp: & t) (89-distribute-fields-6.c:19:3-19:9) - write with [mhp:{tid=[main]; created={[main, t_fun@89-distribute-fields-6.c:25:3-25:40#top]}}, thread:[main]] (conf. 110) (exp: & t) (89-distribute-fields-6.c:27:3-27:9) + write with thread:[main, t_fun@89-distribute-fields-6.c:25:3-25:40#top] (conf. 110) (exp: & t) (89-distribute-fields-6.c:19:3-19:9) + write with [mhp:{created={[main, t_fun@89-distribute-fields-6.c:25:3-25:40#top]}}, thread:[main]] (conf. 110) (exp: & t) (89-distribute-fields-6.c:27:3-27:9) [Info][Race] Memory locations race summary: safe: 0 vulnerable: 0 diff --git a/tests/regression/04-mutex/90-distribute-fields-type-1.t b/tests/regression/04-mutex/90-distribute-fields-type-1.t index 587e943b36..b678e490f8 100644 --- a/tests/regression/04-mutex/90-distribute-fields-type-1.t +++ b/tests/regression/04-mutex/90-distribute-fields-type-1.t @@ -2,17 +2,17 @@ [Warning][Behavior > Undefined > NullPointerDereference][CWE-476] May dereference NULL pointer (90-distribute-fields-type-1.c:31:3-31:20) [Warning][Behavior > Undefined > NullPointerDereference][CWE-476] May dereference NULL pointer (90-distribute-fields-type-1.c:39:3-39:17) [Warning][Race] Memory location (struct T).s.field (race with conf. 100): - write with [mhp:{tid=[main, t_fun@90-distribute-fields-type-1.c:37:3-37:40#top]}, thread:[main, t_fun@90-distribute-fields-type-1.c:37:3-37:40#top]] (conf. 100) (exp: & tmp->field) (90-distribute-fields-type-1.c:31:3-31:20) - write with [mhp:{tid=[main]; created={[main, t_fun@90-distribute-fields-type-1.c:37:3-37:40#top]}}, thread:[main]] (conf. 100) (exp: & tmp->s) (90-distribute-fields-type-1.c:39:3-39:17) + write with thread:[main, t_fun@90-distribute-fields-type-1.c:37:3-37:40#top] (conf. 100) (exp: & tmp->field) (90-distribute-fields-type-1.c:31:3-31:20) + write with [mhp:{created={[main, t_fun@90-distribute-fields-type-1.c:37:3-37:40#top]}}, thread:[main]] (conf. 100) (exp: & tmp->s) (90-distribute-fields-type-1.c:39:3-39:17) [Info][Race] Memory locations race summary: safe: 2 vulnerable: 0 unsafe: 1 total memory locations: 3 [Success][Race] Memory location (struct S).field (safe): - write with [mhp:{tid=[main, t_fun@90-distribute-fields-type-1.c:37:3-37:40#top]}, thread:[main, t_fun@90-distribute-fields-type-1.c:37:3-37:40#top]] (conf. 100) (exp: & tmp->field) (90-distribute-fields-type-1.c:31:3-31:20) + write with thread:[main, t_fun@90-distribute-fields-type-1.c:37:3-37:40#top] (conf. 100) (exp: & tmp->field) (90-distribute-fields-type-1.c:31:3-31:20) [Success][Race] Memory location (struct T).s (safe): - write with [mhp:{tid=[main]; created={[main, t_fun@90-distribute-fields-type-1.c:37:3-37:40#top]}}, thread:[main]] (conf. 100) (exp: & tmp->s) (90-distribute-fields-type-1.c:39:3-39:17) + write with [mhp:{created={[main, t_fun@90-distribute-fields-type-1.c:37:3-37:40#top]}}, thread:[main]] (conf. 100) (exp: & tmp->s) (90-distribute-fields-type-1.c:39:3-39:17) [Info][Deadcode] Logical lines of code (LLoC) summary: live: 7 dead: 0 diff --git a/tests/regression/04-mutex/91-distribute-fields-type-2.t b/tests/regression/04-mutex/91-distribute-fields-type-2.t index afb01fdced..79ab8b4bc2 100644 --- a/tests/regression/04-mutex/91-distribute-fields-type-2.t +++ b/tests/regression/04-mutex/91-distribute-fields-type-2.t @@ -2,17 +2,17 @@ [Warning][Behavior > Undefined > NullPointerDereference][CWE-476] May dereference NULL pointer (91-distribute-fields-type-2.c:32:3-32:17) [Warning][Behavior > Undefined > NullPointerDereference][CWE-476] May dereference NULL pointer (91-distribute-fields-type-2.c:40:3-40:17) [Warning][Race] Memory location (struct T).s (race with conf. 100): - write with [mhp:{tid=[main, t_fun@91-distribute-fields-type-2.c:38:3-38:40#top]}, thread:[main, t_fun@91-distribute-fields-type-2.c:38:3-38:40#top]] (conf. 100) (exp: & *tmp) (91-distribute-fields-type-2.c:32:3-32:17) - write with [mhp:{tid=[main]; created={[main, t_fun@91-distribute-fields-type-2.c:38:3-38:40#top]}}, thread:[main]] (conf. 100) (exp: & *tmp) (91-distribute-fields-type-2.c:40:3-40:17) + write with thread:[main, t_fun@91-distribute-fields-type-2.c:38:3-38:40#top] (conf. 100) (exp: & *tmp) (91-distribute-fields-type-2.c:32:3-32:17) + write with [mhp:{created={[main, t_fun@91-distribute-fields-type-2.c:38:3-38:40#top]}}, thread:[main]] (conf. 100) (exp: & *tmp) (91-distribute-fields-type-2.c:40:3-40:17) [Info][Race] Memory locations race summary: safe: 2 vulnerable: 0 unsafe: 1 total memory locations: 3 [Success][Race] Memory location (struct S) (safe): - write with [mhp:{tid=[main, t_fun@91-distribute-fields-type-2.c:38:3-38:40#top]}, thread:[main, t_fun@91-distribute-fields-type-2.c:38:3-38:40#top]] (conf. 100) (exp: & *tmp) (91-distribute-fields-type-2.c:32:3-32:17) + write with thread:[main, t_fun@91-distribute-fields-type-2.c:38:3-38:40#top] (conf. 100) (exp: & *tmp) (91-distribute-fields-type-2.c:32:3-32:17) [Success][Race] Memory location (struct T) (safe): - write with [mhp:{tid=[main]; created={[main, t_fun@91-distribute-fields-type-2.c:38:3-38:40#top]}}, thread:[main]] (conf. 100) (exp: & *tmp) (91-distribute-fields-type-2.c:40:3-40:17) + write with [mhp:{created={[main, t_fun@91-distribute-fields-type-2.c:38:3-38:40#top]}}, thread:[main]] (conf. 100) (exp: & *tmp) (91-distribute-fields-type-2.c:40:3-40:17) [Info][Deadcode] Logical lines of code (LLoC) summary: live: 7 dead: 0 diff --git a/tests/regression/04-mutex/92-distribute-fields-type-deep.t b/tests/regression/04-mutex/92-distribute-fields-type-deep.t index 1748b245e2..913ba9bcc5 100644 --- a/tests/regression/04-mutex/92-distribute-fields-type-deep.t +++ b/tests/regression/04-mutex/92-distribute-fields-type-deep.t @@ -2,17 +2,17 @@ [Warning][Behavior > Undefined > NullPointerDereference][CWE-476] May dereference NULL pointer (92-distribute-fields-type-deep.c:36:3-36:20) [Warning][Behavior > Undefined > NullPointerDereference][CWE-476] May dereference NULL pointer (92-distribute-fields-type-deep.c:44:3-44:17) [Warning][Race] Memory location (struct U).t.s.field (race with conf. 100): - write with [mhp:{tid=[main, t_fun@92-distribute-fields-type-deep.c:42:3-42:40#top]}, thread:[main, t_fun@92-distribute-fields-type-deep.c:42:3-42:40#top]] (conf. 100) (exp: & tmp->field) (92-distribute-fields-type-deep.c:36:3-36:20) - write with [mhp:{tid=[main]; created={[main, t_fun@92-distribute-fields-type-deep.c:42:3-42:40#top]}}, thread:[main]] (conf. 100) (exp: & tmp->t) (92-distribute-fields-type-deep.c:44:3-44:17) + write with thread:[main, t_fun@92-distribute-fields-type-deep.c:42:3-42:40#top] (conf. 100) (exp: & tmp->field) (92-distribute-fields-type-deep.c:36:3-36:20) + write with [mhp:{created={[main, t_fun@92-distribute-fields-type-deep.c:42:3-42:40#top]}}, thread:[main]] (conf. 100) (exp: & tmp->t) (92-distribute-fields-type-deep.c:44:3-44:17) [Info][Race] Memory locations race summary: safe: 2 vulnerable: 0 unsafe: 1 total memory locations: 3 [Success][Race] Memory location (struct S).field (safe): - write with [mhp:{tid=[main, t_fun@92-distribute-fields-type-deep.c:42:3-42:40#top]}, thread:[main, t_fun@92-distribute-fields-type-deep.c:42:3-42:40#top]] (conf. 100) (exp: & tmp->field) (92-distribute-fields-type-deep.c:36:3-36:20) + write with thread:[main, t_fun@92-distribute-fields-type-deep.c:42:3-42:40#top] (conf. 100) (exp: & tmp->field) (92-distribute-fields-type-deep.c:36:3-36:20) [Success][Race] Memory location (struct U).t (safe): - write with [mhp:{tid=[main]; created={[main, t_fun@92-distribute-fields-type-deep.c:42:3-42:40#top]}}, thread:[main]] (conf. 100) (exp: & tmp->t) (92-distribute-fields-type-deep.c:44:3-44:17) + write with [mhp:{created={[main, t_fun@92-distribute-fields-type-deep.c:42:3-42:40#top]}}, thread:[main]] (conf. 100) (exp: & tmp->t) (92-distribute-fields-type-deep.c:44:3-44:17) [Info][Deadcode] Logical lines of code (LLoC) summary: live: 7 dead: 0 diff --git a/tests/regression/04-mutex/93-distribute-fields-type-global.t b/tests/regression/04-mutex/93-distribute-fields-type-global.t index 50c72aa289..3ec7b12e63 100644 --- a/tests/regression/04-mutex/93-distribute-fields-type-global.t +++ b/tests/regression/04-mutex/93-distribute-fields-type-global.t @@ -1,17 +1,17 @@ $ goblint --enable warn.deterministic --enable allglobs 93-distribute-fields-type-global.c [Warning][Behavior > Undefined > NullPointerDereference][CWE-476] May dereference NULL pointer (93-distribute-fields-type-global.c:13:3-13:29) [Warning][Race] Memory location s.field (race with conf. 110): (93-distribute-fields-type-global.c:8:10-8:11) - read with [mhp:{tid=[main, t_fun@93-distribute-fields-type-global.c:20:3-20:40#top]}, thread:[main, t_fun@93-distribute-fields-type-global.c:20:3-20:40#top]] (conf. 100) (exp: & tmp->field) (93-distribute-fields-type-global.c:13:3-13:29) - write with [mhp:{tid=[main]; created={[main, t_fun@93-distribute-fields-type-global.c:20:3-20:40#top]}}, thread:[main]] (conf. 110) (exp: & s) (93-distribute-fields-type-global.c:22:3-22:9) + read with thread:[main, t_fun@93-distribute-fields-type-global.c:20:3-20:40#top] (conf. 100) (exp: & tmp->field) (93-distribute-fields-type-global.c:13:3-13:29) + write with [mhp:{created={[main, t_fun@93-distribute-fields-type-global.c:20:3-20:40#top]}}, thread:[main]] (conf. 110) (exp: & s) (93-distribute-fields-type-global.c:22:3-22:9) [Info][Race] Memory locations race summary: safe: 2 vulnerable: 0 unsafe: 1 total memory locations: 3 [Success][Race] Memory location (struct S).field (safe): - read with [mhp:{tid=[main, t_fun@93-distribute-fields-type-global.c:20:3-20:40#top]}, thread:[main, t_fun@93-distribute-fields-type-global.c:20:3-20:40#top]] (conf. 100) (exp: & tmp->field) (93-distribute-fields-type-global.c:13:3-13:29) + read with thread:[main, t_fun@93-distribute-fields-type-global.c:20:3-20:40#top] (conf. 100) (exp: & tmp->field) (93-distribute-fields-type-global.c:13:3-13:29) [Success][Race] Memory location s (safe): (93-distribute-fields-type-global.c:8:10-8:11) - write with [mhp:{tid=[main]; created={[main, t_fun@93-distribute-fields-type-global.c:20:3-20:40#top]}}, thread:[main]] (conf. 110) (exp: & s) (93-distribute-fields-type-global.c:22:3-22:9) + write with [mhp:{created={[main, t_fun@93-distribute-fields-type-global.c:20:3-20:40#top]}}, thread:[main]] (conf. 110) (exp: & s) (93-distribute-fields-type-global.c:22:3-22:9) [Info][Deadcode] Logical lines of code (LLoC) summary: live: 7 dead: 0 diff --git a/tests/regression/06-symbeq/14-list_entry_rc.t b/tests/regression/06-symbeq/14-list_entry_rc.t index cfdc54c94c..d70ad0c186 100644 --- a/tests/regression/06-symbeq/14-list_entry_rc.t +++ b/tests/regression/06-symbeq/14-list_entry_rc.t @@ -6,10 +6,10 @@ dead: 0 total lines: 23 [Warning][Race] Memory location (alloc@sid:29@tid:[main])[?].datum (race with conf. 110): (14-list_entry_rc.c:41:3-41:35) - write with [mhp:{tid=[main, t_fun@14-list_entry_rc.c:45:3-45:40#top]}, thread:[main, t_fun@14-list_entry_rc.c:45:3-45:40#top]] (conf. 110) (exp: & s->datum) (14-list_entry_rc.c:27:3-27:13) - write with [mhp:{tid=[main]; created={[main, t_fun@14-list_entry_rc.c:45:3-45:40#top]}}, thread:[main]] (conf. 110) (exp: & s->datum) (14-list_entry_rc.c:27:3-27:13) - read with [mhp:{tid=[main, t_fun@14-list_entry_rc.c:45:3-45:40#top]}, thread:[main, t_fun@14-list_entry_rc.c:45:3-45:40#top]] (conf. 110) (exp: & s->datum) (14-list_entry_rc.c:27:3-27:13) - read with [mhp:{tid=[main]; created={[main, t_fun@14-list_entry_rc.c:45:3-45:40#top]}}, thread:[main]] (conf. 110) (exp: & s->datum) (14-list_entry_rc.c:27:3-27:13) + write with thread:[main, t_fun@14-list_entry_rc.c:45:3-45:40#top] (conf. 110) (exp: & s->datum) (14-list_entry_rc.c:27:3-27:13) + write with [mhp:{created={[main, t_fun@14-list_entry_rc.c:45:3-45:40#top]}}, thread:[main]] (conf. 110) (exp: & s->datum) (14-list_entry_rc.c:27:3-27:13) + read with thread:[main, t_fun@14-list_entry_rc.c:45:3-45:40#top] (conf. 110) (exp: & s->datum) (14-list_entry_rc.c:27:3-27:13) + read with [mhp:{created={[main, t_fun@14-list_entry_rc.c:45:3-45:40#top]}}, thread:[main]] (conf. 110) (exp: & s->datum) (14-list_entry_rc.c:27:3-27:13) [Info][Race] Memory locations race summary: safe: 1 vulnerable: 0 diff --git a/tests/regression/06-symbeq/16-type_rc.t b/tests/regression/06-symbeq/16-type_rc.t index b63471a45e..3b97fac458 100644 --- a/tests/regression/06-symbeq/16-type_rc.t +++ b/tests/regression/06-symbeq/16-type_rc.t @@ -6,8 +6,8 @@ Disable info messages because race summary contains (safe) memory location count [Warning][Behavior > Undefined > NullPointerDereference][CWE-476] May dereference NULL pointer (16-type_rc.c:33:3-33:16) [Warning][Behavior > Undefined > NullPointerDereference][CWE-476] May dereference NULL pointer (16-type_rc.c:36:3-36:9) [Warning][Race] Memory location (struct s).datum (race with conf. 100): - write with [mhp:{tid=[main, t_fun@16-type_rc.c:35:3-35:37#top]}, thread:[main, t_fun@16-type_rc.c:35:3-35:37#top]] (conf. 100) (exp: & s->datum) (16-type_rc.c:21:3-21:15) - write with [mhp:{tid=[main]; created={[main, t_fun@16-type_rc.c:35:3-35:37#top]}}, thread:[main]] (conf. 100) (exp: & *d) (16-type_rc.c:36:3-36:9) + write with thread:[main, t_fun@16-type_rc.c:35:3-35:37#top] (conf. 100) (exp: & s->datum) (16-type_rc.c:21:3-21:15) + write with [mhp:{created={[main, t_fun@16-type_rc.c:35:3-35:37#top]}}, thread:[main]] (conf. 100) (exp: & *d) (16-type_rc.c:36:3-36:9) [Error][Imprecise][Unsound] Function definition missing for get_s (16-type_rc.c:20:12-20:24) [Error][Imprecise][Unsound] Function definition missing for get_s (16-type_rc.c:31:3-31:14) [Error][Imprecise][Unsound] Function definition missing @@ -18,7 +18,7 @@ Disable info messages because race summary contains (safe) memory location count [Warning][Behavior > Undefined > NullPointerDereference][CWE-476] May dereference NULL pointer (16-type_rc.c:33:3-33:16) [Warning][Behavior > Undefined > NullPointerDereference][CWE-476] May dereference NULL pointer (16-type_rc.c:36:3-36:9) [Success][Race] Memory location (struct s).datum (safe): - write with [mhp:{tid=[main, t_fun@16-type_rc.c:35:3-35:37#top]}, thread:[main, t_fun@16-type_rc.c:35:3-35:37#top]] (conf. 100) (exp: & s->datum) (16-type_rc.c:21:3-21:15) + write with thread:[main, t_fun@16-type_rc.c:35:3-35:37#top] (conf. 100) (exp: & s->datum) (16-type_rc.c:21:3-21:15) [Error][Imprecise][Unsound] Function definition missing for get_s (16-type_rc.c:20:12-20:24) [Error][Imprecise][Unsound] Function definition missing for get_s (16-type_rc.c:31:3-31:14) [Error][Imprecise][Unsound] Function definition missing diff --git a/tests/regression/06-symbeq/21-mult_accs_rc.t b/tests/regression/06-symbeq/21-mult_accs_rc.t index 227c66058e..24b9217bac 100644 --- a/tests/regression/06-symbeq/21-mult_accs_rc.t +++ b/tests/regression/06-symbeq/21-mult_accs_rc.t @@ -8,8 +8,8 @@ Disable info messages because race summary contains (safe) memory location count [Warning][Behavior > Undefined > NullPointerDereference][CWE-476] May dereference NULL pointer (21-mult_accs_rc.c:29:3-29:15) [Warning][Behavior > Undefined > NullPointerDereference][CWE-476] May dereference NULL pointer (21-mult_accs_rc.c:34:3-34:9) [Warning][Race] Memory location (struct s).data (race with conf. 100): - write with [mhp:{tid=[main, t_fun@21-mult_accs_rc.c:31:3-31:37#top]}, thread:[main, t_fun@21-mult_accs_rc.c:31:3-31:37#top]] (conf. 100) (exp: & s->data) (21-mult_accs_rc.c:16:3-16:14) - write with [symblock:{p-lock:*.mutex}, mhp:{tid=[main]; created={[main, t_fun@21-mult_accs_rc.c:31:3-31:37#top]}}, thread:[main]] (conf. 100) (exp: & *d) (21-mult_accs_rc.c:34:3-34:9) + write with thread:[main, t_fun@21-mult_accs_rc.c:31:3-31:37#top] (conf. 100) (exp: & s->data) (21-mult_accs_rc.c:16:3-16:14) + write with [symblock:{p-lock:*.mutex}, mhp:{created={[main, t_fun@21-mult_accs_rc.c:31:3-31:37#top]}}, thread:[main]] (conf. 100) (exp: & *d) (21-mult_accs_rc.c:34:3-34:9) [Warning][Unknown] unlocking mutex (NULL) which may not be held (21-mult_accs_rc.c:35:3-35:26) [Warning][Unknown] unlocking unknown mutex which may not be held (21-mult_accs_rc.c:35:3-35:26) [Error][Imprecise][Unsound] Function definition missing for get_s (21-mult_accs_rc.c:13:3-13:14) @@ -25,7 +25,7 @@ Disable info messages because race summary contains (safe) memory location count [Warning][Behavior > Undefined > NullPointerDereference][CWE-476] May dereference NULL pointer (21-mult_accs_rc.c:29:3-29:15) [Warning][Behavior > Undefined > NullPointerDereference][CWE-476] May dereference NULL pointer (21-mult_accs_rc.c:34:3-34:9) [Success][Race] Memory location (struct s).data (safe): - write with [mhp:{tid=[main, t_fun@21-mult_accs_rc.c:31:3-31:37#top]}, thread:[main, t_fun@21-mult_accs_rc.c:31:3-31:37#top]] (conf. 100) (exp: & s->data) (21-mult_accs_rc.c:16:3-16:14) + write with thread:[main, t_fun@21-mult_accs_rc.c:31:3-31:37#top] (conf. 100) (exp: & s->data) (21-mult_accs_rc.c:16:3-16:14) [Warning][Unknown] unlocking mutex (NULL) which may not be held (21-mult_accs_rc.c:35:3-35:26) [Warning][Unknown] unlocking unknown mutex which may not be held (21-mult_accs_rc.c:35:3-35:26) [Error][Imprecise][Unsound] Function definition missing for get_s (21-mult_accs_rc.c:13:3-13:14) From 8ffcc4fe3bbcad340ed29943280d3e9ccb9485d3 Mon Sep 17 00:00:00 2001 From: Karoliine Holter Date: Wed, 3 Jan 2024 15:21:57 +0200 Subject: [PATCH 19/35] Remove duplicated tid printing from mhp --- src/cdomains/mHP.ml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/cdomains/mHP.ml b/src/cdomains/mHP.ml index 016a72a77e..b7d62f548c 100644 --- a/src/cdomains/mHP.ml +++ b/src/cdomains/mHP.ml @@ -24,7 +24,6 @@ let current (ask:Queries.ask) = } let pretty () {tid; created; must_joined} = - let tid_doc = Some (Pretty.dprintf "tid=%a" ThreadIdDomain.ThreadLifted.pretty tid) in (* avoid useless empty sets in race output *) let created_doc = if ConcDomain.ThreadSet.is_empty created then @@ -38,7 +37,7 @@ let pretty () {tid; created; must_joined} = else Some (Pretty.dprintf "must_joined=%a" ConcDomain.ThreadSet.pretty must_joined) in - let docs = List.filter_map Fun.id [tid_doc; created_doc; must_joined_doc] in + let docs = List.filter_map Fun.id [created_doc; must_joined_doc] in Pretty.dprintf "{%a}" (Pretty.d_list "; " Pretty.insert) docs include Printable.SimplePretty ( From d0a2a2806d4632066fb8ba6d05f82c8e4d7a2fa5 Mon Sep 17 00:00:00 2001 From: Karoliine Holter Date: Wed, 3 Jan 2024 15:22:51 +0200 Subject: [PATCH 20/35] Do not print mhp results when empty --- src/analyses/mHPAnalysis.ml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/analyses/mHPAnalysis.ml b/src/analyses/mHPAnalysis.ml index a24dbc3cd6..9bccb41baf 100644 --- a/src/analyses/mHPAnalysis.ml +++ b/src/analyses/mHPAnalysis.ml @@ -12,7 +12,9 @@ struct include MHP let name () = "mhp" let may_race = MHP.may_happen_in_parallel - let should_print _ = true + let should_print {tid; created; must_joined} = + not (ConcDomain.ThreadSet.is_empty created) + || not (ConcDomain.ThreadSet.is_empty must_joined) end let access ctx _: MHP.t = MHP.current (Analyses.ask_of_ctx ctx) From 2d91b7a77ea9f0ad82e113a02b5328e73bc034c0 Mon Sep 17 00:00:00 2001 From: Karoliine Holter Date: Wed, 3 Jan 2024 16:23:09 +0200 Subject: [PATCH 21/35] Remove excessive top thread id uniqueness counter from cram tests --- tests/regression/04-mutex/01-simple_rc.t | 8 ++++---- tests/regression/04-mutex/49-type-invariants.t | 12 ++++++------ tests/regression/04-mutex/77-type-nested-fields.t | 6 +++--- .../04-mutex/79-type-nested-fields-deep1.t | 6 +++--- .../04-mutex/80-type-nested-fields-deep2.t | 6 +++--- tests/regression/04-mutex/84-distribute-fields-1.t | 6 +++--- tests/regression/04-mutex/85-distribute-fields-2.t | 6 +++--- tests/regression/04-mutex/86-distribute-fields-3.t | 6 +++--- tests/regression/04-mutex/87-distribute-fields-4.t | 4 ++-- tests/regression/04-mutex/88-distribute-fields-5.t | 4 ++-- tests/regression/04-mutex/89-distribute-fields-6.t | 4 ++-- .../04-mutex/90-distribute-fields-type-1.t | 8 ++++---- .../04-mutex/91-distribute-fields-type-2.t | 8 ++++---- .../04-mutex/92-distribute-fields-type-deep.t | 8 ++++---- .../04-mutex/93-distribute-fields-type-global.t | 8 ++++---- tests/regression/06-symbeq/14-list_entry_rc.t | 8 ++++---- tests/regression/06-symbeq/16-type_rc.t | 6 +++--- tests/regression/06-symbeq/21-mult_accs_rc.t | 6 +++--- 18 files changed, 60 insertions(+), 60 deletions(-) diff --git a/tests/regression/04-mutex/01-simple_rc.t b/tests/regression/04-mutex/01-simple_rc.t index b5f09616a7..53be4227f0 100644 --- a/tests/regression/04-mutex/01-simple_rc.t +++ b/tests/regression/04-mutex/01-simple_rc.t @@ -1,9 +1,9 @@ $ goblint --enable warn.deterministic 01-simple_rc.c [Warning][Race] Memory location myglobal (race with conf. 110): (01-simple_rc.c:4:5-4:13) - write with [lock:{mutex1}, thread:[main, t_fun@01-simple_rc.c:17:3-17:40#top]] (conf. 110) (exp: & myglobal) (01-simple_rc.c:10:3-10:22) - write with [mhp:{created={[main, t_fun@01-simple_rc.c:17:3-17:40#top]}}, lock:{mutex2}, thread:[main]] (conf. 110) (exp: & myglobal) (01-simple_rc.c:19:3-19:22) - read with [lock:{mutex1}, thread:[main, t_fun@01-simple_rc.c:17:3-17:40#top]] (conf. 110) (exp: & myglobal) (01-simple_rc.c:10:3-10:22) - read with [mhp:{created={[main, t_fun@01-simple_rc.c:17:3-17:40#top]}}, lock:{mutex2}, thread:[main]] (conf. 110) (exp: & myglobal) (01-simple_rc.c:19:3-19:22) + write with [lock:{mutex1}, thread:[main, t_fun@01-simple_rc.c:17:3-17:40]] (conf. 110) (exp: & myglobal) (01-simple_rc.c:10:3-10:22) + write with [mhp:{created={[main, t_fun@01-simple_rc.c:17:3-17:40]}}, lock:{mutex2}, thread:[main]] (conf. 110) (exp: & myglobal) (01-simple_rc.c:19:3-19:22) + read with [lock:{mutex1}, thread:[main, t_fun@01-simple_rc.c:17:3-17:40]] (conf. 110) (exp: & myglobal) (01-simple_rc.c:10:3-10:22) + read with [mhp:{created={[main, t_fun@01-simple_rc.c:17:3-17:40]}}, lock:{mutex2}, thread:[main]] (conf. 110) (exp: & myglobal) (01-simple_rc.c:19:3-19:22) [Info][Race] Memory locations race summary: safe: 0 vulnerable: 0 diff --git a/tests/regression/04-mutex/49-type-invariants.t b/tests/regression/04-mutex/49-type-invariants.t index 33db951684..f96dc9f9a9 100644 --- a/tests/regression/04-mutex/49-type-invariants.t +++ b/tests/regression/04-mutex/49-type-invariants.t @@ -1,15 +1,15 @@ $ goblint --enable warn.deterministic --enable ana.race.direct-arithmetic --enable allglobs 49-type-invariants.c [Warning][Behavior > Undefined > NullPointerDereference][CWE-476] May dereference NULL pointer (49-type-invariants.c:21:3-21:21) [Warning][Race] Memory location s.field (race with conf. 110): (49-type-invariants.c:8:10-8:11) - write with [mhp:{created={[main, t_fun@49-type-invariants.c:20:3-20:40#top]}}, thread:[main]] (conf. 100) (exp: & tmp->field) (49-type-invariants.c:21:3-21:21) - read with thread:[main, t_fun@49-type-invariants.c:20:3-20:40#top] (conf. 110) (exp: & s.field) (49-type-invariants.c:11:3-11:23) + write with [mhp:{created={[main, t_fun@49-type-invariants.c:20:3-20:40]}}, thread:[main]] (conf. 100) (exp: & tmp->field) (49-type-invariants.c:21:3-21:21) + read with thread:[main, t_fun@49-type-invariants.c:20:3-20:40] (conf. 110) (exp: & s.field) (49-type-invariants.c:11:3-11:23) [Info][Race] Memory locations race summary: safe: 1 vulnerable: 0 unsafe: 1 total memory locations: 2 [Success][Race] Memory location (struct S).field (safe): - write with [mhp:{created={[main, t_fun@49-type-invariants.c:20:3-20:40#top]}}, thread:[main]] (conf. 100) (exp: & tmp->field) (49-type-invariants.c:21:3-21:21) + write with [mhp:{created={[main, t_fun@49-type-invariants.c:20:3-20:40]}}, thread:[main]] (conf. 100) (exp: & tmp->field) (49-type-invariants.c:21:3-21:21) [Info][Deadcode] Logical lines of code (LLoC) summary: live: 7 dead: 0 @@ -24,15 +24,15 @@ $ goblint --enable warn.deterministic --disable ana.race.direct-arithmetic --enable allglobs 49-type-invariants.c [Warning][Behavior > Undefined > NullPointerDereference][CWE-476] May dereference NULL pointer (49-type-invariants.c:21:3-21:21) [Warning][Race] Memory location s.field (race with conf. 110): (49-type-invariants.c:8:10-8:11) - write with [mhp:{created={[main, t_fun@49-type-invariants.c:20:3-20:40#top]}}, thread:[main]] (conf. 100) (exp: & tmp->field) (49-type-invariants.c:21:3-21:21) - read with thread:[main, t_fun@49-type-invariants.c:20:3-20:40#top] (conf. 110) (exp: & s.field) (49-type-invariants.c:11:3-11:23) + write with [mhp:{created={[main, t_fun@49-type-invariants.c:20:3-20:40]}}, thread:[main]] (conf. 100) (exp: & tmp->field) (49-type-invariants.c:21:3-21:21) + read with thread:[main, t_fun@49-type-invariants.c:20:3-20:40] (conf. 110) (exp: & s.field) (49-type-invariants.c:11:3-11:23) [Info][Race] Memory locations race summary: safe: 1 vulnerable: 0 unsafe: 1 total memory locations: 2 [Success][Race] Memory location (struct S).field (safe): - write with [mhp:{created={[main, t_fun@49-type-invariants.c:20:3-20:40#top]}}, thread:[main]] (conf. 100) (exp: & tmp->field) (49-type-invariants.c:21:3-21:21) + write with [mhp:{created={[main, t_fun@49-type-invariants.c:20:3-20:40]}}, thread:[main]] (conf. 100) (exp: & tmp->field) (49-type-invariants.c:21:3-21:21) [Info][Deadcode] Logical lines of code (LLoC) summary: live: 7 dead: 0 diff --git a/tests/regression/04-mutex/77-type-nested-fields.t b/tests/regression/04-mutex/77-type-nested-fields.t index e2afc34125..e069381944 100644 --- a/tests/regression/04-mutex/77-type-nested-fields.t +++ b/tests/regression/04-mutex/77-type-nested-fields.t @@ -2,15 +2,15 @@ [Warning][Behavior > Undefined > NullPointerDereference][CWE-476] May dereference NULL pointer (77-type-nested-fields.c:31:3-31:20) [Warning][Behavior > Undefined > NullPointerDereference][CWE-476] May dereference NULL pointer (77-type-nested-fields.c:38:3-38:22) [Warning][Race] Memory location (struct T).s.field (race with conf. 100): - write with thread:[main, t_fun@77-type-nested-fields.c:37:3-37:40#top] (conf. 100) (exp: & tmp->field) (77-type-nested-fields.c:31:3-31:20) - write with [mhp:{created={[main, t_fun@77-type-nested-fields.c:37:3-37:40#top]}}, thread:[main]] (conf. 100) (exp: & tmp->s.field) (77-type-nested-fields.c:38:3-38:22) + write with thread:[main, t_fun@77-type-nested-fields.c:37:3-37:40] (conf. 100) (exp: & tmp->field) (77-type-nested-fields.c:31:3-31:20) + write with [mhp:{created={[main, t_fun@77-type-nested-fields.c:37:3-37:40]}}, thread:[main]] (conf. 100) (exp: & tmp->s.field) (77-type-nested-fields.c:38:3-38:22) [Info][Race] Memory locations race summary: safe: 1 vulnerable: 0 unsafe: 1 total memory locations: 2 [Success][Race] Memory location (struct S).field (safe): - write with thread:[main, t_fun@77-type-nested-fields.c:37:3-37:40#top] (conf. 100) (exp: & tmp->field) (77-type-nested-fields.c:31:3-31:20) + write with thread:[main, t_fun@77-type-nested-fields.c:37:3-37:40] (conf. 100) (exp: & tmp->field) (77-type-nested-fields.c:31:3-31:20) [Info][Deadcode] Logical lines of code (LLoC) summary: live: 7 dead: 0 diff --git a/tests/regression/04-mutex/79-type-nested-fields-deep1.t b/tests/regression/04-mutex/79-type-nested-fields-deep1.t index 9b6337a032..3049eb672d 100644 --- a/tests/regression/04-mutex/79-type-nested-fields-deep1.t +++ b/tests/regression/04-mutex/79-type-nested-fields-deep1.t @@ -2,15 +2,15 @@ [Warning][Behavior > Undefined > NullPointerDereference][CWE-476] May dereference NULL pointer (79-type-nested-fields-deep1.c:36:3-36:20) [Warning][Behavior > Undefined > NullPointerDereference][CWE-476] May dereference NULL pointer (79-type-nested-fields-deep1.c:43:3-43:24) [Warning][Race] Memory location (struct U).t.s.field (race with conf. 100): - write with thread:[main, t_fun@79-type-nested-fields-deep1.c:42:3-42:40#top] (conf. 100) (exp: & tmp->field) (79-type-nested-fields-deep1.c:36:3-36:20) - write with [mhp:{created={[main, t_fun@79-type-nested-fields-deep1.c:42:3-42:40#top]}}, thread:[main]] (conf. 100) (exp: & tmp->t.s.field) (79-type-nested-fields-deep1.c:43:3-43:24) + write with thread:[main, t_fun@79-type-nested-fields-deep1.c:42:3-42:40] (conf. 100) (exp: & tmp->field) (79-type-nested-fields-deep1.c:36:3-36:20) + write with [mhp:{created={[main, t_fun@79-type-nested-fields-deep1.c:42:3-42:40]}}, thread:[main]] (conf. 100) (exp: & tmp->t.s.field) (79-type-nested-fields-deep1.c:43:3-43:24) [Info][Race] Memory locations race summary: safe: 1 vulnerable: 0 unsafe: 1 total memory locations: 2 [Success][Race] Memory location (struct S).field (safe): - write with thread:[main, t_fun@79-type-nested-fields-deep1.c:42:3-42:40#top] (conf. 100) (exp: & tmp->field) (79-type-nested-fields-deep1.c:36:3-36:20) + write with thread:[main, t_fun@79-type-nested-fields-deep1.c:42:3-42:40] (conf. 100) (exp: & tmp->field) (79-type-nested-fields-deep1.c:36:3-36:20) [Info][Deadcode] Logical lines of code (LLoC) summary: live: 7 dead: 0 diff --git a/tests/regression/04-mutex/80-type-nested-fields-deep2.t b/tests/regression/04-mutex/80-type-nested-fields-deep2.t index 1a191fa076..02cb54e348 100644 --- a/tests/regression/04-mutex/80-type-nested-fields-deep2.t +++ b/tests/regression/04-mutex/80-type-nested-fields-deep2.t @@ -2,15 +2,15 @@ [Warning][Behavior > Undefined > NullPointerDereference][CWE-476] May dereference NULL pointer (80-type-nested-fields-deep2.c:36:3-36:22) [Warning][Behavior > Undefined > NullPointerDereference][CWE-476] May dereference NULL pointer (80-type-nested-fields-deep2.c:43:3-43:24) [Warning][Race] Memory location (struct U).t.s.field (race with conf. 100): - write with thread:[main, t_fun@80-type-nested-fields-deep2.c:42:3-42:40#top] (conf. 100) (exp: & tmp->s.field) (80-type-nested-fields-deep2.c:36:3-36:22) - write with [mhp:{created={[main, t_fun@80-type-nested-fields-deep2.c:42:3-42:40#top]}}, thread:[main]] (conf. 100) (exp: & tmp->t.s.field) (80-type-nested-fields-deep2.c:43:3-43:24) + write with thread:[main, t_fun@80-type-nested-fields-deep2.c:42:3-42:40] (conf. 100) (exp: & tmp->s.field) (80-type-nested-fields-deep2.c:36:3-36:22) + write with [mhp:{created={[main, t_fun@80-type-nested-fields-deep2.c:42:3-42:40]}}, thread:[main]] (conf. 100) (exp: & tmp->t.s.field) (80-type-nested-fields-deep2.c:43:3-43:24) [Info][Race] Memory locations race summary: safe: 1 vulnerable: 0 unsafe: 1 total memory locations: 2 [Success][Race] Memory location (struct T).s.field (safe): - write with thread:[main, t_fun@80-type-nested-fields-deep2.c:42:3-42:40#top] (conf. 100) (exp: & tmp->s.field) (80-type-nested-fields-deep2.c:36:3-36:22) + write with thread:[main, t_fun@80-type-nested-fields-deep2.c:42:3-42:40] (conf. 100) (exp: & tmp->s.field) (80-type-nested-fields-deep2.c:36:3-36:22) [Info][Deadcode] Logical lines of code (LLoC) summary: live: 7 dead: 0 diff --git a/tests/regression/04-mutex/84-distribute-fields-1.t b/tests/regression/04-mutex/84-distribute-fields-1.t index 708d676d1a..fbc723c6b6 100644 --- a/tests/regression/04-mutex/84-distribute-fields-1.t +++ b/tests/regression/04-mutex/84-distribute-fields-1.t @@ -1,14 +1,14 @@ $ goblint --enable warn.deterministic --enable allglobs 84-distribute-fields-1.c [Warning][Race] Memory location s.data (race with conf. 110): (84-distribute-fields-1.c:9:10-9:11) - write with thread:[main, t_fun@84-distribute-fields-1.c:18:3-18:40#top] (conf. 110) (exp: & s.data) (84-distribute-fields-1.c:12:3-12:13) - write with [mhp:{created={[main, t_fun@84-distribute-fields-1.c:18:3-18:40#top]}}, thread:[main]] (conf. 110) (exp: & s) (84-distribute-fields-1.c:20:3-20:9) + write with thread:[main, t_fun@84-distribute-fields-1.c:18:3-18:40] (conf. 110) (exp: & s.data) (84-distribute-fields-1.c:12:3-12:13) + write with [mhp:{created={[main, t_fun@84-distribute-fields-1.c:18:3-18:40]}}, thread:[main]] (conf. 110) (exp: & s) (84-distribute-fields-1.c:20:3-20:9) [Info][Race] Memory locations race summary: safe: 1 vulnerable: 0 unsafe: 1 total memory locations: 2 [Success][Race] Memory location s (safe): (84-distribute-fields-1.c:9:10-9:11) - write with [mhp:{created={[main, t_fun@84-distribute-fields-1.c:18:3-18:40#top]}}, thread:[main]] (conf. 110) (exp: & s) (84-distribute-fields-1.c:20:3-20:9) + write with [mhp:{created={[main, t_fun@84-distribute-fields-1.c:18:3-18:40]}}, thread:[main]] (conf. 110) (exp: & s) (84-distribute-fields-1.c:20:3-20:9) [Info][Deadcode] Logical lines of code (LLoC) summary: live: 8 dead: 0 diff --git a/tests/regression/04-mutex/85-distribute-fields-2.t b/tests/regression/04-mutex/85-distribute-fields-2.t index 6bd8abc1cf..aedf5fea72 100644 --- a/tests/regression/04-mutex/85-distribute-fields-2.t +++ b/tests/regression/04-mutex/85-distribute-fields-2.t @@ -1,14 +1,14 @@ $ goblint --enable warn.deterministic --enable allglobs 85-distribute-fields-2.c [Warning][Race] Memory location t.s.data (race with conf. 110): (85-distribute-fields-2.c:15:10-15:11) - write with thread:[main, t_fun@85-distribute-fields-2.c:24:3-24:40#top] (conf. 110) (exp: & t.s.data) (85-distribute-fields-2.c:18:3-18:15) - write with [mhp:{created={[main, t_fun@85-distribute-fields-2.c:24:3-24:40#top]}}, thread:[main]] (conf. 110) (exp: & t.s) (85-distribute-fields-2.c:26:3-26:11) + write with thread:[main, t_fun@85-distribute-fields-2.c:24:3-24:40] (conf. 110) (exp: & t.s.data) (85-distribute-fields-2.c:18:3-18:15) + write with [mhp:{created={[main, t_fun@85-distribute-fields-2.c:24:3-24:40]}}, thread:[main]] (conf. 110) (exp: & t.s) (85-distribute-fields-2.c:26:3-26:11) [Info][Race] Memory locations race summary: safe: 1 vulnerable: 0 unsafe: 1 total memory locations: 2 [Success][Race] Memory location t.s (safe): (85-distribute-fields-2.c:15:10-15:11) - write with [mhp:{created={[main, t_fun@85-distribute-fields-2.c:24:3-24:40#top]}}, thread:[main]] (conf. 110) (exp: & t.s) (85-distribute-fields-2.c:26:3-26:11) + write with [mhp:{created={[main, t_fun@85-distribute-fields-2.c:24:3-24:40]}}, thread:[main]] (conf. 110) (exp: & t.s) (85-distribute-fields-2.c:26:3-26:11) [Info][Deadcode] Logical lines of code (LLoC) summary: live: 8 dead: 0 diff --git a/tests/regression/04-mutex/86-distribute-fields-3.t b/tests/regression/04-mutex/86-distribute-fields-3.t index ea57fd2ba5..6c6e3a9d42 100644 --- a/tests/regression/04-mutex/86-distribute-fields-3.t +++ b/tests/regression/04-mutex/86-distribute-fields-3.t @@ -1,14 +1,14 @@ $ goblint --enable warn.deterministic --enable allglobs 86-distribute-fields-3.c [Warning][Race] Memory location t.s.data (race with conf. 110): (86-distribute-fields-3.c:15:10-15:11) - write with thread:[main, t_fun@86-distribute-fields-3.c:24:3-24:40#top] (conf. 110) (exp: & t.s.data) (86-distribute-fields-3.c:18:3-18:15) - write with [mhp:{created={[main, t_fun@86-distribute-fields-3.c:24:3-24:40#top]}}, thread:[main]] (conf. 110) (exp: & t) (86-distribute-fields-3.c:26:3-26:9) + write with thread:[main, t_fun@86-distribute-fields-3.c:24:3-24:40] (conf. 110) (exp: & t.s.data) (86-distribute-fields-3.c:18:3-18:15) + write with [mhp:{created={[main, t_fun@86-distribute-fields-3.c:24:3-24:40]}}, thread:[main]] (conf. 110) (exp: & t) (86-distribute-fields-3.c:26:3-26:9) [Info][Race] Memory locations race summary: safe: 1 vulnerable: 0 unsafe: 1 total memory locations: 2 [Success][Race] Memory location t (safe): (86-distribute-fields-3.c:15:10-15:11) - write with [mhp:{created={[main, t_fun@86-distribute-fields-3.c:24:3-24:40#top]}}, thread:[main]] (conf. 110) (exp: & t) (86-distribute-fields-3.c:26:3-26:9) + write with [mhp:{created={[main, t_fun@86-distribute-fields-3.c:24:3-24:40]}}, thread:[main]] (conf. 110) (exp: & t) (86-distribute-fields-3.c:26:3-26:9) [Info][Deadcode] Logical lines of code (LLoC) summary: live: 8 dead: 0 diff --git a/tests/regression/04-mutex/87-distribute-fields-4.t b/tests/regression/04-mutex/87-distribute-fields-4.t index 3c8ac025b0..024c52d6cb 100644 --- a/tests/regression/04-mutex/87-distribute-fields-4.t +++ b/tests/regression/04-mutex/87-distribute-fields-4.t @@ -1,7 +1,7 @@ $ goblint --enable warn.deterministic --enable allglobs 87-distribute-fields-4.c [Warning][Race] Memory location s (race with conf. 110): (87-distribute-fields-4.c:9:10-9:11) - write with thread:[main, t_fun@87-distribute-fields-4.c:19:3-19:40#top] (conf. 110) (exp: & s) (87-distribute-fields-4.c:13:3-13:9) - write with [mhp:{created={[main, t_fun@87-distribute-fields-4.c:19:3-19:40#top]}}, thread:[main]] (conf. 110) (exp: & s) (87-distribute-fields-4.c:21:3-21:9) + write with thread:[main, t_fun@87-distribute-fields-4.c:19:3-19:40] (conf. 110) (exp: & s) (87-distribute-fields-4.c:13:3-13:9) + write with [mhp:{created={[main, t_fun@87-distribute-fields-4.c:19:3-19:40]}}, thread:[main]] (conf. 110) (exp: & s) (87-distribute-fields-4.c:21:3-21:9) [Info][Race] Memory locations race summary: safe: 0 vulnerable: 0 diff --git a/tests/regression/04-mutex/88-distribute-fields-5.t b/tests/regression/04-mutex/88-distribute-fields-5.t index 1c32b2ac23..dff8fcb135 100644 --- a/tests/regression/04-mutex/88-distribute-fields-5.t +++ b/tests/regression/04-mutex/88-distribute-fields-5.t @@ -1,7 +1,7 @@ $ goblint --enable warn.deterministic --enable allglobs 88-distribute-fields-5.c [Warning][Race] Memory location t.s (race with conf. 110): (88-distribute-fields-5.c:15:10-15:11) - write with thread:[main, t_fun@88-distribute-fields-5.c:25:3-25:40#top] (conf. 110) (exp: & t.s) (88-distribute-fields-5.c:19:3-19:11) - write with [mhp:{created={[main, t_fun@88-distribute-fields-5.c:25:3-25:40#top]}}, thread:[main]] (conf. 110) (exp: & t.s) (88-distribute-fields-5.c:27:3-27:11) + write with thread:[main, t_fun@88-distribute-fields-5.c:25:3-25:40] (conf. 110) (exp: & t.s) (88-distribute-fields-5.c:19:3-19:11) + write with [mhp:{created={[main, t_fun@88-distribute-fields-5.c:25:3-25:40]}}, thread:[main]] (conf. 110) (exp: & t.s) (88-distribute-fields-5.c:27:3-27:11) [Info][Race] Memory locations race summary: safe: 0 vulnerable: 0 diff --git a/tests/regression/04-mutex/89-distribute-fields-6.t b/tests/regression/04-mutex/89-distribute-fields-6.t index 56996b4e26..5d9435d27e 100644 --- a/tests/regression/04-mutex/89-distribute-fields-6.t +++ b/tests/regression/04-mutex/89-distribute-fields-6.t @@ -1,7 +1,7 @@ $ goblint --enable warn.deterministic --enable allglobs 89-distribute-fields-6.c [Warning][Race] Memory location t (race with conf. 110): (89-distribute-fields-6.c:15:10-15:11) - write with thread:[main, t_fun@89-distribute-fields-6.c:25:3-25:40#top] (conf. 110) (exp: & t) (89-distribute-fields-6.c:19:3-19:9) - write with [mhp:{created={[main, t_fun@89-distribute-fields-6.c:25:3-25:40#top]}}, thread:[main]] (conf. 110) (exp: & t) (89-distribute-fields-6.c:27:3-27:9) + write with thread:[main, t_fun@89-distribute-fields-6.c:25:3-25:40] (conf. 110) (exp: & t) (89-distribute-fields-6.c:19:3-19:9) + write with [mhp:{created={[main, t_fun@89-distribute-fields-6.c:25:3-25:40]}}, thread:[main]] (conf. 110) (exp: & t) (89-distribute-fields-6.c:27:3-27:9) [Info][Race] Memory locations race summary: safe: 0 vulnerable: 0 diff --git a/tests/regression/04-mutex/90-distribute-fields-type-1.t b/tests/regression/04-mutex/90-distribute-fields-type-1.t index b678e490f8..caabddc37e 100644 --- a/tests/regression/04-mutex/90-distribute-fields-type-1.t +++ b/tests/regression/04-mutex/90-distribute-fields-type-1.t @@ -2,17 +2,17 @@ [Warning][Behavior > Undefined > NullPointerDereference][CWE-476] May dereference NULL pointer (90-distribute-fields-type-1.c:31:3-31:20) [Warning][Behavior > Undefined > NullPointerDereference][CWE-476] May dereference NULL pointer (90-distribute-fields-type-1.c:39:3-39:17) [Warning][Race] Memory location (struct T).s.field (race with conf. 100): - write with thread:[main, t_fun@90-distribute-fields-type-1.c:37:3-37:40#top] (conf. 100) (exp: & tmp->field) (90-distribute-fields-type-1.c:31:3-31:20) - write with [mhp:{created={[main, t_fun@90-distribute-fields-type-1.c:37:3-37:40#top]}}, thread:[main]] (conf. 100) (exp: & tmp->s) (90-distribute-fields-type-1.c:39:3-39:17) + write with thread:[main, t_fun@90-distribute-fields-type-1.c:37:3-37:40] (conf. 100) (exp: & tmp->field) (90-distribute-fields-type-1.c:31:3-31:20) + write with [mhp:{created={[main, t_fun@90-distribute-fields-type-1.c:37:3-37:40]}}, thread:[main]] (conf. 100) (exp: & tmp->s) (90-distribute-fields-type-1.c:39:3-39:17) [Info][Race] Memory locations race summary: safe: 2 vulnerable: 0 unsafe: 1 total memory locations: 3 [Success][Race] Memory location (struct S).field (safe): - write with thread:[main, t_fun@90-distribute-fields-type-1.c:37:3-37:40#top] (conf. 100) (exp: & tmp->field) (90-distribute-fields-type-1.c:31:3-31:20) + write with thread:[main, t_fun@90-distribute-fields-type-1.c:37:3-37:40] (conf. 100) (exp: & tmp->field) (90-distribute-fields-type-1.c:31:3-31:20) [Success][Race] Memory location (struct T).s (safe): - write with [mhp:{created={[main, t_fun@90-distribute-fields-type-1.c:37:3-37:40#top]}}, thread:[main]] (conf. 100) (exp: & tmp->s) (90-distribute-fields-type-1.c:39:3-39:17) + write with [mhp:{created={[main, t_fun@90-distribute-fields-type-1.c:37:3-37:40]}}, thread:[main]] (conf. 100) (exp: & tmp->s) (90-distribute-fields-type-1.c:39:3-39:17) [Info][Deadcode] Logical lines of code (LLoC) summary: live: 7 dead: 0 diff --git a/tests/regression/04-mutex/91-distribute-fields-type-2.t b/tests/regression/04-mutex/91-distribute-fields-type-2.t index 79ab8b4bc2..cb21318801 100644 --- a/tests/regression/04-mutex/91-distribute-fields-type-2.t +++ b/tests/regression/04-mutex/91-distribute-fields-type-2.t @@ -2,17 +2,17 @@ [Warning][Behavior > Undefined > NullPointerDereference][CWE-476] May dereference NULL pointer (91-distribute-fields-type-2.c:32:3-32:17) [Warning][Behavior > Undefined > NullPointerDereference][CWE-476] May dereference NULL pointer (91-distribute-fields-type-2.c:40:3-40:17) [Warning][Race] Memory location (struct T).s (race with conf. 100): - write with thread:[main, t_fun@91-distribute-fields-type-2.c:38:3-38:40#top] (conf. 100) (exp: & *tmp) (91-distribute-fields-type-2.c:32:3-32:17) - write with [mhp:{created={[main, t_fun@91-distribute-fields-type-2.c:38:3-38:40#top]}}, thread:[main]] (conf. 100) (exp: & *tmp) (91-distribute-fields-type-2.c:40:3-40:17) + write with thread:[main, t_fun@91-distribute-fields-type-2.c:38:3-38:40] (conf. 100) (exp: & *tmp) (91-distribute-fields-type-2.c:32:3-32:17) + write with [mhp:{created={[main, t_fun@91-distribute-fields-type-2.c:38:3-38:40]}}, thread:[main]] (conf. 100) (exp: & *tmp) (91-distribute-fields-type-2.c:40:3-40:17) [Info][Race] Memory locations race summary: safe: 2 vulnerable: 0 unsafe: 1 total memory locations: 3 [Success][Race] Memory location (struct S) (safe): - write with thread:[main, t_fun@91-distribute-fields-type-2.c:38:3-38:40#top] (conf. 100) (exp: & *tmp) (91-distribute-fields-type-2.c:32:3-32:17) + write with thread:[main, t_fun@91-distribute-fields-type-2.c:38:3-38:40] (conf. 100) (exp: & *tmp) (91-distribute-fields-type-2.c:32:3-32:17) [Success][Race] Memory location (struct T) (safe): - write with [mhp:{created={[main, t_fun@91-distribute-fields-type-2.c:38:3-38:40#top]}}, thread:[main]] (conf. 100) (exp: & *tmp) (91-distribute-fields-type-2.c:40:3-40:17) + write with [mhp:{created={[main, t_fun@91-distribute-fields-type-2.c:38:3-38:40]}}, thread:[main]] (conf. 100) (exp: & *tmp) (91-distribute-fields-type-2.c:40:3-40:17) [Info][Deadcode] Logical lines of code (LLoC) summary: live: 7 dead: 0 diff --git a/tests/regression/04-mutex/92-distribute-fields-type-deep.t b/tests/regression/04-mutex/92-distribute-fields-type-deep.t index 913ba9bcc5..041c94d78b 100644 --- a/tests/regression/04-mutex/92-distribute-fields-type-deep.t +++ b/tests/regression/04-mutex/92-distribute-fields-type-deep.t @@ -2,17 +2,17 @@ [Warning][Behavior > Undefined > NullPointerDereference][CWE-476] May dereference NULL pointer (92-distribute-fields-type-deep.c:36:3-36:20) [Warning][Behavior > Undefined > NullPointerDereference][CWE-476] May dereference NULL pointer (92-distribute-fields-type-deep.c:44:3-44:17) [Warning][Race] Memory location (struct U).t.s.field (race with conf. 100): - write with thread:[main, t_fun@92-distribute-fields-type-deep.c:42:3-42:40#top] (conf. 100) (exp: & tmp->field) (92-distribute-fields-type-deep.c:36:3-36:20) - write with [mhp:{created={[main, t_fun@92-distribute-fields-type-deep.c:42:3-42:40#top]}}, thread:[main]] (conf. 100) (exp: & tmp->t) (92-distribute-fields-type-deep.c:44:3-44:17) + write with thread:[main, t_fun@92-distribute-fields-type-deep.c:42:3-42:40] (conf. 100) (exp: & tmp->field) (92-distribute-fields-type-deep.c:36:3-36:20) + write with [mhp:{created={[main, t_fun@92-distribute-fields-type-deep.c:42:3-42:40]}}, thread:[main]] (conf. 100) (exp: & tmp->t) (92-distribute-fields-type-deep.c:44:3-44:17) [Info][Race] Memory locations race summary: safe: 2 vulnerable: 0 unsafe: 1 total memory locations: 3 [Success][Race] Memory location (struct S).field (safe): - write with thread:[main, t_fun@92-distribute-fields-type-deep.c:42:3-42:40#top] (conf. 100) (exp: & tmp->field) (92-distribute-fields-type-deep.c:36:3-36:20) + write with thread:[main, t_fun@92-distribute-fields-type-deep.c:42:3-42:40] (conf. 100) (exp: & tmp->field) (92-distribute-fields-type-deep.c:36:3-36:20) [Success][Race] Memory location (struct U).t (safe): - write with [mhp:{created={[main, t_fun@92-distribute-fields-type-deep.c:42:3-42:40#top]}}, thread:[main]] (conf. 100) (exp: & tmp->t) (92-distribute-fields-type-deep.c:44:3-44:17) + write with [mhp:{created={[main, t_fun@92-distribute-fields-type-deep.c:42:3-42:40]}}, thread:[main]] (conf. 100) (exp: & tmp->t) (92-distribute-fields-type-deep.c:44:3-44:17) [Info][Deadcode] Logical lines of code (LLoC) summary: live: 7 dead: 0 diff --git a/tests/regression/04-mutex/93-distribute-fields-type-global.t b/tests/regression/04-mutex/93-distribute-fields-type-global.t index 3ec7b12e63..49fc198573 100644 --- a/tests/regression/04-mutex/93-distribute-fields-type-global.t +++ b/tests/regression/04-mutex/93-distribute-fields-type-global.t @@ -1,17 +1,17 @@ $ goblint --enable warn.deterministic --enable allglobs 93-distribute-fields-type-global.c [Warning][Behavior > Undefined > NullPointerDereference][CWE-476] May dereference NULL pointer (93-distribute-fields-type-global.c:13:3-13:29) [Warning][Race] Memory location s.field (race with conf. 110): (93-distribute-fields-type-global.c:8:10-8:11) - read with thread:[main, t_fun@93-distribute-fields-type-global.c:20:3-20:40#top] (conf. 100) (exp: & tmp->field) (93-distribute-fields-type-global.c:13:3-13:29) - write with [mhp:{created={[main, t_fun@93-distribute-fields-type-global.c:20:3-20:40#top]}}, thread:[main]] (conf. 110) (exp: & s) (93-distribute-fields-type-global.c:22:3-22:9) + read with thread:[main, t_fun@93-distribute-fields-type-global.c:20:3-20:40] (conf. 100) (exp: & tmp->field) (93-distribute-fields-type-global.c:13:3-13:29) + write with [mhp:{created={[main, t_fun@93-distribute-fields-type-global.c:20:3-20:40]}}, thread:[main]] (conf. 110) (exp: & s) (93-distribute-fields-type-global.c:22:3-22:9) [Info][Race] Memory locations race summary: safe: 2 vulnerable: 0 unsafe: 1 total memory locations: 3 [Success][Race] Memory location (struct S).field (safe): - read with thread:[main, t_fun@93-distribute-fields-type-global.c:20:3-20:40#top] (conf. 100) (exp: & tmp->field) (93-distribute-fields-type-global.c:13:3-13:29) + read with thread:[main, t_fun@93-distribute-fields-type-global.c:20:3-20:40] (conf. 100) (exp: & tmp->field) (93-distribute-fields-type-global.c:13:3-13:29) [Success][Race] Memory location s (safe): (93-distribute-fields-type-global.c:8:10-8:11) - write with [mhp:{created={[main, t_fun@93-distribute-fields-type-global.c:20:3-20:40#top]}}, thread:[main]] (conf. 110) (exp: & s) (93-distribute-fields-type-global.c:22:3-22:9) + write with [mhp:{created={[main, t_fun@93-distribute-fields-type-global.c:20:3-20:40]}}, thread:[main]] (conf. 110) (exp: & s) (93-distribute-fields-type-global.c:22:3-22:9) [Info][Deadcode] Logical lines of code (LLoC) summary: live: 7 dead: 0 diff --git a/tests/regression/06-symbeq/14-list_entry_rc.t b/tests/regression/06-symbeq/14-list_entry_rc.t index d70ad0c186..e06d043547 100644 --- a/tests/regression/06-symbeq/14-list_entry_rc.t +++ b/tests/regression/06-symbeq/14-list_entry_rc.t @@ -6,10 +6,10 @@ dead: 0 total lines: 23 [Warning][Race] Memory location (alloc@sid:29@tid:[main])[?].datum (race with conf. 110): (14-list_entry_rc.c:41:3-41:35) - write with thread:[main, t_fun@14-list_entry_rc.c:45:3-45:40#top] (conf. 110) (exp: & s->datum) (14-list_entry_rc.c:27:3-27:13) - write with [mhp:{created={[main, t_fun@14-list_entry_rc.c:45:3-45:40#top]}}, thread:[main]] (conf. 110) (exp: & s->datum) (14-list_entry_rc.c:27:3-27:13) - read with thread:[main, t_fun@14-list_entry_rc.c:45:3-45:40#top] (conf. 110) (exp: & s->datum) (14-list_entry_rc.c:27:3-27:13) - read with [mhp:{created={[main, t_fun@14-list_entry_rc.c:45:3-45:40#top]}}, thread:[main]] (conf. 110) (exp: & s->datum) (14-list_entry_rc.c:27:3-27:13) + write with thread:[main, t_fun@14-list_entry_rc.c:45:3-45:40] (conf. 110) (exp: & s->datum) (14-list_entry_rc.c:27:3-27:13) + write with [mhp:{created={[main, t_fun@14-list_entry_rc.c:45:3-45:40]}}, thread:[main]] (conf. 110) (exp: & s->datum) (14-list_entry_rc.c:27:3-27:13) + read with thread:[main, t_fun@14-list_entry_rc.c:45:3-45:40] (conf. 110) (exp: & s->datum) (14-list_entry_rc.c:27:3-27:13) + read with [mhp:{created={[main, t_fun@14-list_entry_rc.c:45:3-45:40]}}, thread:[main]] (conf. 110) (exp: & s->datum) (14-list_entry_rc.c:27:3-27:13) [Info][Race] Memory locations race summary: safe: 1 vulnerable: 0 diff --git a/tests/regression/06-symbeq/16-type_rc.t b/tests/regression/06-symbeq/16-type_rc.t index 3b97fac458..0d2a3fbb8c 100644 --- a/tests/regression/06-symbeq/16-type_rc.t +++ b/tests/regression/06-symbeq/16-type_rc.t @@ -6,8 +6,8 @@ Disable info messages because race summary contains (safe) memory location count [Warning][Behavior > Undefined > NullPointerDereference][CWE-476] May dereference NULL pointer (16-type_rc.c:33:3-33:16) [Warning][Behavior > Undefined > NullPointerDereference][CWE-476] May dereference NULL pointer (16-type_rc.c:36:3-36:9) [Warning][Race] Memory location (struct s).datum (race with conf. 100): - write with thread:[main, t_fun@16-type_rc.c:35:3-35:37#top] (conf. 100) (exp: & s->datum) (16-type_rc.c:21:3-21:15) - write with [mhp:{created={[main, t_fun@16-type_rc.c:35:3-35:37#top]}}, thread:[main]] (conf. 100) (exp: & *d) (16-type_rc.c:36:3-36:9) + write with thread:[main, t_fun@16-type_rc.c:35:3-35:37] (conf. 100) (exp: & s->datum) (16-type_rc.c:21:3-21:15) + write with [mhp:{created={[main, t_fun@16-type_rc.c:35:3-35:37]}}, thread:[main]] (conf. 100) (exp: & *d) (16-type_rc.c:36:3-36:9) [Error][Imprecise][Unsound] Function definition missing for get_s (16-type_rc.c:20:12-20:24) [Error][Imprecise][Unsound] Function definition missing for get_s (16-type_rc.c:31:3-31:14) [Error][Imprecise][Unsound] Function definition missing @@ -18,7 +18,7 @@ Disable info messages because race summary contains (safe) memory location count [Warning][Behavior > Undefined > NullPointerDereference][CWE-476] May dereference NULL pointer (16-type_rc.c:33:3-33:16) [Warning][Behavior > Undefined > NullPointerDereference][CWE-476] May dereference NULL pointer (16-type_rc.c:36:3-36:9) [Success][Race] Memory location (struct s).datum (safe): - write with thread:[main, t_fun@16-type_rc.c:35:3-35:37#top] (conf. 100) (exp: & s->datum) (16-type_rc.c:21:3-21:15) + write with thread:[main, t_fun@16-type_rc.c:35:3-35:37] (conf. 100) (exp: & s->datum) (16-type_rc.c:21:3-21:15) [Error][Imprecise][Unsound] Function definition missing for get_s (16-type_rc.c:20:12-20:24) [Error][Imprecise][Unsound] Function definition missing for get_s (16-type_rc.c:31:3-31:14) [Error][Imprecise][Unsound] Function definition missing diff --git a/tests/regression/06-symbeq/21-mult_accs_rc.t b/tests/regression/06-symbeq/21-mult_accs_rc.t index 24b9217bac..0fde1255c6 100644 --- a/tests/regression/06-symbeq/21-mult_accs_rc.t +++ b/tests/regression/06-symbeq/21-mult_accs_rc.t @@ -8,8 +8,8 @@ Disable info messages because race summary contains (safe) memory location count [Warning][Behavior > Undefined > NullPointerDereference][CWE-476] May dereference NULL pointer (21-mult_accs_rc.c:29:3-29:15) [Warning][Behavior > Undefined > NullPointerDereference][CWE-476] May dereference NULL pointer (21-mult_accs_rc.c:34:3-34:9) [Warning][Race] Memory location (struct s).data (race with conf. 100): - write with thread:[main, t_fun@21-mult_accs_rc.c:31:3-31:37#top] (conf. 100) (exp: & s->data) (21-mult_accs_rc.c:16:3-16:14) - write with [symblock:{p-lock:*.mutex}, mhp:{created={[main, t_fun@21-mult_accs_rc.c:31:3-31:37#top]}}, thread:[main]] (conf. 100) (exp: & *d) (21-mult_accs_rc.c:34:3-34:9) + write with thread:[main, t_fun@21-mult_accs_rc.c:31:3-31:37] (conf. 100) (exp: & s->data) (21-mult_accs_rc.c:16:3-16:14) + write with [symblock:{p-lock:*.mutex}, mhp:{created={[main, t_fun@21-mult_accs_rc.c:31:3-31:37]}}, thread:[main]] (conf. 100) (exp: & *d) (21-mult_accs_rc.c:34:3-34:9) [Warning][Unknown] unlocking mutex (NULL) which may not be held (21-mult_accs_rc.c:35:3-35:26) [Warning][Unknown] unlocking unknown mutex which may not be held (21-mult_accs_rc.c:35:3-35:26) [Error][Imprecise][Unsound] Function definition missing for get_s (21-mult_accs_rc.c:13:3-13:14) @@ -25,7 +25,7 @@ Disable info messages because race summary contains (safe) memory location count [Warning][Behavior > Undefined > NullPointerDereference][CWE-476] May dereference NULL pointer (21-mult_accs_rc.c:29:3-29:15) [Warning][Behavior > Undefined > NullPointerDereference][CWE-476] May dereference NULL pointer (21-mult_accs_rc.c:34:3-34:9) [Success][Race] Memory location (struct s).data (safe): - write with thread:[main, t_fun@21-mult_accs_rc.c:31:3-31:37#top] (conf. 100) (exp: & s->data) (21-mult_accs_rc.c:16:3-16:14) + write with thread:[main, t_fun@21-mult_accs_rc.c:31:3-31:37] (conf. 100) (exp: & s->data) (21-mult_accs_rc.c:16:3-16:14) [Warning][Unknown] unlocking mutex (NULL) which may not be held (21-mult_accs_rc.c:35:3-35:26) [Warning][Unknown] unlocking unknown mutex which may not be held (21-mult_accs_rc.c:35:3-35:26) [Error][Imprecise][Unsound] Function definition missing for get_s (21-mult_accs_rc.c:13:3-13:14) From 26868412a7bf5e32c393aff0a43c289fdcf9c134 Mon Sep 17 00:00:00 2001 From: Karoliine Holter Date: Wed, 3 Jan 2024 16:23:33 +0200 Subject: [PATCH 22/35] Do not show excessive top thread id uniqueness counter in warnings --- src/cdomains/threadIdDomain.ml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/cdomains/threadIdDomain.ml b/src/cdomains/threadIdDomain.ml index 85f9a0297b..4a8dbf8632 100644 --- a/src/cdomains/threadIdDomain.ml +++ b/src/cdomains/threadIdDomain.ml @@ -56,10 +56,13 @@ struct (struct let name = "no node" end)) let show = function - | (f, Some (n, i)) -> + | (f, Some (n, Some i)) -> f.vname - ^ "@" ^ (CilType.Location.show (UpdateCil.getLoc n)) - ^ "#" ^ Option.fold ~none:"top" ~some:string_of_int i + ^ "@" ^ CilType.Location.show (UpdateCil.getLoc n) + ^ "#" ^ string_of_int i + | (f, Some (n, None)) -> + f.vname + ^ "@" ^ CilType.Location.show (UpdateCil.getLoc n) | (f, None) -> f.vname include Printable.SimpleShow ( From 51dfd45c65f0df62c1775a6c37b4bc6ed3caf33b Mon Sep 17 00:00:00 2001 From: Karoliine Holter Date: Wed, 10 Jan 2024 12:06:03 +0200 Subject: [PATCH 23/35] Make printXml functions consistent with show and pretty --- src/cdomains/intDomain.ml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/cdomains/intDomain.ml b/src/cdomains/intDomain.ml index 492a0890e0..1714324750 100644 --- a/src/cdomains/intDomain.ml +++ b/src/cdomains/intDomain.ml @@ -418,7 +418,11 @@ struct else I.pretty () x.v (* TODO add ikind to output *) let pretty_diff () (x, y) = I.pretty_diff () (x.v, y.v) (* TODO check ikinds, add them to output *) - let printXml o x = I.printXml o x.v (* TODO add ikind to output *) + let printXml o x = + if I.is_top_of x.ikind x.v then + BatPrintf.fprintf o "\n\n⊤\n\n\n" + else + I.printXml o x.v (* TODO add ikind to output *) (* This is for debugging *) let name () = "IntDomLifter(" ^ (I.name ()) ^ ")" let to_yojson x = I.to_yojson x.v @@ -3833,7 +3837,10 @@ module IntDomTupleImpl = struct (* printing boilerplate *) let pretty_diff () (x,y) = dprintf "%a instead of %a" pretty x pretty y - let printXml f x = BatPrintf.fprintf f "\n\n%s\n\n\n" (show x) + let printXml f x = + match to_int x with + | Some v -> BatPrintf.fprintf f "\n\n%s\n\n\n" (BI.to_string v) + | None -> BatPrintf.fprintf f "\n\n%s\n\n\n" (show x) let invariant_ikind e ik x = match to_int x with From 2cc5e7dfeb34ef0dd14b7858fbcfe98768d509dc Mon Sep 17 00:00:00 2001 From: Karoliine Holter Date: Tue, 13 Feb 2024 16:53:00 +0200 Subject: [PATCH 24/35] Replace sid-s in cram tests for macos tests to pass --- tests/regression/02-base/87-casts-dep-on-param.t | 6 +++--- tests/regression/06-symbeq/14-list_entry_rc.t | 6 +++--- tests/regression/45-escape/51-fresh-global.t | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/tests/regression/02-base/87-casts-dep-on-param.t b/tests/regression/02-base/87-casts-dep-on-param.t index 461be05be5..aedbf11bcf 100644 --- a/tests/regression/02-base/87-casts-dep-on-param.t +++ b/tests/regression/02-base/87-casts-dep-on-param.t @@ -1,9 +1,9 @@ - $ goblint --set ana.activated "['base', 'mallocWrapper']" --set ana.ctx_insens[+] 'base' --set ana.ctx_insens[+] 'mallocWrapper' --set ana.base.privatization none --enable warn.debug 87-casts-dep-on-param.c + $ goblint --set ana.activated "['base', 'mallocWrapper']" --set ana.ctx_insens[+] 'base' --set ana.ctx_insens[+] 'mallocWrapper' --set ana.base.privatization none --enable warn.debug 87-casts-dep-on-param.c | sed -r 's/sid:[0-9]+/sid:$SID/' Option warning: Without thread escape analysis, every local variable whose address is taken is considered escaped, i.e., global! [Info][Unsound] Unknown address in {&i} has escaped. (87-casts-dep-on-param.c:11:3-11:11) [Info][Unsound] Unknown value in {?} could be an escaped pointer address! (87-casts-dep-on-param.c:11:3-11:11) - [Debug][Analyzer] Base EvalInt i query answering bot instead of {?, NULL, &(alloc@sid:22)} (87-casts-dep-on-param.c:13:7-13:15) - [Debug][Analyzer] Base EvalInt i query answering bot instead of {?, NULL, &(alloc@sid:22)} (87-casts-dep-on-param.c:14:3-14:11) + [Debug][Analyzer] Base EvalInt i query answering bot instead of {?, NULL, &(alloc@sid:$SID)} (87-casts-dep-on-param.c:13:7-13:15) + [Debug][Analyzer] Base EvalInt i query answering bot instead of {?, NULL, &(alloc@sid:$SID)} (87-casts-dep-on-param.c:14:3-14:11) [Info][Unsound] Unknown address in {&p} has escaped. (87-casts-dep-on-param.c:17:7-17:19) [Info][Unsound] Unknown address in {&i} has escaped. (87-casts-dep-on-param.c:17:7-17:19) [Info][Unsound] Unknown value in {?} could be an escaped pointer address! (87-casts-dep-on-param.c:17:7-17:19) diff --git a/tests/regression/06-symbeq/14-list_entry_rc.t b/tests/regression/06-symbeq/14-list_entry_rc.t index e06d043547..087afda10d 100644 --- a/tests/regression/06-symbeq/14-list_entry_rc.t +++ b/tests/regression/06-symbeq/14-list_entry_rc.t @@ -1,11 +1,11 @@ - $ goblint --enable ana.race.direct-arithmetic --set ana.activated[+] "'var_eq'" --set ana.activated[+] "'symb_locks'" 14-list_entry_rc.c + $ goblint --enable ana.race.direct-arithmetic --set ana.activated[+] "'var_eq'" --set ana.activated[+] "'symb_locks'" 14-list_entry_rc.c | sed -r 's/sid:[0-9]+/sid:$SID/' [Info][Imprecise] Invalidating expressions: & mutexattr (14-list_entry_rc.c:37:3-37:37) - [Warning][Unknown] unlocking mutex ((alloc@sid:29@tid:[main])[1].mutex) which may not be held (14-list_entry_rc.c:28:3-28:34) + [Warning][Unknown] unlocking mutex ((alloc@sid:$SID@tid:[main])[1].mutex) which may not be held (14-list_entry_rc.c:28:3-28:34) [Info][Deadcode] Logical lines of code (LLoC) summary: live: 23 dead: 0 total lines: 23 - [Warning][Race] Memory location (alloc@sid:29@tid:[main])[?].datum (race with conf. 110): (14-list_entry_rc.c:41:3-41:35) + [Warning][Race] Memory location (alloc@sid:$SID@tid:[main])[?].datum (race with conf. 110): (14-list_entry_rc.c:41:3-41:35) write with thread:[main, t_fun@14-list_entry_rc.c:45:3-45:40] (conf. 110) (exp: & s->datum) (14-list_entry_rc.c:27:3-27:13) write with [mhp:{created={[main, t_fun@14-list_entry_rc.c:45:3-45:40]}}, thread:[main]] (conf. 110) (exp: & s->datum) (14-list_entry_rc.c:27:3-27:13) read with thread:[main, t_fun@14-list_entry_rc.c:45:3-45:40] (conf. 110) (exp: & s->datum) (14-list_entry_rc.c:27:3-27:13) diff --git a/tests/regression/45-escape/51-fresh-global.t b/tests/regression/45-escape/51-fresh-global.t index 233862a9b5..886af7b25d 100644 --- a/tests/regression/45-escape/51-fresh-global.t +++ b/tests/regression/45-escape/51-fresh-global.t @@ -1,9 +1,9 @@ - $ goblint --set ana.activated[+] mallocFresh --set ana.activated[-] mhp --set ana.thread.domain plain 51-fresh-global.c + $ goblint --set ana.activated[+] mallocFresh --set ana.activated[-] mhp --set ana.thread.domain plain 51-fresh-global.c | sed -r 's/sid:[0-9]+/sid:$SID/' [Info][Deadcode] Logical lines of code (LLoC) summary: live: 15 dead: 0 total lines: 15 - [Warning][Race] Memory location (alloc@sid:21@tid:main) (race with conf. 110): (51-fresh-global.c:25:7-25:31) + [Warning][Race] Memory location (alloc@sid:$SID@tid:main) (race with conf. 110): (51-fresh-global.c:25:7-25:31) write with lock:{A} (conf. 110) (exp: & *i) (51-fresh-global.c:10:3-10:10) write with thread:main (conf. 110) (exp: & *i) (51-fresh-global.c:27:3-27:9) [Info][Race] Memory locations race summary: From 5a397bc4d62b037a17d0a4fb631f5ada05fa0b19 Mon Sep 17 00:00:00 2001 From: Karoliine Holter Date: Tue, 13 Feb 2024 18:37:04 +0200 Subject: [PATCH 25/35] Add dbg.full-output option for getting 'old' output --- src/config/options.schema.json | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/config/options.schema.json b/src/config/options.schema.json index 30bc4f3d8c..409068f061 100644 --- a/src/config/options.schema.json +++ b/src/config/options.schema.json @@ -2036,6 +2036,12 @@ "Should the analysis call Check.checkFile after creating the CFG (helpful to verify that transformations respect CIL's invariants.", "type": "boolean", "default": false + }, + "full-output": { + "title": "dbg.full-output", + "description": "Should the analysis print full output?", + "type": "boolean", + "default": false } }, "additionalProperties": false From 6f83a806a30fb4009be26a39320c3ed094126f59 Mon Sep 17 00:00:00 2001 From: Karoliine Holter Date: Tue, 13 Feb 2024 18:39:10 +0200 Subject: [PATCH 26/35] Add cram tests with dbg.full-output for testing mhp, thread ID and malloc old outputs --- tests/regression/04-mutex/01-simple_rc.t | 16 +++++++ .../regression/04-mutex/49-type-invariants.t | 46 +++++++++++++++++++ .../04-mutex/77-type-nested-fields.t | 27 +++++++++++ .../04-mutex/79-type-nested-fields-deep1.t | 27 +++++++++++ .../04-mutex/80-type-nested-fields-deep2.t | 27 +++++++++++ .../04-mutex/84-distribute-fields-1.t | 16 +++++++ .../04-mutex/85-distribute-fields-2.t | 16 +++++++ .../04-mutex/86-distribute-fields-3.t | 16 +++++++ .../04-mutex/87-distribute-fields-4.t | 14 ++++++ .../04-mutex/88-distribute-fields-5.t | 14 ++++++ .../04-mutex/89-distribute-fields-6.t | 14 ++++++ .../04-mutex/90-distribute-fields-type-1.t | 29 ++++++++++++ .../04-mutex/91-distribute-fields-type-2.t | 29 ++++++++++++ .../04-mutex/92-distribute-fields-type-deep.t | 29 ++++++++++++ .../93-distribute-fields-type-global.t | 25 ++++++++++ tests/regression/06-symbeq/16-type_rc.t | 23 ++++++++++ tests/regression/06-symbeq/21-mult_accs_rc.t | 33 +++++++++++++ 17 files changed, 401 insertions(+) diff --git a/tests/regression/04-mutex/01-simple_rc.t b/tests/regression/04-mutex/01-simple_rc.t index 53be4227f0..33a74d0f0b 100644 --- a/tests/regression/04-mutex/01-simple_rc.t +++ b/tests/regression/04-mutex/01-simple_rc.t @@ -13,3 +13,19 @@ live: 12 dead: 0 total lines: 12 + + $ goblint --enable warn.deterministic --enable dbg.full-output 01-simple_rc.c + [Warning][Race] Memory location myglobal (race with conf. 110): (01-simple_rc.c:4:5-4:13) + write with [mhp:{tid=[main, t_fun@01-simple_rc.c:17:3-17:40#top]}, lock:{mutex1}, thread:[main, t_fun@01-simple_rc.c:17:3-17:40#top]] (conf. 110) (exp: & myglobal) (01-simple_rc.c:10:3-10:22) + write with [mhp:{tid=[main]; created={[main, t_fun@01-simple_rc.c:17:3-17:40#top]}}, lock:{mutex2}, thread:[main]] (conf. 110) (exp: & myglobal) (01-simple_rc.c:19:3-19:22) + read with [mhp:{tid=[main, t_fun@01-simple_rc.c:17:3-17:40#top]}, lock:{mutex1}, thread:[main, t_fun@01-simple_rc.c:17:3-17:40#top]] (conf. 110) (exp: & myglobal) (01-simple_rc.c:10:3-10:22) + read with [mhp:{tid=[main]; created={[main, t_fun@01-simple_rc.c:17:3-17:40#top]}}, lock:{mutex2}, thread:[main]] (conf. 110) (exp: & myglobal) (01-simple_rc.c:19:3-19:22) + [Info][Race] Memory locations race summary: + safe: 0 + vulnerable: 0 + unsafe: 1 + total memory locations: 1 + [Info][Deadcode] Logical lines of code (LLoC) summary: + live: 12 + dead: 0 + total lines: 12 diff --git a/tests/regression/04-mutex/49-type-invariants.t b/tests/regression/04-mutex/49-type-invariants.t index f96dc9f9a9..be610e1a71 100644 --- a/tests/regression/04-mutex/49-type-invariants.t +++ b/tests/regression/04-mutex/49-type-invariants.t @@ -43,3 +43,49 @@ [Info][Imprecise] Invalidating expressions: & tmp (49-type-invariants.c:21:3-21:21) [Error][Imprecise][Unsound] Function definition missing for getS (49-type-invariants.c:21:3-21:21) [Error][Imprecise][Unsound] Function definition missing + + $ goblint --enable warn.deterministic --enable ana.race.direct-arithmetic --enable allglobs --enable dbg.full-output 49-type-invariants.c + [Warning][Behavior > Undefined > NullPointerDereference][CWE-476] May dereference NULL pointer (49-type-invariants.c:21:3-21:21) + [Warning][Race] Memory location s.field (race with conf. 110): (49-type-invariants.c:8:10-8:11) + write with [mhp:{tid=[main]; created={[main, t_fun@49-type-invariants.c:20:3-20:40#top]}}, thread:[main]] (conf. 100) (exp: & tmp->field) (49-type-invariants.c:21:3-21:21) + read with [mhp:{tid=[main, t_fun@49-type-invariants.c:20:3-20:40#top]}, thread:[main, t_fun@49-type-invariants.c:20:3-20:40#top]] (conf. 110) (exp: & s.field) (49-type-invariants.c:11:3-11:23) + [Info][Race] Memory locations race summary: + safe: 1 + vulnerable: 0 + unsafe: 1 + total memory locations: 2 + [Success][Race] Memory location (struct S).field (safe): + write with [mhp:{tid=[main]; created={[main, t_fun@49-type-invariants.c:20:3-20:40#top]}}, thread:[main]] (conf. 100) (exp: & tmp->field) (49-type-invariants.c:21:3-21:21) + [Info][Deadcode] Logical lines of code (LLoC) summary: + live: 7 + dead: 0 + total lines: 7 + [Info][Unsound] Write to unknown address: privatization is unsound. (49-type-invariants.c:21:3-21:21) + [Info][Imprecise] INVALIDATING ALL GLOBALS! (49-type-invariants.c:21:3-21:21) + [Info][Imprecise] Invalidating expressions: & s (49-type-invariants.c:21:3-21:21) + [Info][Imprecise] Invalidating expressions: & tmp (49-type-invariants.c:21:3-21:21) + [Error][Imprecise][Unsound] Function definition missing for getS (49-type-invariants.c:21:3-21:21) + [Error][Imprecise][Unsound] Function definition missing + + $ goblint --enable warn.deterministic --disable ana.race.direct-arithmetic --enable allglobs --enable dbg.full-output 49-type-invariants.c + [Warning][Behavior > Undefined > NullPointerDereference][CWE-476] May dereference NULL pointer (49-type-invariants.c:21:3-21:21) + [Warning][Race] Memory location s.field (race with conf. 110): (49-type-invariants.c:8:10-8:11) + write with [mhp:{tid=[main]; created={[main, t_fun@49-type-invariants.c:20:3-20:40#top]}}, thread:[main]] (conf. 100) (exp: & tmp->field) (49-type-invariants.c:21:3-21:21) + read with [mhp:{tid=[main, t_fun@49-type-invariants.c:20:3-20:40#top]}, thread:[main, t_fun@49-type-invariants.c:20:3-20:40#top]] (conf. 110) (exp: & s.field) (49-type-invariants.c:11:3-11:23) + [Info][Race] Memory locations race summary: + safe: 1 + vulnerable: 0 + unsafe: 1 + total memory locations: 2 + [Success][Race] Memory location (struct S).field (safe): + write with [mhp:{tid=[main]; created={[main, t_fun@49-type-invariants.c:20:3-20:40#top]}}, thread:[main]] (conf. 100) (exp: & tmp->field) (49-type-invariants.c:21:3-21:21) + [Info][Deadcode] Logical lines of code (LLoC) summary: + live: 7 + dead: 0 + total lines: 7 + [Info][Unsound] Write to unknown address: privatization is unsound. (49-type-invariants.c:21:3-21:21) + [Info][Imprecise] INVALIDATING ALL GLOBALS! (49-type-invariants.c:21:3-21:21) + [Info][Imprecise] Invalidating expressions: & s (49-type-invariants.c:21:3-21:21) + [Info][Imprecise] Invalidating expressions: & tmp (49-type-invariants.c:21:3-21:21) + [Error][Imprecise][Unsound] Function definition missing for getS (49-type-invariants.c:21:3-21:21) + [Error][Imprecise][Unsound] Function definition missing diff --git a/tests/regression/04-mutex/77-type-nested-fields.t b/tests/regression/04-mutex/77-type-nested-fields.t index e069381944..1dcd624228 100644 --- a/tests/regression/04-mutex/77-type-nested-fields.t +++ b/tests/regression/04-mutex/77-type-nested-fields.t @@ -24,3 +24,30 @@ [Error][Imprecise][Unsound] Function definition missing for getS (77-type-nested-fields.c:31:3-31:20) [Error][Imprecise][Unsound] Function definition missing for getT (77-type-nested-fields.c:38:3-38:22) [Error][Imprecise][Unsound] Function definition missing + + $ goblint --enable warn.deterministic --enable allglobs --enable dbg.full-output 77-type-nested-fields.c + [Warning][Behavior > Undefined > NullPointerDereference][CWE-476] May dereference NULL pointer (77-type-nested-fields.c:31:3-31:20) + [Warning][Behavior > Undefined > NullPointerDereference][CWE-476] May dereference NULL pointer (77-type-nested-fields.c:38:3-38:22) + [Warning][Race] Memory location (struct T).s.field (race with conf. 100): + write with [mhp:{tid=[main, t_fun@77-type-nested-fields.c:37:3-37:40#top]}, thread:[main, t_fun@77-type-nested-fields.c:37:3-37:40#top]] (conf. 100) (exp: & tmp->field) (77-type-nested-fields.c:31:3-31:20) + write with [mhp:{tid=[main]; created={[main, t_fun@77-type-nested-fields.c:37:3-37:40#top]}}, thread:[main]] (conf. 100) (exp: & tmp->s.field) (77-type-nested-fields.c:38:3-38:22) + [Info][Race] Memory locations race summary: + safe: 1 + vulnerable: 0 + unsafe: 1 + total memory locations: 2 + [Success][Race] Memory location (struct S).field (safe): + write with [mhp:{tid=[main, t_fun@77-type-nested-fields.c:37:3-37:40#top]}, thread:[main, t_fun@77-type-nested-fields.c:37:3-37:40#top]] (conf. 100) (exp: & tmp->field) (77-type-nested-fields.c:31:3-31:20) + [Info][Deadcode] Logical lines of code (LLoC) summary: + live: 7 + dead: 0 + total lines: 7 + [Info][Unsound] Write to unknown address: privatization is unsound. (77-type-nested-fields.c:31:3-31:20) + [Info][Unsound] Write to unknown address: privatization is unsound. (77-type-nested-fields.c:38:3-38:22) + [Info][Imprecise] INVALIDATING ALL GLOBALS! (77-type-nested-fields.c:31:3-31:20) + [Info][Imprecise] Invalidating expressions: & tmp (77-type-nested-fields.c:31:3-31:20) + [Info][Imprecise] INVALIDATING ALL GLOBALS! (77-type-nested-fields.c:38:3-38:22) + [Info][Imprecise] Invalidating expressions: & tmp (77-type-nested-fields.c:38:3-38:22) + [Error][Imprecise][Unsound] Function definition missing for getS (77-type-nested-fields.c:31:3-31:20) + [Error][Imprecise][Unsound] Function definition missing for getT (77-type-nested-fields.c:38:3-38:22) + [Error][Imprecise][Unsound] Function definition missing diff --git a/tests/regression/04-mutex/79-type-nested-fields-deep1.t b/tests/regression/04-mutex/79-type-nested-fields-deep1.t index 3049eb672d..d7e40edaa1 100644 --- a/tests/regression/04-mutex/79-type-nested-fields-deep1.t +++ b/tests/regression/04-mutex/79-type-nested-fields-deep1.t @@ -24,3 +24,30 @@ [Error][Imprecise][Unsound] Function definition missing for getS (79-type-nested-fields-deep1.c:36:3-36:20) [Error][Imprecise][Unsound] Function definition missing for getU (79-type-nested-fields-deep1.c:43:3-43:24) [Error][Imprecise][Unsound] Function definition missing + + $ goblint --enable warn.deterministic --enable allglobs --enable dbg.full-output 79-type-nested-fields-deep1.c + [Warning][Behavior > Undefined > NullPointerDereference][CWE-476] May dereference NULL pointer (79-type-nested-fields-deep1.c:36:3-36:20) + [Warning][Behavior > Undefined > NullPointerDereference][CWE-476] May dereference NULL pointer (79-type-nested-fields-deep1.c:43:3-43:24) + [Warning][Race] Memory location (struct U).t.s.field (race with conf. 100): + write with [mhp:{tid=[main, t_fun@79-type-nested-fields-deep1.c:42:3-42:40#top]}, thread:[main, t_fun@79-type-nested-fields-deep1.c:42:3-42:40#top]] (conf. 100) (exp: & tmp->field) (79-type-nested-fields-deep1.c:36:3-36:20) + write with [mhp:{tid=[main]; created={[main, t_fun@79-type-nested-fields-deep1.c:42:3-42:40#top]}}, thread:[main]] (conf. 100) (exp: & tmp->t.s.field) (79-type-nested-fields-deep1.c:43:3-43:24) + [Info][Race] Memory locations race summary: + safe: 1 + vulnerable: 0 + unsafe: 1 + total memory locations: 2 + [Success][Race] Memory location (struct S).field (safe): + write with [mhp:{tid=[main, t_fun@79-type-nested-fields-deep1.c:42:3-42:40#top]}, thread:[main, t_fun@79-type-nested-fields-deep1.c:42:3-42:40#top]] (conf. 100) (exp: & tmp->field) (79-type-nested-fields-deep1.c:36:3-36:20) + [Info][Deadcode] Logical lines of code (LLoC) summary: + live: 7 + dead: 0 + total lines: 7 + [Info][Unsound] Write to unknown address: privatization is unsound. (79-type-nested-fields-deep1.c:36:3-36:20) + [Info][Unsound] Write to unknown address: privatization is unsound. (79-type-nested-fields-deep1.c:43:3-43:24) + [Info][Imprecise] INVALIDATING ALL GLOBALS! (79-type-nested-fields-deep1.c:36:3-36:20) + [Info][Imprecise] Invalidating expressions: & tmp (79-type-nested-fields-deep1.c:36:3-36:20) + [Info][Imprecise] INVALIDATING ALL GLOBALS! (79-type-nested-fields-deep1.c:43:3-43:24) + [Info][Imprecise] Invalidating expressions: & tmp (79-type-nested-fields-deep1.c:43:3-43:24) + [Error][Imprecise][Unsound] Function definition missing for getS (79-type-nested-fields-deep1.c:36:3-36:20) + [Error][Imprecise][Unsound] Function definition missing for getU (79-type-nested-fields-deep1.c:43:3-43:24) + [Error][Imprecise][Unsound] Function definition missing diff --git a/tests/regression/04-mutex/80-type-nested-fields-deep2.t b/tests/regression/04-mutex/80-type-nested-fields-deep2.t index 02cb54e348..b102b3adf3 100644 --- a/tests/regression/04-mutex/80-type-nested-fields-deep2.t +++ b/tests/regression/04-mutex/80-type-nested-fields-deep2.t @@ -24,3 +24,30 @@ [Error][Imprecise][Unsound] Function definition missing for getT (80-type-nested-fields-deep2.c:36:3-36:22) [Error][Imprecise][Unsound] Function definition missing for getU (80-type-nested-fields-deep2.c:43:3-43:24) [Error][Imprecise][Unsound] Function definition missing + + $ goblint --enable warn.deterministic --enable allglobs --enable dbg.full-output 80-type-nested-fields-deep2.c + [Warning][Behavior > Undefined > NullPointerDereference][CWE-476] May dereference NULL pointer (80-type-nested-fields-deep2.c:36:3-36:22) + [Warning][Behavior > Undefined > NullPointerDereference][CWE-476] May dereference NULL pointer (80-type-nested-fields-deep2.c:43:3-43:24) + [Warning][Race] Memory location (struct U).t.s.field (race with conf. 100): + write with [mhp:{tid=[main, t_fun@80-type-nested-fields-deep2.c:42:3-42:40#top]}, thread:[main, t_fun@80-type-nested-fields-deep2.c:42:3-42:40#top]] (conf. 100) (exp: & tmp->s.field) (80-type-nested-fields-deep2.c:36:3-36:22) + write with [mhp:{tid=[main]; created={[main, t_fun@80-type-nested-fields-deep2.c:42:3-42:40#top]}}, thread:[main]] (conf. 100) (exp: & tmp->t.s.field) (80-type-nested-fields-deep2.c:43:3-43:24) + [Info][Race] Memory locations race summary: + safe: 1 + vulnerable: 0 + unsafe: 1 + total memory locations: 2 + [Success][Race] Memory location (struct T).s.field (safe): + write with [mhp:{tid=[main, t_fun@80-type-nested-fields-deep2.c:42:3-42:40#top]}, thread:[main, t_fun@80-type-nested-fields-deep2.c:42:3-42:40#top]] (conf. 100) (exp: & tmp->s.field) (80-type-nested-fields-deep2.c:36:3-36:22) + [Info][Deadcode] Logical lines of code (LLoC) summary: + live: 7 + dead: 0 + total lines: 7 + [Info][Unsound] Write to unknown address: privatization is unsound. (80-type-nested-fields-deep2.c:36:3-36:22) + [Info][Unsound] Write to unknown address: privatization is unsound. (80-type-nested-fields-deep2.c:43:3-43:24) + [Info][Imprecise] INVALIDATING ALL GLOBALS! (80-type-nested-fields-deep2.c:36:3-36:22) + [Info][Imprecise] Invalidating expressions: & tmp (80-type-nested-fields-deep2.c:36:3-36:22) + [Info][Imprecise] INVALIDATING ALL GLOBALS! (80-type-nested-fields-deep2.c:43:3-43:24) + [Info][Imprecise] Invalidating expressions: & tmp (80-type-nested-fields-deep2.c:43:3-43:24) + [Error][Imprecise][Unsound] Function definition missing for getT (80-type-nested-fields-deep2.c:36:3-36:22) + [Error][Imprecise][Unsound] Function definition missing for getU (80-type-nested-fields-deep2.c:43:3-43:24) + [Error][Imprecise][Unsound] Function definition missing diff --git a/tests/regression/04-mutex/84-distribute-fields-1.t b/tests/regression/04-mutex/84-distribute-fields-1.t index fbc723c6b6..df2aecf6c3 100644 --- a/tests/regression/04-mutex/84-distribute-fields-1.t +++ b/tests/regression/04-mutex/84-distribute-fields-1.t @@ -13,3 +13,19 @@ live: 8 dead: 0 total lines: 8 + + $ goblint --enable warn.deterministic --enable allglobs --enable dbg.full-output 84-distribute-fields-1.c + [Warning][Race] Memory location s.data (race with conf. 110): (84-distribute-fields-1.c:9:10-9:11) + write with [mhp:{tid=[main, t_fun@84-distribute-fields-1.c:18:3-18:40#top]}, thread:[main, t_fun@84-distribute-fields-1.c:18:3-18:40#top]] (conf. 110) (exp: & s.data) (84-distribute-fields-1.c:12:3-12:13) + write with [mhp:{tid=[main]; created={[main, t_fun@84-distribute-fields-1.c:18:3-18:40#top]}}, thread:[main]] (conf. 110) (exp: & s) (84-distribute-fields-1.c:20:3-20:9) + [Info][Race] Memory locations race summary: + safe: 1 + vulnerable: 0 + unsafe: 1 + total memory locations: 2 + [Success][Race] Memory location s (safe): (84-distribute-fields-1.c:9:10-9:11) + write with [mhp:{tid=[main]; created={[main, t_fun@84-distribute-fields-1.c:18:3-18:40#top]}}, thread:[main]] (conf. 110) (exp: & s) (84-distribute-fields-1.c:20:3-20:9) + [Info][Deadcode] Logical lines of code (LLoC) summary: + live: 8 + dead: 0 + total lines: 8 diff --git a/tests/regression/04-mutex/85-distribute-fields-2.t b/tests/regression/04-mutex/85-distribute-fields-2.t index aedf5fea72..239348a2f0 100644 --- a/tests/regression/04-mutex/85-distribute-fields-2.t +++ b/tests/regression/04-mutex/85-distribute-fields-2.t @@ -13,3 +13,19 @@ live: 8 dead: 0 total lines: 8 + + $ goblint --enable warn.deterministic --enable allglobs --enable dbg.full-output 85-distribute-fields-2.c + [Warning][Race] Memory location t.s.data (race with conf. 110): (85-distribute-fields-2.c:15:10-15:11) + write with [mhp:{tid=[main, t_fun@85-distribute-fields-2.c:24:3-24:40#top]}, thread:[main, t_fun@85-distribute-fields-2.c:24:3-24:40#top]] (conf. 110) (exp: & t.s.data) (85-distribute-fields-2.c:18:3-18:15) + write with [mhp:{tid=[main]; created={[main, t_fun@85-distribute-fields-2.c:24:3-24:40#top]}}, thread:[main]] (conf. 110) (exp: & t.s) (85-distribute-fields-2.c:26:3-26:11) + [Info][Race] Memory locations race summary: + safe: 1 + vulnerable: 0 + unsafe: 1 + total memory locations: 2 + [Success][Race] Memory location t.s (safe): (85-distribute-fields-2.c:15:10-15:11) + write with [mhp:{tid=[main]; created={[main, t_fun@85-distribute-fields-2.c:24:3-24:40#top]}}, thread:[main]] (conf. 110) (exp: & t.s) (85-distribute-fields-2.c:26:3-26:11) + [Info][Deadcode] Logical lines of code (LLoC) summary: + live: 8 + dead: 0 + total lines: 8 diff --git a/tests/regression/04-mutex/86-distribute-fields-3.t b/tests/regression/04-mutex/86-distribute-fields-3.t index 6c6e3a9d42..64ab44a7bd 100644 --- a/tests/regression/04-mutex/86-distribute-fields-3.t +++ b/tests/regression/04-mutex/86-distribute-fields-3.t @@ -13,3 +13,19 @@ live: 8 dead: 0 total lines: 8 + + $ goblint --enable warn.deterministic --enable allglobs --enable dbg.full-output 86-distribute-fields-3.c + [Warning][Race] Memory location t.s.data (race with conf. 110): (86-distribute-fields-3.c:15:10-15:11) + write with [mhp:{tid=[main, t_fun@86-distribute-fields-3.c:24:3-24:40#top]}, thread:[main, t_fun@86-distribute-fields-3.c:24:3-24:40#top]] (conf. 110) (exp: & t.s.data) (86-distribute-fields-3.c:18:3-18:15) + write with [mhp:{tid=[main]; created={[main, t_fun@86-distribute-fields-3.c:24:3-24:40#top]}}, thread:[main]] (conf. 110) (exp: & t) (86-distribute-fields-3.c:26:3-26:9) + [Info][Race] Memory locations race summary: + safe: 1 + vulnerable: 0 + unsafe: 1 + total memory locations: 2 + [Success][Race] Memory location t (safe): (86-distribute-fields-3.c:15:10-15:11) + write with [mhp:{tid=[main]; created={[main, t_fun@86-distribute-fields-3.c:24:3-24:40#top]}}, thread:[main]] (conf. 110) (exp: & t) (86-distribute-fields-3.c:26:3-26:9) + [Info][Deadcode] Logical lines of code (LLoC) summary: + live: 8 + dead: 0 + total lines: 8 diff --git a/tests/regression/04-mutex/87-distribute-fields-4.t b/tests/regression/04-mutex/87-distribute-fields-4.t index 024c52d6cb..8784a77a70 100644 --- a/tests/regression/04-mutex/87-distribute-fields-4.t +++ b/tests/regression/04-mutex/87-distribute-fields-4.t @@ -11,3 +11,17 @@ live: 8 dead: 0 total lines: 8 + + $ goblint --enable warn.deterministic --enable allglobs --enable dbg.full-output 87-distribute-fields-4.c + [Warning][Race] Memory location s (race with conf. 110): (87-distribute-fields-4.c:9:10-9:11) + write with [mhp:{tid=[main, t_fun@87-distribute-fields-4.c:19:3-19:40#top]}, thread:[main, t_fun@87-distribute-fields-4.c:19:3-19:40#top]] (conf. 110) (exp: & s) (87-distribute-fields-4.c:13:3-13:9) + write with [mhp:{tid=[main]; created={[main, t_fun@87-distribute-fields-4.c:19:3-19:40#top]}}, thread:[main]] (conf. 110) (exp: & s) (87-distribute-fields-4.c:21:3-21:9) + [Info][Race] Memory locations race summary: + safe: 0 + vulnerable: 0 + unsafe: 1 + total memory locations: 1 + [Info][Deadcode] Logical lines of code (LLoC) summary: + live: 8 + dead: 0 + total lines: 8 diff --git a/tests/regression/04-mutex/88-distribute-fields-5.t b/tests/regression/04-mutex/88-distribute-fields-5.t index dff8fcb135..0dd4fd52a5 100644 --- a/tests/regression/04-mutex/88-distribute-fields-5.t +++ b/tests/regression/04-mutex/88-distribute-fields-5.t @@ -11,3 +11,17 @@ live: 8 dead: 0 total lines: 8 + + $ goblint --enable warn.deterministic --enable allglobs --enable dbg.full-output 88-distribute-fields-5.c + [Warning][Race] Memory location t.s (race with conf. 110): (88-distribute-fields-5.c:15:10-15:11) + write with [mhp:{tid=[main, t_fun@88-distribute-fields-5.c:25:3-25:40#top]}, thread:[main, t_fun@88-distribute-fields-5.c:25:3-25:40#top]] (conf. 110) (exp: & t.s) (88-distribute-fields-5.c:19:3-19:11) + write with [mhp:{tid=[main]; created={[main, t_fun@88-distribute-fields-5.c:25:3-25:40#top]}}, thread:[main]] (conf. 110) (exp: & t.s) (88-distribute-fields-5.c:27:3-27:11) + [Info][Race] Memory locations race summary: + safe: 0 + vulnerable: 0 + unsafe: 1 + total memory locations: 1 + [Info][Deadcode] Logical lines of code (LLoC) summary: + live: 8 + dead: 0 + total lines: 8 diff --git a/tests/regression/04-mutex/89-distribute-fields-6.t b/tests/regression/04-mutex/89-distribute-fields-6.t index 5d9435d27e..f0a17466cd 100644 --- a/tests/regression/04-mutex/89-distribute-fields-6.t +++ b/tests/regression/04-mutex/89-distribute-fields-6.t @@ -11,3 +11,17 @@ live: 8 dead: 0 total lines: 8 + + $ goblint --enable warn.deterministic --enable allglobs --enable dbg.full-output 89-distribute-fields-6.c + [Warning][Race] Memory location t (race with conf. 110): (89-distribute-fields-6.c:15:10-15:11) + write with [mhp:{tid=[main, t_fun@89-distribute-fields-6.c:25:3-25:40#top]}, thread:[main, t_fun@89-distribute-fields-6.c:25:3-25:40#top]] (conf. 110) (exp: & t) (89-distribute-fields-6.c:19:3-19:9) + write with [mhp:{tid=[main]; created={[main, t_fun@89-distribute-fields-6.c:25:3-25:40#top]}}, thread:[main]] (conf. 110) (exp: & t) (89-distribute-fields-6.c:27:3-27:9) + [Info][Race] Memory locations race summary: + safe: 0 + vulnerable: 0 + unsafe: 1 + total memory locations: 1 + [Info][Deadcode] Logical lines of code (LLoC) summary: + live: 8 + dead: 0 + total lines: 8 diff --git a/tests/regression/04-mutex/90-distribute-fields-type-1.t b/tests/regression/04-mutex/90-distribute-fields-type-1.t index caabddc37e..ee13a1166c 100644 --- a/tests/regression/04-mutex/90-distribute-fields-type-1.t +++ b/tests/regression/04-mutex/90-distribute-fields-type-1.t @@ -26,3 +26,32 @@ [Error][Imprecise][Unsound] Function definition missing for getS (90-distribute-fields-type-1.c:31:3-31:20) [Error][Imprecise][Unsound] Function definition missing for getT (90-distribute-fields-type-1.c:39:3-39:17) [Error][Imprecise][Unsound] Function definition missing + + $ goblint --enable warn.deterministic --enable allglobs --enable dbg.full-output 90-distribute-fields-type-1.c + [Warning][Behavior > Undefined > NullPointerDereference][CWE-476] May dereference NULL pointer (90-distribute-fields-type-1.c:31:3-31:20) + [Warning][Behavior > Undefined > NullPointerDereference][CWE-476] May dereference NULL pointer (90-distribute-fields-type-1.c:39:3-39:17) + [Warning][Race] Memory location (struct T).s.field (race with conf. 100): + write with [mhp:{tid=[main, t_fun@90-distribute-fields-type-1.c:37:3-37:40#top]}, thread:[main, t_fun@90-distribute-fields-type-1.c:37:3-37:40#top]] (conf. 100) (exp: & tmp->field) (90-distribute-fields-type-1.c:31:3-31:20) + write with [mhp:{tid=[main]; created={[main, t_fun@90-distribute-fields-type-1.c:37:3-37:40#top]}}, thread:[main]] (conf. 100) (exp: & tmp->s) (90-distribute-fields-type-1.c:39:3-39:17) + [Info][Race] Memory locations race summary: + safe: 2 + vulnerable: 0 + unsafe: 1 + total memory locations: 3 + [Success][Race] Memory location (struct S).field (safe): + write with [mhp:{tid=[main, t_fun@90-distribute-fields-type-1.c:37:3-37:40#top]}, thread:[main, t_fun@90-distribute-fields-type-1.c:37:3-37:40#top]] (conf. 100) (exp: & tmp->field) (90-distribute-fields-type-1.c:31:3-31:20) + [Success][Race] Memory location (struct T).s (safe): + write with [mhp:{tid=[main]; created={[main, t_fun@90-distribute-fields-type-1.c:37:3-37:40#top]}}, thread:[main]] (conf. 100) (exp: & tmp->s) (90-distribute-fields-type-1.c:39:3-39:17) + [Info][Deadcode] Logical lines of code (LLoC) summary: + live: 7 + dead: 0 + total lines: 7 + [Info][Unsound] Write to unknown address: privatization is unsound. (90-distribute-fields-type-1.c:31:3-31:20) + [Info][Unsound] Write to unknown address: privatization is unsound. (90-distribute-fields-type-1.c:39:3-39:17) + [Info][Imprecise] INVALIDATING ALL GLOBALS! (90-distribute-fields-type-1.c:31:3-31:20) + [Info][Imprecise] Invalidating expressions: & tmp (90-distribute-fields-type-1.c:31:3-31:20) + [Info][Imprecise] INVALIDATING ALL GLOBALS! (90-distribute-fields-type-1.c:39:3-39:17) + [Info][Imprecise] Invalidating expressions: & tmp (90-distribute-fields-type-1.c:39:3-39:17) + [Error][Imprecise][Unsound] Function definition missing for getS (90-distribute-fields-type-1.c:31:3-31:20) + [Error][Imprecise][Unsound] Function definition missing for getT (90-distribute-fields-type-1.c:39:3-39:17) + [Error][Imprecise][Unsound] Function definition missing diff --git a/tests/regression/04-mutex/91-distribute-fields-type-2.t b/tests/regression/04-mutex/91-distribute-fields-type-2.t index cb21318801..fee687e61d 100644 --- a/tests/regression/04-mutex/91-distribute-fields-type-2.t +++ b/tests/regression/04-mutex/91-distribute-fields-type-2.t @@ -26,3 +26,32 @@ [Error][Imprecise][Unsound] Function definition missing for getS (91-distribute-fields-type-2.c:32:3-32:17) [Error][Imprecise][Unsound] Function definition missing for getT (91-distribute-fields-type-2.c:40:3-40:17) [Error][Imprecise][Unsound] Function definition missing + + $ goblint --enable warn.deterministic --enable allglobs --enable dbg.full-output 91-distribute-fields-type-2.c + [Warning][Behavior > Undefined > NullPointerDereference][CWE-476] May dereference NULL pointer (91-distribute-fields-type-2.c:32:3-32:17) + [Warning][Behavior > Undefined > NullPointerDereference][CWE-476] May dereference NULL pointer (91-distribute-fields-type-2.c:40:3-40:17) + [Warning][Race] Memory location (struct T).s (race with conf. 100): + write with [mhp:{tid=[main, t_fun@91-distribute-fields-type-2.c:38:3-38:40#top]}, thread:[main, t_fun@91-distribute-fields-type-2.c:38:3-38:40#top]] (conf. 100) (exp: & *tmp) (91-distribute-fields-type-2.c:32:3-32:17) + write with [mhp:{tid=[main]; created={[main, t_fun@91-distribute-fields-type-2.c:38:3-38:40#top]}}, thread:[main]] (conf. 100) (exp: & *tmp) (91-distribute-fields-type-2.c:40:3-40:17) + [Info][Race] Memory locations race summary: + safe: 2 + vulnerable: 0 + unsafe: 1 + total memory locations: 3 + [Success][Race] Memory location (struct S) (safe): + write with [mhp:{tid=[main, t_fun@91-distribute-fields-type-2.c:38:3-38:40#top]}, thread:[main, t_fun@91-distribute-fields-type-2.c:38:3-38:40#top]] (conf. 100) (exp: & *tmp) (91-distribute-fields-type-2.c:32:3-32:17) + [Success][Race] Memory location (struct T) (safe): + write with [mhp:{tid=[main]; created={[main, t_fun@91-distribute-fields-type-2.c:38:3-38:40#top]}}, thread:[main]] (conf. 100) (exp: & *tmp) (91-distribute-fields-type-2.c:40:3-40:17) + [Info][Deadcode] Logical lines of code (LLoC) summary: + live: 7 + dead: 0 + total lines: 7 + [Info][Unsound] Write to unknown address: privatization is unsound. (91-distribute-fields-type-2.c:32:3-32:17) + [Info][Unsound] Write to unknown address: privatization is unsound. (91-distribute-fields-type-2.c:40:3-40:17) + [Info][Imprecise] INVALIDATING ALL GLOBALS! (91-distribute-fields-type-2.c:32:3-32:17) + [Info][Imprecise] Invalidating expressions: & tmp (91-distribute-fields-type-2.c:32:3-32:17) + [Info][Imprecise] INVALIDATING ALL GLOBALS! (91-distribute-fields-type-2.c:40:3-40:17) + [Info][Imprecise] Invalidating expressions: & tmp (91-distribute-fields-type-2.c:40:3-40:17) + [Error][Imprecise][Unsound] Function definition missing for getS (91-distribute-fields-type-2.c:32:3-32:17) + [Error][Imprecise][Unsound] Function definition missing for getT (91-distribute-fields-type-2.c:40:3-40:17) + [Error][Imprecise][Unsound] Function definition missing diff --git a/tests/regression/04-mutex/92-distribute-fields-type-deep.t b/tests/regression/04-mutex/92-distribute-fields-type-deep.t index 041c94d78b..eb752ee357 100644 --- a/tests/regression/04-mutex/92-distribute-fields-type-deep.t +++ b/tests/regression/04-mutex/92-distribute-fields-type-deep.t @@ -26,3 +26,32 @@ [Error][Imprecise][Unsound] Function definition missing for getS (92-distribute-fields-type-deep.c:36:3-36:20) [Error][Imprecise][Unsound] Function definition missing for getU (92-distribute-fields-type-deep.c:44:3-44:17) [Error][Imprecise][Unsound] Function definition missing + + $ goblint --enable warn.deterministic --enable allglobs --enable dbg.full-output 92-distribute-fields-type-deep.c + [Warning][Behavior > Undefined > NullPointerDereference][CWE-476] May dereference NULL pointer (92-distribute-fields-type-deep.c:36:3-36:20) + [Warning][Behavior > Undefined > NullPointerDereference][CWE-476] May dereference NULL pointer (92-distribute-fields-type-deep.c:44:3-44:17) + [Warning][Race] Memory location (struct U).t.s.field (race with conf. 100): + write with [mhp:{tid=[main, t_fun@92-distribute-fields-type-deep.c:42:3-42:40#top]}, thread:[main, t_fun@92-distribute-fields-type-deep.c:42:3-42:40#top]] (conf. 100) (exp: & tmp->field) (92-distribute-fields-type-deep.c:36:3-36:20) + write with [mhp:{tid=[main]; created={[main, t_fun@92-distribute-fields-type-deep.c:42:3-42:40#top]}}, thread:[main]] (conf. 100) (exp: & tmp->t) (92-distribute-fields-type-deep.c:44:3-44:17) + [Info][Race] Memory locations race summary: + safe: 2 + vulnerable: 0 + unsafe: 1 + total memory locations: 3 + [Success][Race] Memory location (struct S).field (safe): + write with [mhp:{tid=[main, t_fun@92-distribute-fields-type-deep.c:42:3-42:40#top]}, thread:[main, t_fun@92-distribute-fields-type-deep.c:42:3-42:40#top]] (conf. 100) (exp: & tmp->field) (92-distribute-fields-type-deep.c:36:3-36:20) + [Success][Race] Memory location (struct U).t (safe): + write with [mhp:{tid=[main]; created={[main, t_fun@92-distribute-fields-type-deep.c:42:3-42:40#top]}}, thread:[main]] (conf. 100) (exp: & tmp->t) (92-distribute-fields-type-deep.c:44:3-44:17) + [Info][Deadcode] Logical lines of code (LLoC) summary: + live: 7 + dead: 0 + total lines: 7 + [Info][Unsound] Write to unknown address: privatization is unsound. (92-distribute-fields-type-deep.c:36:3-36:20) + [Info][Unsound] Write to unknown address: privatization is unsound. (92-distribute-fields-type-deep.c:44:3-44:17) + [Info][Imprecise] INVALIDATING ALL GLOBALS! (92-distribute-fields-type-deep.c:36:3-36:20) + [Info][Imprecise] Invalidating expressions: & tmp (92-distribute-fields-type-deep.c:36:3-36:20) + [Info][Imprecise] INVALIDATING ALL GLOBALS! (92-distribute-fields-type-deep.c:44:3-44:17) + [Info][Imprecise] Invalidating expressions: & tmp (92-distribute-fields-type-deep.c:44:3-44:17) + [Error][Imprecise][Unsound] Function definition missing for getS (92-distribute-fields-type-deep.c:36:3-36:20) + [Error][Imprecise][Unsound] Function definition missing for getU (92-distribute-fields-type-deep.c:44:3-44:17) + [Error][Imprecise][Unsound] Function definition missing diff --git a/tests/regression/04-mutex/93-distribute-fields-type-global.t b/tests/regression/04-mutex/93-distribute-fields-type-global.t index 49fc198573..2e8b4a78f2 100644 --- a/tests/regression/04-mutex/93-distribute-fields-type-global.t +++ b/tests/regression/04-mutex/93-distribute-fields-type-global.t @@ -22,3 +22,28 @@ [Info][Imprecise] Invalidating expressions: & tmp (93-distribute-fields-type-global.c:13:3-13:29) [Error][Imprecise][Unsound] Function definition missing for getS (93-distribute-fields-type-global.c:13:3-13:29) [Error][Imprecise][Unsound] Function definition missing + + $ goblint --enable warn.deterministic --enable allglobs --enable dbg.full-output 93-distribute-fields-type-global.c + [Warning][Behavior > Undefined > NullPointerDereference][CWE-476] May dereference NULL pointer (93-distribute-fields-type-global.c:13:3-13:29) + [Warning][Race] Memory location s.field (race with conf. 110): (93-distribute-fields-type-global.c:8:10-8:11) + read with [mhp:{tid=[main, t_fun@93-distribute-fields-type-global.c:20:3-20:40#top]}, thread:[main, t_fun@93-distribute-fields-type-global.c:20:3-20:40#top]] (conf. 100) (exp: & tmp->field) (93-distribute-fields-type-global.c:13:3-13:29) + write with [mhp:{tid=[main]; created={[main, t_fun@93-distribute-fields-type-global.c:20:3-20:40#top]}}, thread:[main]] (conf. 110) (exp: & s) (93-distribute-fields-type-global.c:22:3-22:9) + [Info][Race] Memory locations race summary: + safe: 2 + vulnerable: 0 + unsafe: 1 + total memory locations: 3 + [Success][Race] Memory location (struct S).field (safe): + read with [mhp:{tid=[main, t_fun@93-distribute-fields-type-global.c:20:3-20:40#top]}, thread:[main, t_fun@93-distribute-fields-type-global.c:20:3-20:40#top]] (conf. 100) (exp: & tmp->field) (93-distribute-fields-type-global.c:13:3-13:29) + [Success][Race] Memory location s (safe): (93-distribute-fields-type-global.c:8:10-8:11) + write with [mhp:{tid=[main]; created={[main, t_fun@93-distribute-fields-type-global.c:20:3-20:40#top]}}, thread:[main]] (conf. 110) (exp: & s) (93-distribute-fields-type-global.c:22:3-22:9) + [Info][Deadcode] Logical lines of code (LLoC) summary: + live: 7 + dead: 0 + total lines: 7 + [Info][Unsound] Write to unknown address: privatization is unsound. (93-distribute-fields-type-global.c:13:3-13:29) + [Info][Imprecise] INVALIDATING ALL GLOBALS! (93-distribute-fields-type-global.c:13:3-13:29) + [Info][Imprecise] Invalidating expressions: & s (93-distribute-fields-type-global.c:13:3-13:29) + [Info][Imprecise] Invalidating expressions: & tmp (93-distribute-fields-type-global.c:13:3-13:29) + [Error][Imprecise][Unsound] Function definition missing for getS (93-distribute-fields-type-global.c:13:3-13:29) + [Error][Imprecise][Unsound] Function definition missing diff --git a/tests/regression/06-symbeq/16-type_rc.t b/tests/regression/06-symbeq/16-type_rc.t index 0d2a3fbb8c..c4c4eaade8 100644 --- a/tests/regression/06-symbeq/16-type_rc.t +++ b/tests/regression/06-symbeq/16-type_rc.t @@ -22,3 +22,26 @@ Disable info messages because race summary contains (safe) memory location count [Error][Imprecise][Unsound] Function definition missing for get_s (16-type_rc.c:20:12-20:24) [Error][Imprecise][Unsound] Function definition missing for get_s (16-type_rc.c:31:3-31:14) [Error][Imprecise][Unsound] Function definition missing + + $ goblint --enable warn.deterministic --disable warn.info --enable ana.race.direct-arithmetic --set ana.activated[+] "'var_eq'" --set ana.activated[+] "'symb_locks'" --enable dbg.full-output 16-type_rc.c + [Warning][Behavior > Undefined > NullPointerDereference][CWE-476] May dereference NULL pointer (16-type_rc.c:21:3-21:15) + [Warning][Behavior > Undefined > NullPointerDereference][CWE-476] May dereference NULL pointer (16-type_rc.c:32:3-32:16) + [Warning][Behavior > Undefined > NullPointerDereference][CWE-476] May dereference NULL pointer (16-type_rc.c:33:3-33:16) + [Warning][Behavior > Undefined > NullPointerDereference][CWE-476] May dereference NULL pointer (16-type_rc.c:36:3-36:9) + [Warning][Race] Memory location (struct s).datum (race with conf. 100): + write with [mhp:{tid=[main, t_fun@16-type_rc.c:35:3-35:37#top]}, thread:[main, t_fun@16-type_rc.c:35:3-35:37#top]] (conf. 100) (exp: & s->datum) (16-type_rc.c:21:3-21:15) + write with [mhp:{tid=[main]; created={[main, t_fun@16-type_rc.c:35:3-35:37#top]}}, thread:[main]] (conf. 100) (exp: & *d) (16-type_rc.c:36:3-36:9) + [Error][Imprecise][Unsound] Function definition missing for get_s (16-type_rc.c:20:12-20:24) + [Error][Imprecise][Unsound] Function definition missing for get_s (16-type_rc.c:31:3-31:14) + [Error][Imprecise][Unsound] Function definition missing + + $ goblint --enable warn.deterministic --disable warn.info --disable ana.race.direct-arithmetic --set ana.activated[+] "'var_eq'" --set ana.activated[+] "'symb_locks'" --enable allglobs --enable dbg.full-output 16-type_rc.c + [Warning][Behavior > Undefined > NullPointerDereference][CWE-476] May dereference NULL pointer (16-type_rc.c:21:3-21:15) + [Warning][Behavior > Undefined > NullPointerDereference][CWE-476] May dereference NULL pointer (16-type_rc.c:32:3-32:16) + [Warning][Behavior > Undefined > NullPointerDereference][CWE-476] May dereference NULL pointer (16-type_rc.c:33:3-33:16) + [Warning][Behavior > Undefined > NullPointerDereference][CWE-476] May dereference NULL pointer (16-type_rc.c:36:3-36:9) + [Success][Race] Memory location (struct s).datum (safe): + write with [mhp:{tid=[main, t_fun@16-type_rc.c:35:3-35:37#top]}, thread:[main, t_fun@16-type_rc.c:35:3-35:37#top]] (conf. 100) (exp: & s->datum) (16-type_rc.c:21:3-21:15) + [Error][Imprecise][Unsound] Function definition missing for get_s (16-type_rc.c:20:12-20:24) + [Error][Imprecise][Unsound] Function definition missing for get_s (16-type_rc.c:31:3-31:14) + [Error][Imprecise][Unsound] Function definition missing diff --git a/tests/regression/06-symbeq/21-mult_accs_rc.t b/tests/regression/06-symbeq/21-mult_accs_rc.t index 0fde1255c6..e1b9cdc8ec 100644 --- a/tests/regression/06-symbeq/21-mult_accs_rc.t +++ b/tests/regression/06-symbeq/21-mult_accs_rc.t @@ -32,3 +32,36 @@ Disable info messages because race summary contains (safe) memory location count [Error][Imprecise][Unsound] Function definition missing for get_s (21-mult_accs_rc.c:15:3-15:14) [Error][Imprecise][Unsound] Function definition missing for get_s (21-mult_accs_rc.c:27:3-27:14) [Error][Imprecise][Unsound] Function definition missing + + $ goblint --enable warn.deterministic --disable warn.info --enable ana.race.direct-arithmetic --set ana.activated[+] "'var_eq'" --set ana.activated[+] "'symb_locks'" --enable dbg.full-output 21-mult_accs_rc.c + [Warning][Behavior > Undefined > NullPointerDereference][CWE-476] May dereference NULL pointer (21-mult_accs_rc.c:14:3-14:32) + [Warning][Behavior > Undefined > NullPointerDereference][CWE-476] May dereference NULL pointer (21-mult_accs_rc.c:16:3-16:14) + [Warning][Behavior > Undefined > NullPointerDereference][CWE-476] May dereference NULL pointer (21-mult_accs_rc.c:17:3-17:32) + [Warning][Behavior > Undefined > NullPointerDereference][CWE-476] May dereference NULL pointer (21-mult_accs_rc.c:28:3-28:16) + [Warning][Behavior > Undefined > NullPointerDereference][CWE-476] May dereference NULL pointer (21-mult_accs_rc.c:29:3-29:15) + [Warning][Behavior > Undefined > NullPointerDereference][CWE-476] May dereference NULL pointer (21-mult_accs_rc.c:34:3-34:9) + [Warning][Race] Memory location (struct s).data (race with conf. 100): + write with [mhp:{tid=[main, t_fun@21-mult_accs_rc.c:31:3-31:37#top]}, thread:[main, t_fun@21-mult_accs_rc.c:31:3-31:37#top]] (conf. 100) (exp: & s->data) (21-mult_accs_rc.c:16:3-16:14) + write with [symblock:{p-lock:*.mutex}, mhp:{tid=[main]; created={[main, t_fun@21-mult_accs_rc.c:31:3-31:37#top]}}, thread:[main]] (conf. 100) (exp: & *d) (21-mult_accs_rc.c:34:3-34:9) + [Warning][Unknown] unlocking mutex (NULL) which may not be held (21-mult_accs_rc.c:35:3-35:26) + [Warning][Unknown] unlocking unknown mutex which may not be held (21-mult_accs_rc.c:35:3-35:26) + [Error][Imprecise][Unsound] Function definition missing for get_s (21-mult_accs_rc.c:13:3-13:14) + [Error][Imprecise][Unsound] Function definition missing for get_s (21-mult_accs_rc.c:15:3-15:14) + [Error][Imprecise][Unsound] Function definition missing for get_s (21-mult_accs_rc.c:27:3-27:14) + [Error][Imprecise][Unsound] Function definition missing + + $ goblint --enable warn.deterministic --disable warn.info --disable ana.race.direct-arithmetic --set ana.activated[+] "'var_eq'" --set ana.activated[+] "'symb_locks'" --enable allglobs --enable dbg.full-output 21-mult_accs_rc.c + [Warning][Behavior > Undefined > NullPointerDereference][CWE-476] May dereference NULL pointer (21-mult_accs_rc.c:14:3-14:32) + [Warning][Behavior > Undefined > NullPointerDereference][CWE-476] May dereference NULL pointer (21-mult_accs_rc.c:16:3-16:14) + [Warning][Behavior > Undefined > NullPointerDereference][CWE-476] May dereference NULL pointer (21-mult_accs_rc.c:17:3-17:32) + [Warning][Behavior > Undefined > NullPointerDereference][CWE-476] May dereference NULL pointer (21-mult_accs_rc.c:28:3-28:16) + [Warning][Behavior > Undefined > NullPointerDereference][CWE-476] May dereference NULL pointer (21-mult_accs_rc.c:29:3-29:15) + [Warning][Behavior > Undefined > NullPointerDereference][CWE-476] May dereference NULL pointer (21-mult_accs_rc.c:34:3-34:9) + [Success][Race] Memory location (struct s).data (safe): + write with [mhp:{tid=[main, t_fun@21-mult_accs_rc.c:31:3-31:37#top]}, thread:[main, t_fun@21-mult_accs_rc.c:31:3-31:37#top]] (conf. 100) (exp: & s->data) (21-mult_accs_rc.c:16:3-16:14) + [Warning][Unknown] unlocking mutex (NULL) which may not be held (21-mult_accs_rc.c:35:3-35:26) + [Warning][Unknown] unlocking unknown mutex which may not be held (21-mult_accs_rc.c:35:3-35:26) + [Error][Imprecise][Unsound] Function definition missing for get_s (21-mult_accs_rc.c:13:3-13:14) + [Error][Imprecise][Unsound] Function definition missing for get_s (21-mult_accs_rc.c:15:3-15:14) + [Error][Imprecise][Unsound] Function definition missing for get_s (21-mult_accs_rc.c:27:3-27:14) + [Error][Imprecise][Unsound] Function definition missing From 313d821e489418b1af8237aa9dcfb1436801278b Mon Sep 17 00:00:00 2001 From: Karoliine Holter Date: Tue, 13 Feb 2024 18:40:06 +0200 Subject: [PATCH 27/35] Use dbg.full-output option in mHP, threadId and wrapperFunction --- src/analyses/mHPAnalysis.ml | 5 +++-- src/analyses/wrapperFunctionAnalysis.ml | 4 ++-- src/cdomains/mHP.ml | 8 +++++++- src/cdomains/threadIdDomain.ml | 4 ++++ 4 files changed, 16 insertions(+), 5 deletions(-) diff --git a/src/analyses/mHPAnalysis.ml b/src/analyses/mHPAnalysis.ml index 9bccb41baf..e41a5d2ec2 100644 --- a/src/analyses/mHPAnalysis.ml +++ b/src/analyses/mHPAnalysis.ml @@ -13,8 +13,9 @@ struct let name () = "mhp" let may_race = MHP.may_happen_in_parallel let should_print {tid; created; must_joined} = - not (ConcDomain.ThreadSet.is_empty created) - || not (ConcDomain.ThreadSet.is_empty must_joined) + GobConfig.get_bool "dbg.full-output" || + (not (ConcDomain.ThreadSet.is_empty created) || + not (ConcDomain.ThreadSet.is_empty must_joined)) end let access ctx _: MHP.t = MHP.current (Analyses.ask_of_ctx ctx) diff --git a/src/analyses/wrapperFunctionAnalysis.ml b/src/analyses/wrapperFunctionAnalysis.ml index 6b8eee648e..34474a9705 100644 --- a/src/analyses/wrapperFunctionAnalysis.ml +++ b/src/analyses/wrapperFunctionAnalysis.ml @@ -132,13 +132,13 @@ module MallocWrapper : MCPSpec = struct let name_varinfo (t, node, c) = let uniq_count = - if UniqueCount.is_top c then + if not (GobConfig.get_bool "dbg.full-output") && UniqueCount.is_top c then Format.dprintf "" else Format.dprintf "(#%s)" (UniqueCount.show c) in let tid = - if ThreadLifted.is_top t then + if not (GobConfig.get_bool "dbg.full-output") && ThreadLifted.is_top t then Format.dprintf "" else Format.dprintf "@tid:%s%t" (ThreadLifted.show t) uniq_count diff --git a/src/cdomains/mHP.ml b/src/cdomains/mHP.ml index b7d62f548c..f58b7d2e92 100644 --- a/src/cdomains/mHP.ml +++ b/src/cdomains/mHP.ml @@ -24,6 +24,12 @@ let current (ask:Queries.ask) = } let pretty () {tid; created; must_joined} = + let tid_doc = + if GobConfig.get_bool "dbg.full-output" then + Some (Pretty.dprintf "tid=%a" ThreadIdDomain.ThreadLifted.pretty tid) + else + None + in (* avoid useless empty sets in race output *) let created_doc = if ConcDomain.ThreadSet.is_empty created then @@ -37,7 +43,7 @@ let pretty () {tid; created; must_joined} = else Some (Pretty.dprintf "must_joined=%a" ConcDomain.ThreadSet.pretty must_joined) in - let docs = List.filter_map Fun.id [created_doc; must_joined_doc] in + let docs = List.filter_map Fun.id [tid_doc; created_doc; must_joined_doc] in Pretty.dprintf "{%a}" (Pretty.d_list "; " Pretty.insert) docs include Printable.SimplePretty ( diff --git a/src/cdomains/threadIdDomain.ml b/src/cdomains/threadIdDomain.ml index 4a8dbf8632..e85e187c0c 100644 --- a/src/cdomains/threadIdDomain.ml +++ b/src/cdomains/threadIdDomain.ml @@ -60,6 +60,10 @@ struct f.vname ^ "@" ^ CilType.Location.show (UpdateCil.getLoc n) ^ "#" ^ string_of_int i + | (f, Some (n, None)) when GobConfig.get_bool "dbg.full-output" -> + f.vname + ^ "@" ^ CilType.Location.show (UpdateCil.getLoc n) + ^ "#top" | (f, Some (n, None)) -> f.vname ^ "@" ^ CilType.Location.show (UpdateCil.getLoc n) From 4cfd2bc923a455b2a979eff211fdd86d7f2cd5c2 Mon Sep 17 00:00:00 2001 From: Karoliine Holter Date: Tue, 13 Feb 2024 18:40:29 +0200 Subject: [PATCH 28/35] Add cram tests with dbg.full-output for testing intervals --- .../regression/02-base/87-casts-dep-on-param.t | 14 ++++++++++++++ tests/regression/06-symbeq/14-list_entry_rc.t | 18 ++++++++++++++++++ tests/regression/45-escape/51-fresh-global.t | 14 ++++++++++++++ .../74-invalid_deref/01-oob-heap-simple.t | 9 +++++++++ 4 files changed, 55 insertions(+) diff --git a/tests/regression/02-base/87-casts-dep-on-param.t b/tests/regression/02-base/87-casts-dep-on-param.t index aedbf11bcf..5501f0bd8c 100644 --- a/tests/regression/02-base/87-casts-dep-on-param.t +++ b/tests/regression/02-base/87-casts-dep-on-param.t @@ -11,3 +11,17 @@ live: 15 dead: 0 total lines: 15 + + $ goblint --set ana.activated "['base', 'mallocWrapper']" --set ana.ctx_insens[+] 'base' --set ana.ctx_insens[+] 'mallocWrapper' --set ana.base.privatization none --enable warn.debug --enable dbg.full-output 87-casts-dep-on-param.c | sed -r 's/sid:[0-9]+/sid:$SID/' + Option warning: Without thread escape analysis, every local variable whose address is taken is considered escaped, i.e., global! + [Info][Unsound] Unknown address in {&i} has escaped. (87-casts-dep-on-param.c:11:3-11:11) + [Info][Unsound] Unknown value in {?} could be an escaped pointer address! (87-casts-dep-on-param.c:11:3-11:11) + [Debug][Analyzer] Base EvalInt i query answering bot instead of {?, NULL, &(alloc@sid:$SID@tid:Top Threads(#top))} (87-casts-dep-on-param.c:13:7-13:15) + [Debug][Analyzer] Base EvalInt i query answering bot instead of {?, NULL, &(alloc@sid:$SID@tid:Top Threads(#top))} (87-casts-dep-on-param.c:14:3-14:11) + [Info][Unsound] Unknown address in {&p} has escaped. (87-casts-dep-on-param.c:17:7-17:19) + [Info][Unsound] Unknown address in {&i} has escaped. (87-casts-dep-on-param.c:17:7-17:19) + [Info][Unsound] Unknown value in {?} could be an escaped pointer address! (87-casts-dep-on-param.c:17:7-17:19) + [Info][Deadcode] Logical lines of code (LLoC) summary: + live: 15 + dead: 0 + total lines: 15 diff --git a/tests/regression/06-symbeq/14-list_entry_rc.t b/tests/regression/06-symbeq/14-list_entry_rc.t index 087afda10d..354c0e85e8 100644 --- a/tests/regression/06-symbeq/14-list_entry_rc.t +++ b/tests/regression/06-symbeq/14-list_entry_rc.t @@ -15,3 +15,21 @@ vulnerable: 0 unsafe: 1 total memory locations: 2 + + $ goblint --enable ana.race.direct-arithmetic --set ana.activated[+] "'var_eq'" --set ana.activated[+] "'symb_locks'" --enable dbg.full-output 14-list_entry_rc.c | sed -r 's/sid:[0-9]+/sid:$SID/' + [Info][Imprecise] Invalidating expressions: & mutexattr (14-list_entry_rc.c:37:3-37:37) + [Warning][Unknown] unlocking mutex ((alloc@sid:$SID@tid:[main](#top))[def_exc:1].mutex) which may not be held (14-list_entry_rc.c:28:3-28:34) + [Info][Deadcode] Logical lines of code (LLoC) summary: + live: 23 + dead: 0 + total lines: 23 + [Warning][Race] Memory location (alloc@sid:$SID@tid:[main](#top))[?].datum (race with conf. 110): (14-list_entry_rc.c:41:3-41:35) + write with [mhp:{tid=[main, t_fun@14-list_entry_rc.c:45:3-45:40#top]}, thread:[main, t_fun@14-list_entry_rc.c:45:3-45:40#top]] (conf. 110) (exp: & s->datum) (14-list_entry_rc.c:27:3-27:13) + write with [mhp:{tid=[main]; created={[main, t_fun@14-list_entry_rc.c:45:3-45:40#top]}}, thread:[main]] (conf. 110) (exp: & s->datum) (14-list_entry_rc.c:27:3-27:13) + read with [mhp:{tid=[main, t_fun@14-list_entry_rc.c:45:3-45:40#top]}, thread:[main, t_fun@14-list_entry_rc.c:45:3-45:40#top]] (conf. 110) (exp: & s->datum) (14-list_entry_rc.c:27:3-27:13) + read with [mhp:{tid=[main]; created={[main, t_fun@14-list_entry_rc.c:45:3-45:40#top]}}, thread:[main]] (conf. 110) (exp: & s->datum) (14-list_entry_rc.c:27:3-27:13) + [Info][Race] Memory locations race summary: + safe: 1 + vulnerable: 0 + unsafe: 1 + total memory locations: 2 diff --git a/tests/regression/45-escape/51-fresh-global.t b/tests/regression/45-escape/51-fresh-global.t index 886af7b25d..c045859ff5 100644 --- a/tests/regression/45-escape/51-fresh-global.t +++ b/tests/regression/45-escape/51-fresh-global.t @@ -11,3 +11,17 @@ vulnerable: 0 unsafe: 1 total memory locations: 2 + + $ goblint --set ana.activated[+] mallocFresh --set ana.activated[-] mhp --set ana.thread.domain plain --enable dbg.full-output 51-fresh-global.c | sed -r 's/sid:[0-9]+/sid:$SID/' + [Info][Deadcode] Logical lines of code (LLoC) summary: + live: 15 + dead: 0 + total lines: 15 + [Warning][Race] Memory location (alloc@sid:$SID@tid:main(#top)) (race with conf. 110): (51-fresh-global.c:25:7-25:31) + write with lock:{A} (conf. 110) (exp: & *i) (51-fresh-global.c:10:3-10:10) + write with thread:main (conf. 110) (exp: & *i) (51-fresh-global.c:27:3-27:9) + [Info][Race] Memory locations race summary: + safe: 1 + vulnerable: 0 + unsafe: 1 + total memory locations: 2 diff --git a/tests/regression/74-invalid_deref/01-oob-heap-simple.t b/tests/regression/74-invalid_deref/01-oob-heap-simple.t index 96989ad0ce..19b09d6be7 100644 --- a/tests/regression/74-invalid_deref/01-oob-heap-simple.t +++ b/tests/regression/74-invalid_deref/01-oob-heap-simple.t @@ -6,3 +6,12 @@ live: 8 dead: 0 total lines: 8 + + $ goblint --set ana.activated[+] memOutOfBounds --enable ana.int.interval --enable dbg.full-output 01-oob-heap-simple.c + Option warning: The memOutOfBounds analysis enables cil.addNestedScopeAttr. + [Warning][Behavior > Undefined > MemoryOutOfBoundsAccess][CWE-823] Size of pointer in expression ptr + 10 is (5,[5,5]) (in bytes). It is offset by (10,[10,10]) (in bytes). Memory out-of-bounds access must occur (01-oob-heap-simple.c:10:5-10:22) + [Warning][Behavior > Undefined > MemoryOutOfBoundsAccess][CWE-823] Could not compare pointer size ((5,[5,5])) with offset ((Unknown int([-63,63]),[-9223372036854775808,9223372036854775807])). Memory out-of-bounds access may occur (01-oob-heap-simple.c:11:5-11:21) + [Info][Deadcode] Logical lines of code (LLoC) summary: + live: 8 + dead: 0 + total lines: 8 From 1148df3efd39cf7fa934870cff4bc849e9700178 Mon Sep 17 00:00:00 2001 From: Karoliine Holter Date: Tue, 13 Feb 2024 18:40:38 +0200 Subject: [PATCH 29/35] Use dbg.full-output option in intDomain --- src/cdomains/intDomain.ml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/cdomains/intDomain.ml b/src/cdomains/intDomain.ml index 1714324750..3c78a8d359 100644 --- a/src/cdomains/intDomain.ml +++ b/src/cdomains/intDomain.ml @@ -408,18 +408,18 @@ struct let narrow = lift2 I.narrow let show x = - if I.is_top_of x.ikind x.v then + if not (GobConfig.get_bool "dbg.full-output") && I.is_top_of x.ikind x.v then "⊤" else I.show x.v (* TODO add ikind to output *) let pretty () x = - if I.is_top_of x.ikind x.v then + if not (GobConfig.get_bool "dbg.full-output") && I.is_top_of x.ikind x.v then Pretty.text "⊤" else I.pretty () x.v (* TODO add ikind to output *) let pretty_diff () (x, y) = I.pretty_diff () (x.v, y.v) (* TODO check ikinds, add them to output *) let printXml o x = - if I.is_top_of x.ikind x.v then + if not (GobConfig.get_bool "dbg.full-output") && I.is_top_of x.ikind x.v then BatPrintf.fprintf o "\n\n⊤\n\n\n" else I.printXml o x.v (* TODO add ikind to output *) @@ -3612,8 +3612,8 @@ module IntDomTupleImpl = struct let pretty () x = match to_int x with - | Some v -> Pretty.text (BI.to_string v) - | None -> + | Some v when not (GobConfig.get_bool "dbg.full-output") -> Pretty.text (BI.to_string v) + | _ -> mapp { fp = fun (type a) (module I:SOverflow with type t = a) -> (* assert sf==I.short; *) I.pretty () } x |> to_list |> (fun xs -> @@ -3724,8 +3724,8 @@ module IntDomTupleImpl = struct (* others *) let show x = match to_int x with - | Some v -> BI.to_string v - | None -> mapp { fp = fun (type a) (module I:SOverflow with type t = a) x -> I.name () ^ ":" ^ (I.show x) } x + | Some v when not (GobConfig.get_bool "dbg.full-output") -> BI.to_string v + | _ -> mapp { fp = fun (type a) (module I:SOverflow with type t = a) x -> I.name () ^ ":" ^ (I.show x) } x |> to_list |> String.concat "; " let to_yojson = [%to_yojson: Yojson.Safe.t list] % to_list % mapp { fp = fun (type a) (module I:SOverflow with type t = a) x -> I.to_yojson x } From cc689ce1130fde8c7f4f0e0e5b1fb8dbdad889a4 Mon Sep 17 00:00:00 2001 From: Karoliine Holter Date: Tue, 13 Feb 2024 18:44:34 +0200 Subject: [PATCH 30/35] Indentation --- src/analyses/mHPAnalysis.ml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/analyses/mHPAnalysis.ml b/src/analyses/mHPAnalysis.ml index e41a5d2ec2..e9c3364c9f 100644 --- a/src/analyses/mHPAnalysis.ml +++ b/src/analyses/mHPAnalysis.ml @@ -15,7 +15,7 @@ struct let should_print {tid; created; must_joined} = GobConfig.get_bool "dbg.full-output" || (not (ConcDomain.ThreadSet.is_empty created) || - not (ConcDomain.ThreadSet.is_empty must_joined)) + not (ConcDomain.ThreadSet.is_empty must_joined)) end let access ctx _: MHP.t = MHP.current (Analyses.ask_of_ctx ctx) From a9d5358205e712eec7668b219f82cbd6f1888237 Mon Sep 17 00:00:00 2001 From: Karoliine Holter Date: Wed, 14 Feb 2024 12:07:09 +0200 Subject: [PATCH 31/35] Simplify show in threadIdDomain --- src/cdomains/threadIdDomain.ml | 31 ++++++++++++++----------------- 1 file changed, 14 insertions(+), 17 deletions(-) diff --git a/src/cdomains/threadIdDomain.ml b/src/cdomains/threadIdDomain.ml index e85e187c0c..8d1f1e4d97 100644 --- a/src/cdomains/threadIdDomain.ml +++ b/src/cdomains/threadIdDomain.ml @@ -55,26 +55,23 @@ struct (struct let name = "no index" end))) (struct let name = "no node" end)) - let show = function - | (f, Some (n, Some i)) -> - f.vname - ^ "@" ^ CilType.Location.show (UpdateCil.getLoc n) - ^ "#" ^ string_of_int i - | (f, Some (n, None)) when GobConfig.get_bool "dbg.full-output" -> - f.vname - ^ "@" ^ CilType.Location.show (UpdateCil.getLoc n) - ^ "#top" - | (f, Some (n, None)) -> - f.vname - ^ "@" ^ CilType.Location.show (UpdateCil.getLoc n) - | (f, None) -> f.vname + let show (f, ni_opt) = + let vname = f.vname in + match ni_opt with + | None -> vname + | Some (n, i_opt) -> + let vname_loc = vname ^ "@" ^ CilType.Location.show (UpdateCil.getLoc n) in + match i_opt with + | Some i -> vname_loc ^ "#" ^ string_of_int i + | None when GobConfig.get_bool "dbg.full-output" -> vname_loc ^ "#top" + | None -> vname_loc include Printable.SimpleShow ( struct type nonrec t = t let show = show end - ) + ) let threadinit v ~multiple: t = (v, None) @@ -135,9 +132,9 @@ struct include S let name () = "created (once)" end) (struct - include S - let name () = "created (multiple times)" - end) + include S + let name () = "created (multiple times)" + end) let is_unique (_, s) = From 5419d44fa24d29f50beafe6bce591f2d42c01f71 Mon Sep 17 00:00:00 2001 From: Karoliine Holter Date: Wed, 14 Feb 2024 13:29:26 +0200 Subject: [PATCH 32/35] Use diffs in cram tests --- .../02-base/87-casts-dep-on-param.t | 25 +++--- tests/regression/04-mutex/01-simple_rc.t | 31 ++++---- .../regression/04-mutex/49-type-invariants.t | 76 ++++++++----------- .../04-mutex/77-type-nested-fields.t | 42 ++++------ .../04-mutex/79-type-nested-fields-deep1.t | 42 ++++------ .../04-mutex/80-type-nested-fields-deep2.t | 42 ++++------ .../04-mutex/84-distribute-fields-1.t | 31 ++++---- .../04-mutex/85-distribute-fields-2.t | 31 ++++---- .../04-mutex/86-distribute-fields-3.t | 31 ++++---- .../04-mutex/87-distribute-fields-4.t | 25 +++--- .../04-mutex/88-distribute-fields-5.t | 25 +++--- .../04-mutex/89-distribute-fields-6.t | 25 +++--- .../04-mutex/90-distribute-fields-type-1.t | 48 +++++------- .../04-mutex/91-distribute-fields-type-2.t | 48 +++++------- .../04-mutex/92-distribute-fields-type-deep.t | 48 +++++------- .../93-distribute-fields-type-global.t | 44 +++++------ tests/regression/06-symbeq/14-list_entry_rc.t | 39 +++++----- tests/regression/06-symbeq/16-type_rc.t | 43 +++++------ tests/regression/06-symbeq/21-mult_accs_rc.t | 53 +++++-------- tests/regression/45-escape/51-fresh-global.t | 23 +++--- .../74-invalid_deref/01-oob-heap-simple.t | 20 ++--- 21 files changed, 336 insertions(+), 456 deletions(-) diff --git a/tests/regression/02-base/87-casts-dep-on-param.t b/tests/regression/02-base/87-casts-dep-on-param.t index 5501f0bd8c..c014b32488 100644 --- a/tests/regression/02-base/87-casts-dep-on-param.t +++ b/tests/regression/02-base/87-casts-dep-on-param.t @@ -1,4 +1,4 @@ - $ goblint --set ana.activated "['base', 'mallocWrapper']" --set ana.ctx_insens[+] 'base' --set ana.ctx_insens[+] 'mallocWrapper' --set ana.base.privatization none --enable warn.debug 87-casts-dep-on-param.c | sed -r 's/sid:[0-9]+/sid:$SID/' + $ goblint --set ana.activated "['base', 'mallocWrapper']" --set ana.ctx_insens[+] 'base' --set ana.ctx_insens[+] 'mallocWrapper' --set ana.base.privatization none --enable warn.debug 87-casts-dep-on-param.c 2>&1 | sed -r 's/sid:[0-9]+/sid:$SID/' | tee default-output.txt Option warning: Without thread escape analysis, every local variable whose address is taken is considered escaped, i.e., global! [Info][Unsound] Unknown address in {&i} has escaped. (87-casts-dep-on-param.c:11:3-11:11) [Info][Unsound] Unknown value in {?} could be an escaped pointer address! (87-casts-dep-on-param.c:11:3-11:11) @@ -12,16 +12,13 @@ dead: 0 total lines: 15 - $ goblint --set ana.activated "['base', 'mallocWrapper']" --set ana.ctx_insens[+] 'base' --set ana.ctx_insens[+] 'mallocWrapper' --set ana.base.privatization none --enable warn.debug --enable dbg.full-output 87-casts-dep-on-param.c | sed -r 's/sid:[0-9]+/sid:$SID/' - Option warning: Without thread escape analysis, every local variable whose address is taken is considered escaped, i.e., global! - [Info][Unsound] Unknown address in {&i} has escaped. (87-casts-dep-on-param.c:11:3-11:11) - [Info][Unsound] Unknown value in {?} could be an escaped pointer address! (87-casts-dep-on-param.c:11:3-11:11) - [Debug][Analyzer] Base EvalInt i query answering bot instead of {?, NULL, &(alloc@sid:$SID@tid:Top Threads(#top))} (87-casts-dep-on-param.c:13:7-13:15) - [Debug][Analyzer] Base EvalInt i query answering bot instead of {?, NULL, &(alloc@sid:$SID@tid:Top Threads(#top))} (87-casts-dep-on-param.c:14:3-14:11) - [Info][Unsound] Unknown address in {&p} has escaped. (87-casts-dep-on-param.c:17:7-17:19) - [Info][Unsound] Unknown address in {&i} has escaped. (87-casts-dep-on-param.c:17:7-17:19) - [Info][Unsound] Unknown value in {?} could be an escaped pointer address! (87-casts-dep-on-param.c:17:7-17:19) - [Info][Deadcode] Logical lines of code (LLoC) summary: - live: 15 - dead: 0 - total lines: 15 + $ goblint --set ana.activated "['base', 'mallocWrapper']" --set ana.ctx_insens[+] 'base' --set ana.ctx_insens[+] 'mallocWrapper' --set ana.base.privatization none --enable warn.debug --enable dbg.full-output 87-casts-dep-on-param.c 2>&1 | sed -r 's/sid:[0-9]+/sid:$SID/' > full-output.txt + + $ diff default-output.txt full-output.txt + 4,5c4,5 + < [Debug][Analyzer] Base EvalInt i query answering bot instead of {?, NULL, &(alloc@sid:$SID)} (87-casts-dep-on-param.c:13:7-13:15) + < [Debug][Analyzer] Base EvalInt i query answering bot instead of {?, NULL, &(alloc@sid:$SID)} (87-casts-dep-on-param.c:14:3-14:11) + --- + > [Debug][Analyzer] Base EvalInt i query answering bot instead of {?, NULL, &(alloc@sid:$SID@tid:Top Threads(#top))} (87-casts-dep-on-param.c:13:7-13:15) + > [Debug][Analyzer] Base EvalInt i query answering bot instead of {?, NULL, &(alloc@sid:$SID@tid:Top Threads(#top))} (87-casts-dep-on-param.c:14:3-14:11) + [1] diff --git a/tests/regression/04-mutex/01-simple_rc.t b/tests/regression/04-mutex/01-simple_rc.t index 33a74d0f0b..04427803cb 100644 --- a/tests/regression/04-mutex/01-simple_rc.t +++ b/tests/regression/04-mutex/01-simple_rc.t @@ -1,4 +1,4 @@ - $ goblint --enable warn.deterministic 01-simple_rc.c + $ goblint --enable warn.deterministic 01-simple_rc.c 2>&1 | tee default-output.txt [Warning][Race] Memory location myglobal (race with conf. 110): (01-simple_rc.c:4:5-4:13) write with [lock:{mutex1}, thread:[main, t_fun@01-simple_rc.c:17:3-17:40]] (conf. 110) (exp: & myglobal) (01-simple_rc.c:10:3-10:22) write with [mhp:{created={[main, t_fun@01-simple_rc.c:17:3-17:40]}}, lock:{mutex2}, thread:[main]] (conf. 110) (exp: & myglobal) (01-simple_rc.c:19:3-19:22) @@ -14,18 +14,17 @@ dead: 0 total lines: 12 - $ goblint --enable warn.deterministic --enable dbg.full-output 01-simple_rc.c - [Warning][Race] Memory location myglobal (race with conf. 110): (01-simple_rc.c:4:5-4:13) - write with [mhp:{tid=[main, t_fun@01-simple_rc.c:17:3-17:40#top]}, lock:{mutex1}, thread:[main, t_fun@01-simple_rc.c:17:3-17:40#top]] (conf. 110) (exp: & myglobal) (01-simple_rc.c:10:3-10:22) - write with [mhp:{tid=[main]; created={[main, t_fun@01-simple_rc.c:17:3-17:40#top]}}, lock:{mutex2}, thread:[main]] (conf. 110) (exp: & myglobal) (01-simple_rc.c:19:3-19:22) - read with [mhp:{tid=[main, t_fun@01-simple_rc.c:17:3-17:40#top]}, lock:{mutex1}, thread:[main, t_fun@01-simple_rc.c:17:3-17:40#top]] (conf. 110) (exp: & myglobal) (01-simple_rc.c:10:3-10:22) - read with [mhp:{tid=[main]; created={[main, t_fun@01-simple_rc.c:17:3-17:40#top]}}, lock:{mutex2}, thread:[main]] (conf. 110) (exp: & myglobal) (01-simple_rc.c:19:3-19:22) - [Info][Race] Memory locations race summary: - safe: 0 - vulnerable: 0 - unsafe: 1 - total memory locations: 1 - [Info][Deadcode] Logical lines of code (LLoC) summary: - live: 12 - dead: 0 - total lines: 12 + $ goblint --enable warn.deterministic --enable dbg.full-output 01-simple_rc.c > full-output.txt 2>&1 + + $ diff default-output.txt full-output.txt + 2,5c2,5 + < write with [lock:{mutex1}, thread:[main, t_fun@01-simple_rc.c:17:3-17:40]] (conf. 110) (exp: & myglobal) (01-simple_rc.c:10:3-10:22) + < write with [mhp:{created={[main, t_fun@01-simple_rc.c:17:3-17:40]}}, lock:{mutex2}, thread:[main]] (conf. 110) (exp: & myglobal) (01-simple_rc.c:19:3-19:22) + < read with [lock:{mutex1}, thread:[main, t_fun@01-simple_rc.c:17:3-17:40]] (conf. 110) (exp: & myglobal) (01-simple_rc.c:10:3-10:22) + < read with [mhp:{created={[main, t_fun@01-simple_rc.c:17:3-17:40]}}, lock:{mutex2}, thread:[main]] (conf. 110) (exp: & myglobal) (01-simple_rc.c:19:3-19:22) + --- + > write with [mhp:{tid=[main, t_fun@01-simple_rc.c:17:3-17:40#top]}, lock:{mutex1}, thread:[main, t_fun@01-simple_rc.c:17:3-17:40#top]] (conf. 110) (exp: & myglobal) (01-simple_rc.c:10:3-10:22) + > write with [mhp:{tid=[main]; created={[main, t_fun@01-simple_rc.c:17:3-17:40#top]}}, lock:{mutex2}, thread:[main]] (conf. 110) (exp: & myglobal) (01-simple_rc.c:19:3-19:22) + > read with [mhp:{tid=[main, t_fun@01-simple_rc.c:17:3-17:40#top]}, lock:{mutex1}, thread:[main, t_fun@01-simple_rc.c:17:3-17:40#top]] (conf. 110) (exp: & myglobal) (01-simple_rc.c:10:3-10:22) + > read with [mhp:{tid=[main]; created={[main, t_fun@01-simple_rc.c:17:3-17:40#top]}}, lock:{mutex2}, thread:[main]] (conf. 110) (exp: & myglobal) (01-simple_rc.c:19:3-19:22) + [1] diff --git a/tests/regression/04-mutex/49-type-invariants.t b/tests/regression/04-mutex/49-type-invariants.t index be610e1a71..8ce3fb9b4c 100644 --- a/tests/regression/04-mutex/49-type-invariants.t +++ b/tests/regression/04-mutex/49-type-invariants.t @@ -1,4 +1,4 @@ - $ goblint --enable warn.deterministic --enable ana.race.direct-arithmetic --enable allglobs 49-type-invariants.c + $ goblint --enable warn.deterministic --enable ana.race.direct-arithmetic --enable allglobs 49-type-invariants.c 2>&1 | tee default-output-1.txt [Warning][Behavior > Undefined > NullPointerDereference][CWE-476] May dereference NULL pointer (49-type-invariants.c:21:3-21:21) [Warning][Race] Memory location s.field (race with conf. 110): (49-type-invariants.c:8:10-8:11) write with [mhp:{created={[main, t_fun@49-type-invariants.c:20:3-20:40]}}, thread:[main]] (conf. 100) (exp: & tmp->field) (49-type-invariants.c:21:3-21:21) @@ -21,7 +21,7 @@ [Error][Imprecise][Unsound] Function definition missing for getS (49-type-invariants.c:21:3-21:21) [Error][Imprecise][Unsound] Function definition missing - $ goblint --enable warn.deterministic --disable ana.race.direct-arithmetic --enable allglobs 49-type-invariants.c + $ goblint --enable warn.deterministic --disable ana.race.direct-arithmetic --enable allglobs 49-type-invariants.c 2>&1 | tee default-output-2.txt [Warning][Behavior > Undefined > NullPointerDereference][CWE-476] May dereference NULL pointer (49-type-invariants.c:21:3-21:21) [Warning][Race] Memory location s.field (race with conf. 110): (49-type-invariants.c:8:10-8:11) write with [mhp:{created={[main, t_fun@49-type-invariants.c:20:3-20:40]}}, thread:[main]] (conf. 100) (exp: & tmp->field) (49-type-invariants.c:21:3-21:21) @@ -44,48 +44,32 @@ [Error][Imprecise][Unsound] Function definition missing for getS (49-type-invariants.c:21:3-21:21) [Error][Imprecise][Unsound] Function definition missing - $ goblint --enable warn.deterministic --enable ana.race.direct-arithmetic --enable allglobs --enable dbg.full-output 49-type-invariants.c - [Warning][Behavior > Undefined > NullPointerDereference][CWE-476] May dereference NULL pointer (49-type-invariants.c:21:3-21:21) - [Warning][Race] Memory location s.field (race with conf. 110): (49-type-invariants.c:8:10-8:11) - write with [mhp:{tid=[main]; created={[main, t_fun@49-type-invariants.c:20:3-20:40#top]}}, thread:[main]] (conf. 100) (exp: & tmp->field) (49-type-invariants.c:21:3-21:21) - read with [mhp:{tid=[main, t_fun@49-type-invariants.c:20:3-20:40#top]}, thread:[main, t_fun@49-type-invariants.c:20:3-20:40#top]] (conf. 110) (exp: & s.field) (49-type-invariants.c:11:3-11:23) - [Info][Race] Memory locations race summary: - safe: 1 - vulnerable: 0 - unsafe: 1 - total memory locations: 2 - [Success][Race] Memory location (struct S).field (safe): - write with [mhp:{tid=[main]; created={[main, t_fun@49-type-invariants.c:20:3-20:40#top]}}, thread:[main]] (conf. 100) (exp: & tmp->field) (49-type-invariants.c:21:3-21:21) - [Info][Deadcode] Logical lines of code (LLoC) summary: - live: 7 - dead: 0 - total lines: 7 - [Info][Unsound] Write to unknown address: privatization is unsound. (49-type-invariants.c:21:3-21:21) - [Info][Imprecise] INVALIDATING ALL GLOBALS! (49-type-invariants.c:21:3-21:21) - [Info][Imprecise] Invalidating expressions: & s (49-type-invariants.c:21:3-21:21) - [Info][Imprecise] Invalidating expressions: & tmp (49-type-invariants.c:21:3-21:21) - [Error][Imprecise][Unsound] Function definition missing for getS (49-type-invariants.c:21:3-21:21) - [Error][Imprecise][Unsound] Function definition missing + $ goblint --enable warn.deterministic --enable ana.race.direct-arithmetic --enable allglobs --enable dbg.full-output 49-type-invariants.c > full-output-1.txt 2>&1 - $ goblint --enable warn.deterministic --disable ana.race.direct-arithmetic --enable allglobs --enable dbg.full-output 49-type-invariants.c - [Warning][Behavior > Undefined > NullPointerDereference][CWE-476] May dereference NULL pointer (49-type-invariants.c:21:3-21:21) - [Warning][Race] Memory location s.field (race with conf. 110): (49-type-invariants.c:8:10-8:11) - write with [mhp:{tid=[main]; created={[main, t_fun@49-type-invariants.c:20:3-20:40#top]}}, thread:[main]] (conf. 100) (exp: & tmp->field) (49-type-invariants.c:21:3-21:21) - read with [mhp:{tid=[main, t_fun@49-type-invariants.c:20:3-20:40#top]}, thread:[main, t_fun@49-type-invariants.c:20:3-20:40#top]] (conf. 110) (exp: & s.field) (49-type-invariants.c:11:3-11:23) - [Info][Race] Memory locations race summary: - safe: 1 - vulnerable: 0 - unsafe: 1 - total memory locations: 2 - [Success][Race] Memory location (struct S).field (safe): - write with [mhp:{tid=[main]; created={[main, t_fun@49-type-invariants.c:20:3-20:40#top]}}, thread:[main]] (conf. 100) (exp: & tmp->field) (49-type-invariants.c:21:3-21:21) - [Info][Deadcode] Logical lines of code (LLoC) summary: - live: 7 - dead: 0 - total lines: 7 - [Info][Unsound] Write to unknown address: privatization is unsound. (49-type-invariants.c:21:3-21:21) - [Info][Imprecise] INVALIDATING ALL GLOBALS! (49-type-invariants.c:21:3-21:21) - [Info][Imprecise] Invalidating expressions: & s (49-type-invariants.c:21:3-21:21) - [Info][Imprecise] Invalidating expressions: & tmp (49-type-invariants.c:21:3-21:21) - [Error][Imprecise][Unsound] Function definition missing for getS (49-type-invariants.c:21:3-21:21) - [Error][Imprecise][Unsound] Function definition missing + $ diff default-output-1.txt full-output-1.txt + 3,4c3,4 + < write with [mhp:{created={[main, t_fun@49-type-invariants.c:20:3-20:40]}}, thread:[main]] (conf. 100) (exp: & tmp->field) (49-type-invariants.c:21:3-21:21) + < read with thread:[main, t_fun@49-type-invariants.c:20:3-20:40] (conf. 110) (exp: & s.field) (49-type-invariants.c:11:3-11:23) + --- + > write with [mhp:{tid=[main]; created={[main, t_fun@49-type-invariants.c:20:3-20:40#top]}}, thread:[main]] (conf. 100) (exp: & tmp->field) (49-type-invariants.c:21:3-21:21) + > read with [mhp:{tid=[main, t_fun@49-type-invariants.c:20:3-20:40#top]}, thread:[main, t_fun@49-type-invariants.c:20:3-20:40#top]] (conf. 110) (exp: & s.field) (49-type-invariants.c:11:3-11:23) + 11c11 + < write with [mhp:{created={[main, t_fun@49-type-invariants.c:20:3-20:40]}}, thread:[main]] (conf. 100) (exp: & tmp->field) (49-type-invariants.c:21:3-21:21) + --- + > write with [mhp:{tid=[main]; created={[main, t_fun@49-type-invariants.c:20:3-20:40#top]}}, thread:[main]] (conf. 100) (exp: & tmp->field) (49-type-invariants.c:21:3-21:21) + [1] + + $ goblint --enable warn.deterministic --disable ana.race.direct-arithmetic --enable allglobs --enable dbg.full-output 49-type-invariants.c > full-output-2.txt 2>&1 + + $ diff default-output-2.txt full-output-2.txt + 3,4c3,4 + < write with [mhp:{created={[main, t_fun@49-type-invariants.c:20:3-20:40]}}, thread:[main]] (conf. 100) (exp: & tmp->field) (49-type-invariants.c:21:3-21:21) + < read with thread:[main, t_fun@49-type-invariants.c:20:3-20:40] (conf. 110) (exp: & s.field) (49-type-invariants.c:11:3-11:23) + --- + > write with [mhp:{tid=[main]; created={[main, t_fun@49-type-invariants.c:20:3-20:40#top]}}, thread:[main]] (conf. 100) (exp: & tmp->field) (49-type-invariants.c:21:3-21:21) + > read with [mhp:{tid=[main, t_fun@49-type-invariants.c:20:3-20:40#top]}, thread:[main, t_fun@49-type-invariants.c:20:3-20:40#top]] (conf. 110) (exp: & s.field) (49-type-invariants.c:11:3-11:23) + 11c11 + < write with [mhp:{created={[main, t_fun@49-type-invariants.c:20:3-20:40]}}, thread:[main]] (conf. 100) (exp: & tmp->field) (49-type-invariants.c:21:3-21:21) + --- + > write with [mhp:{tid=[main]; created={[main, t_fun@49-type-invariants.c:20:3-20:40#top]}}, thread:[main]] (conf. 100) (exp: & tmp->field) (49-type-invariants.c:21:3-21:21) + [1] diff --git a/tests/regression/04-mutex/77-type-nested-fields.t b/tests/regression/04-mutex/77-type-nested-fields.t index 1dcd624228..3f2de12a66 100644 --- a/tests/regression/04-mutex/77-type-nested-fields.t +++ b/tests/regression/04-mutex/77-type-nested-fields.t @@ -1,4 +1,4 @@ - $ goblint --enable warn.deterministic --enable allglobs 77-type-nested-fields.c + $ goblint --enable warn.deterministic --enable allglobs 77-type-nested-fields.c 2>&1 | tee default-output.txt [Warning][Behavior > Undefined > NullPointerDereference][CWE-476] May dereference NULL pointer (77-type-nested-fields.c:31:3-31:20) [Warning][Behavior > Undefined > NullPointerDereference][CWE-476] May dereference NULL pointer (77-type-nested-fields.c:38:3-38:22) [Warning][Race] Memory location (struct T).s.field (race with conf. 100): @@ -25,29 +25,17 @@ [Error][Imprecise][Unsound] Function definition missing for getT (77-type-nested-fields.c:38:3-38:22) [Error][Imprecise][Unsound] Function definition missing - $ goblint --enable warn.deterministic --enable allglobs --enable dbg.full-output 77-type-nested-fields.c - [Warning][Behavior > Undefined > NullPointerDereference][CWE-476] May dereference NULL pointer (77-type-nested-fields.c:31:3-31:20) - [Warning][Behavior > Undefined > NullPointerDereference][CWE-476] May dereference NULL pointer (77-type-nested-fields.c:38:3-38:22) - [Warning][Race] Memory location (struct T).s.field (race with conf. 100): - write with [mhp:{tid=[main, t_fun@77-type-nested-fields.c:37:3-37:40#top]}, thread:[main, t_fun@77-type-nested-fields.c:37:3-37:40#top]] (conf. 100) (exp: & tmp->field) (77-type-nested-fields.c:31:3-31:20) - write with [mhp:{tid=[main]; created={[main, t_fun@77-type-nested-fields.c:37:3-37:40#top]}}, thread:[main]] (conf. 100) (exp: & tmp->s.field) (77-type-nested-fields.c:38:3-38:22) - [Info][Race] Memory locations race summary: - safe: 1 - vulnerable: 0 - unsafe: 1 - total memory locations: 2 - [Success][Race] Memory location (struct S).field (safe): - write with [mhp:{tid=[main, t_fun@77-type-nested-fields.c:37:3-37:40#top]}, thread:[main, t_fun@77-type-nested-fields.c:37:3-37:40#top]] (conf. 100) (exp: & tmp->field) (77-type-nested-fields.c:31:3-31:20) - [Info][Deadcode] Logical lines of code (LLoC) summary: - live: 7 - dead: 0 - total lines: 7 - [Info][Unsound] Write to unknown address: privatization is unsound. (77-type-nested-fields.c:31:3-31:20) - [Info][Unsound] Write to unknown address: privatization is unsound. (77-type-nested-fields.c:38:3-38:22) - [Info][Imprecise] INVALIDATING ALL GLOBALS! (77-type-nested-fields.c:31:3-31:20) - [Info][Imprecise] Invalidating expressions: & tmp (77-type-nested-fields.c:31:3-31:20) - [Info][Imprecise] INVALIDATING ALL GLOBALS! (77-type-nested-fields.c:38:3-38:22) - [Info][Imprecise] Invalidating expressions: & tmp (77-type-nested-fields.c:38:3-38:22) - [Error][Imprecise][Unsound] Function definition missing for getS (77-type-nested-fields.c:31:3-31:20) - [Error][Imprecise][Unsound] Function definition missing for getT (77-type-nested-fields.c:38:3-38:22) - [Error][Imprecise][Unsound] Function definition missing + $ goblint --enable warn.deterministic --enable allglobs --enable dbg.full-output 77-type-nested-fields.c > full-output.txt 2>&1 + + $ diff default-output.txt full-output.txt + 4,5c4,5 + < write with thread:[main, t_fun@77-type-nested-fields.c:37:3-37:40] (conf. 100) (exp: & tmp->field) (77-type-nested-fields.c:31:3-31:20) + < write with [mhp:{created={[main, t_fun@77-type-nested-fields.c:37:3-37:40]}}, thread:[main]] (conf. 100) (exp: & tmp->s.field) (77-type-nested-fields.c:38:3-38:22) + --- + > write with [mhp:{tid=[main, t_fun@77-type-nested-fields.c:37:3-37:40#top]}, thread:[main, t_fun@77-type-nested-fields.c:37:3-37:40#top]] (conf. 100) (exp: & tmp->field) (77-type-nested-fields.c:31:3-31:20) + > write with [mhp:{tid=[main]; created={[main, t_fun@77-type-nested-fields.c:37:3-37:40#top]}}, thread:[main]] (conf. 100) (exp: & tmp->s.field) (77-type-nested-fields.c:38:3-38:22) + 12c12 + < write with thread:[main, t_fun@77-type-nested-fields.c:37:3-37:40] (conf. 100) (exp: & tmp->field) (77-type-nested-fields.c:31:3-31:20) + --- + > write with [mhp:{tid=[main, t_fun@77-type-nested-fields.c:37:3-37:40#top]}, thread:[main, t_fun@77-type-nested-fields.c:37:3-37:40#top]] (conf. 100) (exp: & tmp->field) (77-type-nested-fields.c:31:3-31:20) + [1] diff --git a/tests/regression/04-mutex/79-type-nested-fields-deep1.t b/tests/regression/04-mutex/79-type-nested-fields-deep1.t index d7e40edaa1..244e705d4a 100644 --- a/tests/regression/04-mutex/79-type-nested-fields-deep1.t +++ b/tests/regression/04-mutex/79-type-nested-fields-deep1.t @@ -1,4 +1,4 @@ - $ goblint --enable warn.deterministic --enable allglobs 79-type-nested-fields-deep1.c + $ goblint --enable warn.deterministic --enable allglobs 79-type-nested-fields-deep1.c 2>&1 | tee default-output.txt [Warning][Behavior > Undefined > NullPointerDereference][CWE-476] May dereference NULL pointer (79-type-nested-fields-deep1.c:36:3-36:20) [Warning][Behavior > Undefined > NullPointerDereference][CWE-476] May dereference NULL pointer (79-type-nested-fields-deep1.c:43:3-43:24) [Warning][Race] Memory location (struct U).t.s.field (race with conf. 100): @@ -25,29 +25,17 @@ [Error][Imprecise][Unsound] Function definition missing for getU (79-type-nested-fields-deep1.c:43:3-43:24) [Error][Imprecise][Unsound] Function definition missing - $ goblint --enable warn.deterministic --enable allglobs --enable dbg.full-output 79-type-nested-fields-deep1.c - [Warning][Behavior > Undefined > NullPointerDereference][CWE-476] May dereference NULL pointer (79-type-nested-fields-deep1.c:36:3-36:20) - [Warning][Behavior > Undefined > NullPointerDereference][CWE-476] May dereference NULL pointer (79-type-nested-fields-deep1.c:43:3-43:24) - [Warning][Race] Memory location (struct U).t.s.field (race with conf. 100): - write with [mhp:{tid=[main, t_fun@79-type-nested-fields-deep1.c:42:3-42:40#top]}, thread:[main, t_fun@79-type-nested-fields-deep1.c:42:3-42:40#top]] (conf. 100) (exp: & tmp->field) (79-type-nested-fields-deep1.c:36:3-36:20) - write with [mhp:{tid=[main]; created={[main, t_fun@79-type-nested-fields-deep1.c:42:3-42:40#top]}}, thread:[main]] (conf. 100) (exp: & tmp->t.s.field) (79-type-nested-fields-deep1.c:43:3-43:24) - [Info][Race] Memory locations race summary: - safe: 1 - vulnerable: 0 - unsafe: 1 - total memory locations: 2 - [Success][Race] Memory location (struct S).field (safe): - write with [mhp:{tid=[main, t_fun@79-type-nested-fields-deep1.c:42:3-42:40#top]}, thread:[main, t_fun@79-type-nested-fields-deep1.c:42:3-42:40#top]] (conf. 100) (exp: & tmp->field) (79-type-nested-fields-deep1.c:36:3-36:20) - [Info][Deadcode] Logical lines of code (LLoC) summary: - live: 7 - dead: 0 - total lines: 7 - [Info][Unsound] Write to unknown address: privatization is unsound. (79-type-nested-fields-deep1.c:36:3-36:20) - [Info][Unsound] Write to unknown address: privatization is unsound. (79-type-nested-fields-deep1.c:43:3-43:24) - [Info][Imprecise] INVALIDATING ALL GLOBALS! (79-type-nested-fields-deep1.c:36:3-36:20) - [Info][Imprecise] Invalidating expressions: & tmp (79-type-nested-fields-deep1.c:36:3-36:20) - [Info][Imprecise] INVALIDATING ALL GLOBALS! (79-type-nested-fields-deep1.c:43:3-43:24) - [Info][Imprecise] Invalidating expressions: & tmp (79-type-nested-fields-deep1.c:43:3-43:24) - [Error][Imprecise][Unsound] Function definition missing for getS (79-type-nested-fields-deep1.c:36:3-36:20) - [Error][Imprecise][Unsound] Function definition missing for getU (79-type-nested-fields-deep1.c:43:3-43:24) - [Error][Imprecise][Unsound] Function definition missing + $ goblint --enable warn.deterministic --enable allglobs --enable dbg.full-output 79-type-nested-fields-deep1.c > full-output.txt 2>&1 + + $ diff default-output.txt full-output.txt + 4,5c4,5 + < write with thread:[main, t_fun@79-type-nested-fields-deep1.c:42:3-42:40] (conf. 100) (exp: & tmp->field) (79-type-nested-fields-deep1.c:36:3-36:20) + < write with [mhp:{created={[main, t_fun@79-type-nested-fields-deep1.c:42:3-42:40]}}, thread:[main]] (conf. 100) (exp: & tmp->t.s.field) (79-type-nested-fields-deep1.c:43:3-43:24) + --- + > write with [mhp:{tid=[main, t_fun@79-type-nested-fields-deep1.c:42:3-42:40#top]}, thread:[main, t_fun@79-type-nested-fields-deep1.c:42:3-42:40#top]] (conf. 100) (exp: & tmp->field) (79-type-nested-fields-deep1.c:36:3-36:20) + > write with [mhp:{tid=[main]; created={[main, t_fun@79-type-nested-fields-deep1.c:42:3-42:40#top]}}, thread:[main]] (conf. 100) (exp: & tmp->t.s.field) (79-type-nested-fields-deep1.c:43:3-43:24) + 12c12 + < write with thread:[main, t_fun@79-type-nested-fields-deep1.c:42:3-42:40] (conf. 100) (exp: & tmp->field) (79-type-nested-fields-deep1.c:36:3-36:20) + --- + > write with [mhp:{tid=[main, t_fun@79-type-nested-fields-deep1.c:42:3-42:40#top]}, thread:[main, t_fun@79-type-nested-fields-deep1.c:42:3-42:40#top]] (conf. 100) (exp: & tmp->field) (79-type-nested-fields-deep1.c:36:3-36:20) + [1] diff --git a/tests/regression/04-mutex/80-type-nested-fields-deep2.t b/tests/regression/04-mutex/80-type-nested-fields-deep2.t index b102b3adf3..cebd5ed7ec 100644 --- a/tests/regression/04-mutex/80-type-nested-fields-deep2.t +++ b/tests/regression/04-mutex/80-type-nested-fields-deep2.t @@ -1,4 +1,4 @@ - $ goblint --enable warn.deterministic --enable allglobs 80-type-nested-fields-deep2.c + $ goblint --enable warn.deterministic --enable allglobs 80-type-nested-fields-deep2.c 2>&1 | tee default-output.txt [Warning][Behavior > Undefined > NullPointerDereference][CWE-476] May dereference NULL pointer (80-type-nested-fields-deep2.c:36:3-36:22) [Warning][Behavior > Undefined > NullPointerDereference][CWE-476] May dereference NULL pointer (80-type-nested-fields-deep2.c:43:3-43:24) [Warning][Race] Memory location (struct U).t.s.field (race with conf. 100): @@ -25,29 +25,17 @@ [Error][Imprecise][Unsound] Function definition missing for getU (80-type-nested-fields-deep2.c:43:3-43:24) [Error][Imprecise][Unsound] Function definition missing - $ goblint --enable warn.deterministic --enable allglobs --enable dbg.full-output 80-type-nested-fields-deep2.c - [Warning][Behavior > Undefined > NullPointerDereference][CWE-476] May dereference NULL pointer (80-type-nested-fields-deep2.c:36:3-36:22) - [Warning][Behavior > Undefined > NullPointerDereference][CWE-476] May dereference NULL pointer (80-type-nested-fields-deep2.c:43:3-43:24) - [Warning][Race] Memory location (struct U).t.s.field (race with conf. 100): - write with [mhp:{tid=[main, t_fun@80-type-nested-fields-deep2.c:42:3-42:40#top]}, thread:[main, t_fun@80-type-nested-fields-deep2.c:42:3-42:40#top]] (conf. 100) (exp: & tmp->s.field) (80-type-nested-fields-deep2.c:36:3-36:22) - write with [mhp:{tid=[main]; created={[main, t_fun@80-type-nested-fields-deep2.c:42:3-42:40#top]}}, thread:[main]] (conf. 100) (exp: & tmp->t.s.field) (80-type-nested-fields-deep2.c:43:3-43:24) - [Info][Race] Memory locations race summary: - safe: 1 - vulnerable: 0 - unsafe: 1 - total memory locations: 2 - [Success][Race] Memory location (struct T).s.field (safe): - write with [mhp:{tid=[main, t_fun@80-type-nested-fields-deep2.c:42:3-42:40#top]}, thread:[main, t_fun@80-type-nested-fields-deep2.c:42:3-42:40#top]] (conf. 100) (exp: & tmp->s.field) (80-type-nested-fields-deep2.c:36:3-36:22) - [Info][Deadcode] Logical lines of code (LLoC) summary: - live: 7 - dead: 0 - total lines: 7 - [Info][Unsound] Write to unknown address: privatization is unsound. (80-type-nested-fields-deep2.c:36:3-36:22) - [Info][Unsound] Write to unknown address: privatization is unsound. (80-type-nested-fields-deep2.c:43:3-43:24) - [Info][Imprecise] INVALIDATING ALL GLOBALS! (80-type-nested-fields-deep2.c:36:3-36:22) - [Info][Imprecise] Invalidating expressions: & tmp (80-type-nested-fields-deep2.c:36:3-36:22) - [Info][Imprecise] INVALIDATING ALL GLOBALS! (80-type-nested-fields-deep2.c:43:3-43:24) - [Info][Imprecise] Invalidating expressions: & tmp (80-type-nested-fields-deep2.c:43:3-43:24) - [Error][Imprecise][Unsound] Function definition missing for getT (80-type-nested-fields-deep2.c:36:3-36:22) - [Error][Imprecise][Unsound] Function definition missing for getU (80-type-nested-fields-deep2.c:43:3-43:24) - [Error][Imprecise][Unsound] Function definition missing + $ goblint --enable warn.deterministic --enable allglobs --enable dbg.full-output 80-type-nested-fields-deep2.c > full-output.txt 2>&1 + + $ diff default-output.txt full-output.txt + 4,5c4,5 + < write with thread:[main, t_fun@80-type-nested-fields-deep2.c:42:3-42:40] (conf. 100) (exp: & tmp->s.field) (80-type-nested-fields-deep2.c:36:3-36:22) + < write with [mhp:{created={[main, t_fun@80-type-nested-fields-deep2.c:42:3-42:40]}}, thread:[main]] (conf. 100) (exp: & tmp->t.s.field) (80-type-nested-fields-deep2.c:43:3-43:24) + --- + > write with [mhp:{tid=[main, t_fun@80-type-nested-fields-deep2.c:42:3-42:40#top]}, thread:[main, t_fun@80-type-nested-fields-deep2.c:42:3-42:40#top]] (conf. 100) (exp: & tmp->s.field) (80-type-nested-fields-deep2.c:36:3-36:22) + > write with [mhp:{tid=[main]; created={[main, t_fun@80-type-nested-fields-deep2.c:42:3-42:40#top]}}, thread:[main]] (conf. 100) (exp: & tmp->t.s.field) (80-type-nested-fields-deep2.c:43:3-43:24) + 12c12 + < write with thread:[main, t_fun@80-type-nested-fields-deep2.c:42:3-42:40] (conf. 100) (exp: & tmp->s.field) (80-type-nested-fields-deep2.c:36:3-36:22) + --- + > write with [mhp:{tid=[main, t_fun@80-type-nested-fields-deep2.c:42:3-42:40#top]}, thread:[main, t_fun@80-type-nested-fields-deep2.c:42:3-42:40#top]] (conf. 100) (exp: & tmp->s.field) (80-type-nested-fields-deep2.c:36:3-36:22) + [1] diff --git a/tests/regression/04-mutex/84-distribute-fields-1.t b/tests/regression/04-mutex/84-distribute-fields-1.t index df2aecf6c3..bee688e709 100644 --- a/tests/regression/04-mutex/84-distribute-fields-1.t +++ b/tests/regression/04-mutex/84-distribute-fields-1.t @@ -1,4 +1,4 @@ - $ goblint --enable warn.deterministic --enable allglobs 84-distribute-fields-1.c + $ goblint --enable warn.deterministic --enable allglobs 84-distribute-fields-1.c 2>&1 | tee default-output.txt [Warning][Race] Memory location s.data (race with conf. 110): (84-distribute-fields-1.c:9:10-9:11) write with thread:[main, t_fun@84-distribute-fields-1.c:18:3-18:40] (conf. 110) (exp: & s.data) (84-distribute-fields-1.c:12:3-12:13) write with [mhp:{created={[main, t_fun@84-distribute-fields-1.c:18:3-18:40]}}, thread:[main]] (conf. 110) (exp: & s) (84-distribute-fields-1.c:20:3-20:9) @@ -14,18 +14,17 @@ dead: 0 total lines: 8 - $ goblint --enable warn.deterministic --enable allglobs --enable dbg.full-output 84-distribute-fields-1.c - [Warning][Race] Memory location s.data (race with conf. 110): (84-distribute-fields-1.c:9:10-9:11) - write with [mhp:{tid=[main, t_fun@84-distribute-fields-1.c:18:3-18:40#top]}, thread:[main, t_fun@84-distribute-fields-1.c:18:3-18:40#top]] (conf. 110) (exp: & s.data) (84-distribute-fields-1.c:12:3-12:13) - write with [mhp:{tid=[main]; created={[main, t_fun@84-distribute-fields-1.c:18:3-18:40#top]}}, thread:[main]] (conf. 110) (exp: & s) (84-distribute-fields-1.c:20:3-20:9) - [Info][Race] Memory locations race summary: - safe: 1 - vulnerable: 0 - unsafe: 1 - total memory locations: 2 - [Success][Race] Memory location s (safe): (84-distribute-fields-1.c:9:10-9:11) - write with [mhp:{tid=[main]; created={[main, t_fun@84-distribute-fields-1.c:18:3-18:40#top]}}, thread:[main]] (conf. 110) (exp: & s) (84-distribute-fields-1.c:20:3-20:9) - [Info][Deadcode] Logical lines of code (LLoC) summary: - live: 8 - dead: 0 - total lines: 8 + $ goblint --enable warn.deterministic --enable allglobs --enable dbg.full-output 84-distribute-fields-1.c > full-output.txt 2>&1 + + $ diff default-output.txt full-output.txt + 2,3c2,3 + < write with thread:[main, t_fun@84-distribute-fields-1.c:18:3-18:40] (conf. 110) (exp: & s.data) (84-distribute-fields-1.c:12:3-12:13) + < write with [mhp:{created={[main, t_fun@84-distribute-fields-1.c:18:3-18:40]}}, thread:[main]] (conf. 110) (exp: & s) (84-distribute-fields-1.c:20:3-20:9) + --- + > write with [mhp:{tid=[main, t_fun@84-distribute-fields-1.c:18:3-18:40#top]}, thread:[main, t_fun@84-distribute-fields-1.c:18:3-18:40#top]] (conf. 110) (exp: & s.data) (84-distribute-fields-1.c:12:3-12:13) + > write with [mhp:{tid=[main]; created={[main, t_fun@84-distribute-fields-1.c:18:3-18:40#top]}}, thread:[main]] (conf. 110) (exp: & s) (84-distribute-fields-1.c:20:3-20:9) + 10c10 + < write with [mhp:{created={[main, t_fun@84-distribute-fields-1.c:18:3-18:40]}}, thread:[main]] (conf. 110) (exp: & s) (84-distribute-fields-1.c:20:3-20:9) + --- + > write with [mhp:{tid=[main]; created={[main, t_fun@84-distribute-fields-1.c:18:3-18:40#top]}}, thread:[main]] (conf. 110) (exp: & s) (84-distribute-fields-1.c:20:3-20:9) + [1] diff --git a/tests/regression/04-mutex/85-distribute-fields-2.t b/tests/regression/04-mutex/85-distribute-fields-2.t index 239348a2f0..a6288fc534 100644 --- a/tests/regression/04-mutex/85-distribute-fields-2.t +++ b/tests/regression/04-mutex/85-distribute-fields-2.t @@ -1,4 +1,4 @@ - $ goblint --enable warn.deterministic --enable allglobs 85-distribute-fields-2.c + $ goblint --enable warn.deterministic --enable allglobs 85-distribute-fields-2.c 2>&1 | tee default-output.txt [Warning][Race] Memory location t.s.data (race with conf. 110): (85-distribute-fields-2.c:15:10-15:11) write with thread:[main, t_fun@85-distribute-fields-2.c:24:3-24:40] (conf. 110) (exp: & t.s.data) (85-distribute-fields-2.c:18:3-18:15) write with [mhp:{created={[main, t_fun@85-distribute-fields-2.c:24:3-24:40]}}, thread:[main]] (conf. 110) (exp: & t.s) (85-distribute-fields-2.c:26:3-26:11) @@ -14,18 +14,17 @@ dead: 0 total lines: 8 - $ goblint --enable warn.deterministic --enable allglobs --enable dbg.full-output 85-distribute-fields-2.c - [Warning][Race] Memory location t.s.data (race with conf. 110): (85-distribute-fields-2.c:15:10-15:11) - write with [mhp:{tid=[main, t_fun@85-distribute-fields-2.c:24:3-24:40#top]}, thread:[main, t_fun@85-distribute-fields-2.c:24:3-24:40#top]] (conf. 110) (exp: & t.s.data) (85-distribute-fields-2.c:18:3-18:15) - write with [mhp:{tid=[main]; created={[main, t_fun@85-distribute-fields-2.c:24:3-24:40#top]}}, thread:[main]] (conf. 110) (exp: & t.s) (85-distribute-fields-2.c:26:3-26:11) - [Info][Race] Memory locations race summary: - safe: 1 - vulnerable: 0 - unsafe: 1 - total memory locations: 2 - [Success][Race] Memory location t.s (safe): (85-distribute-fields-2.c:15:10-15:11) - write with [mhp:{tid=[main]; created={[main, t_fun@85-distribute-fields-2.c:24:3-24:40#top]}}, thread:[main]] (conf. 110) (exp: & t.s) (85-distribute-fields-2.c:26:3-26:11) - [Info][Deadcode] Logical lines of code (LLoC) summary: - live: 8 - dead: 0 - total lines: 8 + $ goblint --enable warn.deterministic --enable allglobs --enable dbg.full-output 85-distribute-fields-2.c > full-output.txt 2>&1 + + $ diff default-output.txt full-output.txt + 2,3c2,3 + < write with thread:[main, t_fun@85-distribute-fields-2.c:24:3-24:40] (conf. 110) (exp: & t.s.data) (85-distribute-fields-2.c:18:3-18:15) + < write with [mhp:{created={[main, t_fun@85-distribute-fields-2.c:24:3-24:40]}}, thread:[main]] (conf. 110) (exp: & t.s) (85-distribute-fields-2.c:26:3-26:11) + --- + > write with [mhp:{tid=[main, t_fun@85-distribute-fields-2.c:24:3-24:40#top]}, thread:[main, t_fun@85-distribute-fields-2.c:24:3-24:40#top]] (conf. 110) (exp: & t.s.data) (85-distribute-fields-2.c:18:3-18:15) + > write with [mhp:{tid=[main]; created={[main, t_fun@85-distribute-fields-2.c:24:3-24:40#top]}}, thread:[main]] (conf. 110) (exp: & t.s) (85-distribute-fields-2.c:26:3-26:11) + 10c10 + < write with [mhp:{created={[main, t_fun@85-distribute-fields-2.c:24:3-24:40]}}, thread:[main]] (conf. 110) (exp: & t.s) (85-distribute-fields-2.c:26:3-26:11) + --- + > write with [mhp:{tid=[main]; created={[main, t_fun@85-distribute-fields-2.c:24:3-24:40#top]}}, thread:[main]] (conf. 110) (exp: & t.s) (85-distribute-fields-2.c:26:3-26:11) + [1] diff --git a/tests/regression/04-mutex/86-distribute-fields-3.t b/tests/regression/04-mutex/86-distribute-fields-3.t index 64ab44a7bd..c370f3593b 100644 --- a/tests/regression/04-mutex/86-distribute-fields-3.t +++ b/tests/regression/04-mutex/86-distribute-fields-3.t @@ -1,4 +1,4 @@ - $ goblint --enable warn.deterministic --enable allglobs 86-distribute-fields-3.c + $ goblint --enable warn.deterministic --enable allglobs 86-distribute-fields-3.c 2>&1 | tee default-output.txt [Warning][Race] Memory location t.s.data (race with conf. 110): (86-distribute-fields-3.c:15:10-15:11) write with thread:[main, t_fun@86-distribute-fields-3.c:24:3-24:40] (conf. 110) (exp: & t.s.data) (86-distribute-fields-3.c:18:3-18:15) write with [mhp:{created={[main, t_fun@86-distribute-fields-3.c:24:3-24:40]}}, thread:[main]] (conf. 110) (exp: & t) (86-distribute-fields-3.c:26:3-26:9) @@ -14,18 +14,17 @@ dead: 0 total lines: 8 - $ goblint --enable warn.deterministic --enable allglobs --enable dbg.full-output 86-distribute-fields-3.c - [Warning][Race] Memory location t.s.data (race with conf. 110): (86-distribute-fields-3.c:15:10-15:11) - write with [mhp:{tid=[main, t_fun@86-distribute-fields-3.c:24:3-24:40#top]}, thread:[main, t_fun@86-distribute-fields-3.c:24:3-24:40#top]] (conf. 110) (exp: & t.s.data) (86-distribute-fields-3.c:18:3-18:15) - write with [mhp:{tid=[main]; created={[main, t_fun@86-distribute-fields-3.c:24:3-24:40#top]}}, thread:[main]] (conf. 110) (exp: & t) (86-distribute-fields-3.c:26:3-26:9) - [Info][Race] Memory locations race summary: - safe: 1 - vulnerable: 0 - unsafe: 1 - total memory locations: 2 - [Success][Race] Memory location t (safe): (86-distribute-fields-3.c:15:10-15:11) - write with [mhp:{tid=[main]; created={[main, t_fun@86-distribute-fields-3.c:24:3-24:40#top]}}, thread:[main]] (conf. 110) (exp: & t) (86-distribute-fields-3.c:26:3-26:9) - [Info][Deadcode] Logical lines of code (LLoC) summary: - live: 8 - dead: 0 - total lines: 8 + $ goblint --enable warn.deterministic --enable allglobs --enable dbg.full-output 86-distribute-fields-3.c > full-output.txt 2>&1 + + $ diff default-output.txt full-output.txt + 2,3c2,3 + < write with thread:[main, t_fun@86-distribute-fields-3.c:24:3-24:40] (conf. 110) (exp: & t.s.data) (86-distribute-fields-3.c:18:3-18:15) + < write with [mhp:{created={[main, t_fun@86-distribute-fields-3.c:24:3-24:40]}}, thread:[main]] (conf. 110) (exp: & t) (86-distribute-fields-3.c:26:3-26:9) + --- + > write with [mhp:{tid=[main, t_fun@86-distribute-fields-3.c:24:3-24:40#top]}, thread:[main, t_fun@86-distribute-fields-3.c:24:3-24:40#top]] (conf. 110) (exp: & t.s.data) (86-distribute-fields-3.c:18:3-18:15) + > write with [mhp:{tid=[main]; created={[main, t_fun@86-distribute-fields-3.c:24:3-24:40#top]}}, thread:[main]] (conf. 110) (exp: & t) (86-distribute-fields-3.c:26:3-26:9) + 10c10 + < write with [mhp:{created={[main, t_fun@86-distribute-fields-3.c:24:3-24:40]}}, thread:[main]] (conf. 110) (exp: & t) (86-distribute-fields-3.c:26:3-26:9) + --- + > write with [mhp:{tid=[main]; created={[main, t_fun@86-distribute-fields-3.c:24:3-24:40#top]}}, thread:[main]] (conf. 110) (exp: & t) (86-distribute-fields-3.c:26:3-26:9) + [1] diff --git a/tests/regression/04-mutex/87-distribute-fields-4.t b/tests/regression/04-mutex/87-distribute-fields-4.t index 8784a77a70..904594224a 100644 --- a/tests/regression/04-mutex/87-distribute-fields-4.t +++ b/tests/regression/04-mutex/87-distribute-fields-4.t @@ -1,4 +1,4 @@ - $ goblint --enable warn.deterministic --enable allglobs 87-distribute-fields-4.c + $ goblint --enable warn.deterministic --enable allglobs 87-distribute-fields-4.c 2>&1 | tee default-output.txt [Warning][Race] Memory location s (race with conf. 110): (87-distribute-fields-4.c:9:10-9:11) write with thread:[main, t_fun@87-distribute-fields-4.c:19:3-19:40] (conf. 110) (exp: & s) (87-distribute-fields-4.c:13:3-13:9) write with [mhp:{created={[main, t_fun@87-distribute-fields-4.c:19:3-19:40]}}, thread:[main]] (conf. 110) (exp: & s) (87-distribute-fields-4.c:21:3-21:9) @@ -12,16 +12,13 @@ dead: 0 total lines: 8 - $ goblint --enable warn.deterministic --enable allglobs --enable dbg.full-output 87-distribute-fields-4.c - [Warning][Race] Memory location s (race with conf. 110): (87-distribute-fields-4.c:9:10-9:11) - write with [mhp:{tid=[main, t_fun@87-distribute-fields-4.c:19:3-19:40#top]}, thread:[main, t_fun@87-distribute-fields-4.c:19:3-19:40#top]] (conf. 110) (exp: & s) (87-distribute-fields-4.c:13:3-13:9) - write with [mhp:{tid=[main]; created={[main, t_fun@87-distribute-fields-4.c:19:3-19:40#top]}}, thread:[main]] (conf. 110) (exp: & s) (87-distribute-fields-4.c:21:3-21:9) - [Info][Race] Memory locations race summary: - safe: 0 - vulnerable: 0 - unsafe: 1 - total memory locations: 1 - [Info][Deadcode] Logical lines of code (LLoC) summary: - live: 8 - dead: 0 - total lines: 8 + $ goblint --enable warn.deterministic --enable allglobs --enable dbg.full-output 87-distribute-fields-4.c > full-output.txt 2>&1 + + $ diff default-output.txt full-output.txt + 2,3c2,3 + < write with thread:[main, t_fun@87-distribute-fields-4.c:19:3-19:40] (conf. 110) (exp: & s) (87-distribute-fields-4.c:13:3-13:9) + < write with [mhp:{created={[main, t_fun@87-distribute-fields-4.c:19:3-19:40]}}, thread:[main]] (conf. 110) (exp: & s) (87-distribute-fields-4.c:21:3-21:9) + --- + > write with [mhp:{tid=[main, t_fun@87-distribute-fields-4.c:19:3-19:40#top]}, thread:[main, t_fun@87-distribute-fields-4.c:19:3-19:40#top]] (conf. 110) (exp: & s) (87-distribute-fields-4.c:13:3-13:9) + > write with [mhp:{tid=[main]; created={[main, t_fun@87-distribute-fields-4.c:19:3-19:40#top]}}, thread:[main]] (conf. 110) (exp: & s) (87-distribute-fields-4.c:21:3-21:9) + [1] diff --git a/tests/regression/04-mutex/88-distribute-fields-5.t b/tests/regression/04-mutex/88-distribute-fields-5.t index 0dd4fd52a5..7bae9c0c36 100644 --- a/tests/regression/04-mutex/88-distribute-fields-5.t +++ b/tests/regression/04-mutex/88-distribute-fields-5.t @@ -1,4 +1,4 @@ - $ goblint --enable warn.deterministic --enable allglobs 88-distribute-fields-5.c + $ goblint --enable warn.deterministic --enable allglobs 88-distribute-fields-5.c 2>&1 | tee default-output.txt [Warning][Race] Memory location t.s (race with conf. 110): (88-distribute-fields-5.c:15:10-15:11) write with thread:[main, t_fun@88-distribute-fields-5.c:25:3-25:40] (conf. 110) (exp: & t.s) (88-distribute-fields-5.c:19:3-19:11) write with [mhp:{created={[main, t_fun@88-distribute-fields-5.c:25:3-25:40]}}, thread:[main]] (conf. 110) (exp: & t.s) (88-distribute-fields-5.c:27:3-27:11) @@ -12,16 +12,13 @@ dead: 0 total lines: 8 - $ goblint --enable warn.deterministic --enable allglobs --enable dbg.full-output 88-distribute-fields-5.c - [Warning][Race] Memory location t.s (race with conf. 110): (88-distribute-fields-5.c:15:10-15:11) - write with [mhp:{tid=[main, t_fun@88-distribute-fields-5.c:25:3-25:40#top]}, thread:[main, t_fun@88-distribute-fields-5.c:25:3-25:40#top]] (conf. 110) (exp: & t.s) (88-distribute-fields-5.c:19:3-19:11) - write with [mhp:{tid=[main]; created={[main, t_fun@88-distribute-fields-5.c:25:3-25:40#top]}}, thread:[main]] (conf. 110) (exp: & t.s) (88-distribute-fields-5.c:27:3-27:11) - [Info][Race] Memory locations race summary: - safe: 0 - vulnerable: 0 - unsafe: 1 - total memory locations: 1 - [Info][Deadcode] Logical lines of code (LLoC) summary: - live: 8 - dead: 0 - total lines: 8 + $ goblint --enable warn.deterministic --enable allglobs --enable dbg.full-output 88-distribute-fields-5.c > full-output.txt 2>&1 + + $ diff default-output.txt full-output.txt + 2,3c2,3 + < write with thread:[main, t_fun@88-distribute-fields-5.c:25:3-25:40] (conf. 110) (exp: & t.s) (88-distribute-fields-5.c:19:3-19:11) + < write with [mhp:{created={[main, t_fun@88-distribute-fields-5.c:25:3-25:40]}}, thread:[main]] (conf. 110) (exp: & t.s) (88-distribute-fields-5.c:27:3-27:11) + --- + > write with [mhp:{tid=[main, t_fun@88-distribute-fields-5.c:25:3-25:40#top]}, thread:[main, t_fun@88-distribute-fields-5.c:25:3-25:40#top]] (conf. 110) (exp: & t.s) (88-distribute-fields-5.c:19:3-19:11) + > write with [mhp:{tid=[main]; created={[main, t_fun@88-distribute-fields-5.c:25:3-25:40#top]}}, thread:[main]] (conf. 110) (exp: & t.s) (88-distribute-fields-5.c:27:3-27:11) + [1] diff --git a/tests/regression/04-mutex/89-distribute-fields-6.t b/tests/regression/04-mutex/89-distribute-fields-6.t index f0a17466cd..95af01540e 100644 --- a/tests/regression/04-mutex/89-distribute-fields-6.t +++ b/tests/regression/04-mutex/89-distribute-fields-6.t @@ -1,4 +1,4 @@ - $ goblint --enable warn.deterministic --enable allglobs 89-distribute-fields-6.c + $ goblint --enable warn.deterministic --enable allglobs 89-distribute-fields-6.c 2>&1 | tee default-output.txt [Warning][Race] Memory location t (race with conf. 110): (89-distribute-fields-6.c:15:10-15:11) write with thread:[main, t_fun@89-distribute-fields-6.c:25:3-25:40] (conf. 110) (exp: & t) (89-distribute-fields-6.c:19:3-19:9) write with [mhp:{created={[main, t_fun@89-distribute-fields-6.c:25:3-25:40]}}, thread:[main]] (conf. 110) (exp: & t) (89-distribute-fields-6.c:27:3-27:9) @@ -12,16 +12,13 @@ dead: 0 total lines: 8 - $ goblint --enable warn.deterministic --enable allglobs --enable dbg.full-output 89-distribute-fields-6.c - [Warning][Race] Memory location t (race with conf. 110): (89-distribute-fields-6.c:15:10-15:11) - write with [mhp:{tid=[main, t_fun@89-distribute-fields-6.c:25:3-25:40#top]}, thread:[main, t_fun@89-distribute-fields-6.c:25:3-25:40#top]] (conf. 110) (exp: & t) (89-distribute-fields-6.c:19:3-19:9) - write with [mhp:{tid=[main]; created={[main, t_fun@89-distribute-fields-6.c:25:3-25:40#top]}}, thread:[main]] (conf. 110) (exp: & t) (89-distribute-fields-6.c:27:3-27:9) - [Info][Race] Memory locations race summary: - safe: 0 - vulnerable: 0 - unsafe: 1 - total memory locations: 1 - [Info][Deadcode] Logical lines of code (LLoC) summary: - live: 8 - dead: 0 - total lines: 8 + $ goblint --enable warn.deterministic --enable allglobs --enable dbg.full-output 89-distribute-fields-6.c > full-output.txt 2>&1 + + $ diff default-output.txt full-output.txt + 2,3c2,3 + < write with thread:[main, t_fun@89-distribute-fields-6.c:25:3-25:40] (conf. 110) (exp: & t) (89-distribute-fields-6.c:19:3-19:9) + < write with [mhp:{created={[main, t_fun@89-distribute-fields-6.c:25:3-25:40]}}, thread:[main]] (conf. 110) (exp: & t) (89-distribute-fields-6.c:27:3-27:9) + --- + > write with [mhp:{tid=[main, t_fun@89-distribute-fields-6.c:25:3-25:40#top]}, thread:[main, t_fun@89-distribute-fields-6.c:25:3-25:40#top]] (conf. 110) (exp: & t) (89-distribute-fields-6.c:19:3-19:9) + > write with [mhp:{tid=[main]; created={[main, t_fun@89-distribute-fields-6.c:25:3-25:40#top]}}, thread:[main]] (conf. 110) (exp: & t) (89-distribute-fields-6.c:27:3-27:9) + [1] diff --git a/tests/regression/04-mutex/90-distribute-fields-type-1.t b/tests/regression/04-mutex/90-distribute-fields-type-1.t index ee13a1166c..bbe3962366 100644 --- a/tests/regression/04-mutex/90-distribute-fields-type-1.t +++ b/tests/regression/04-mutex/90-distribute-fields-type-1.t @@ -1,4 +1,4 @@ - $ goblint --enable warn.deterministic --enable allglobs 90-distribute-fields-type-1.c + $ goblint --enable warn.deterministic --enable allglobs 90-distribute-fields-type-1.c 2>&1 | tee default-output.txt [Warning][Behavior > Undefined > NullPointerDereference][CWE-476] May dereference NULL pointer (90-distribute-fields-type-1.c:31:3-31:20) [Warning][Behavior > Undefined > NullPointerDereference][CWE-476] May dereference NULL pointer (90-distribute-fields-type-1.c:39:3-39:17) [Warning][Race] Memory location (struct T).s.field (race with conf. 100): @@ -27,31 +27,21 @@ [Error][Imprecise][Unsound] Function definition missing for getT (90-distribute-fields-type-1.c:39:3-39:17) [Error][Imprecise][Unsound] Function definition missing - $ goblint --enable warn.deterministic --enable allglobs --enable dbg.full-output 90-distribute-fields-type-1.c - [Warning][Behavior > Undefined > NullPointerDereference][CWE-476] May dereference NULL pointer (90-distribute-fields-type-1.c:31:3-31:20) - [Warning][Behavior > Undefined > NullPointerDereference][CWE-476] May dereference NULL pointer (90-distribute-fields-type-1.c:39:3-39:17) - [Warning][Race] Memory location (struct T).s.field (race with conf. 100): - write with [mhp:{tid=[main, t_fun@90-distribute-fields-type-1.c:37:3-37:40#top]}, thread:[main, t_fun@90-distribute-fields-type-1.c:37:3-37:40#top]] (conf. 100) (exp: & tmp->field) (90-distribute-fields-type-1.c:31:3-31:20) - write with [mhp:{tid=[main]; created={[main, t_fun@90-distribute-fields-type-1.c:37:3-37:40#top]}}, thread:[main]] (conf. 100) (exp: & tmp->s) (90-distribute-fields-type-1.c:39:3-39:17) - [Info][Race] Memory locations race summary: - safe: 2 - vulnerable: 0 - unsafe: 1 - total memory locations: 3 - [Success][Race] Memory location (struct S).field (safe): - write with [mhp:{tid=[main, t_fun@90-distribute-fields-type-1.c:37:3-37:40#top]}, thread:[main, t_fun@90-distribute-fields-type-1.c:37:3-37:40#top]] (conf. 100) (exp: & tmp->field) (90-distribute-fields-type-1.c:31:3-31:20) - [Success][Race] Memory location (struct T).s (safe): - write with [mhp:{tid=[main]; created={[main, t_fun@90-distribute-fields-type-1.c:37:3-37:40#top]}}, thread:[main]] (conf. 100) (exp: & tmp->s) (90-distribute-fields-type-1.c:39:3-39:17) - [Info][Deadcode] Logical lines of code (LLoC) summary: - live: 7 - dead: 0 - total lines: 7 - [Info][Unsound] Write to unknown address: privatization is unsound. (90-distribute-fields-type-1.c:31:3-31:20) - [Info][Unsound] Write to unknown address: privatization is unsound. (90-distribute-fields-type-1.c:39:3-39:17) - [Info][Imprecise] INVALIDATING ALL GLOBALS! (90-distribute-fields-type-1.c:31:3-31:20) - [Info][Imprecise] Invalidating expressions: & tmp (90-distribute-fields-type-1.c:31:3-31:20) - [Info][Imprecise] INVALIDATING ALL GLOBALS! (90-distribute-fields-type-1.c:39:3-39:17) - [Info][Imprecise] Invalidating expressions: & tmp (90-distribute-fields-type-1.c:39:3-39:17) - [Error][Imprecise][Unsound] Function definition missing for getS (90-distribute-fields-type-1.c:31:3-31:20) - [Error][Imprecise][Unsound] Function definition missing for getT (90-distribute-fields-type-1.c:39:3-39:17) - [Error][Imprecise][Unsound] Function definition missing + $ goblint --enable warn.deterministic --enable allglobs --enable dbg.full-output 90-distribute-fields-type-1.c > full-output.txt 2>&1 + + $ diff default-output.txt full-output.txt + 4,5c4,5 + < write with thread:[main, t_fun@90-distribute-fields-type-1.c:37:3-37:40] (conf. 100) (exp: & tmp->field) (90-distribute-fields-type-1.c:31:3-31:20) + < write with [mhp:{created={[main, t_fun@90-distribute-fields-type-1.c:37:3-37:40]}}, thread:[main]] (conf. 100) (exp: & tmp->s) (90-distribute-fields-type-1.c:39:3-39:17) + --- + > write with [mhp:{tid=[main, t_fun@90-distribute-fields-type-1.c:37:3-37:40#top]}, thread:[main, t_fun@90-distribute-fields-type-1.c:37:3-37:40#top]] (conf. 100) (exp: & tmp->field) (90-distribute-fields-type-1.c:31:3-31:20) + > write with [mhp:{tid=[main]; created={[main, t_fun@90-distribute-fields-type-1.c:37:3-37:40#top]}}, thread:[main]] (conf. 100) (exp: & tmp->s) (90-distribute-fields-type-1.c:39:3-39:17) + 12c12 + < write with thread:[main, t_fun@90-distribute-fields-type-1.c:37:3-37:40] (conf. 100) (exp: & tmp->field) (90-distribute-fields-type-1.c:31:3-31:20) + --- + > write with [mhp:{tid=[main, t_fun@90-distribute-fields-type-1.c:37:3-37:40#top]}, thread:[main, t_fun@90-distribute-fields-type-1.c:37:3-37:40#top]] (conf. 100) (exp: & tmp->field) (90-distribute-fields-type-1.c:31:3-31:20) + 14c14 + < write with [mhp:{created={[main, t_fun@90-distribute-fields-type-1.c:37:3-37:40]}}, thread:[main]] (conf. 100) (exp: & tmp->s) (90-distribute-fields-type-1.c:39:3-39:17) + --- + > write with [mhp:{tid=[main]; created={[main, t_fun@90-distribute-fields-type-1.c:37:3-37:40#top]}}, thread:[main]] (conf. 100) (exp: & tmp->s) (90-distribute-fields-type-1.c:39:3-39:17) + [1] diff --git a/tests/regression/04-mutex/91-distribute-fields-type-2.t b/tests/regression/04-mutex/91-distribute-fields-type-2.t index fee687e61d..80e6d9972e 100644 --- a/tests/regression/04-mutex/91-distribute-fields-type-2.t +++ b/tests/regression/04-mutex/91-distribute-fields-type-2.t @@ -1,4 +1,4 @@ - $ goblint --enable warn.deterministic --enable allglobs 91-distribute-fields-type-2.c + $ goblint --enable warn.deterministic --enable allglobs 91-distribute-fields-type-2.c 2>&1 | tee default-output.txt [Warning][Behavior > Undefined > NullPointerDereference][CWE-476] May dereference NULL pointer (91-distribute-fields-type-2.c:32:3-32:17) [Warning][Behavior > Undefined > NullPointerDereference][CWE-476] May dereference NULL pointer (91-distribute-fields-type-2.c:40:3-40:17) [Warning][Race] Memory location (struct T).s (race with conf. 100): @@ -27,31 +27,21 @@ [Error][Imprecise][Unsound] Function definition missing for getT (91-distribute-fields-type-2.c:40:3-40:17) [Error][Imprecise][Unsound] Function definition missing - $ goblint --enable warn.deterministic --enable allglobs --enable dbg.full-output 91-distribute-fields-type-2.c - [Warning][Behavior > Undefined > NullPointerDereference][CWE-476] May dereference NULL pointer (91-distribute-fields-type-2.c:32:3-32:17) - [Warning][Behavior > Undefined > NullPointerDereference][CWE-476] May dereference NULL pointer (91-distribute-fields-type-2.c:40:3-40:17) - [Warning][Race] Memory location (struct T).s (race with conf. 100): - write with [mhp:{tid=[main, t_fun@91-distribute-fields-type-2.c:38:3-38:40#top]}, thread:[main, t_fun@91-distribute-fields-type-2.c:38:3-38:40#top]] (conf. 100) (exp: & *tmp) (91-distribute-fields-type-2.c:32:3-32:17) - write with [mhp:{tid=[main]; created={[main, t_fun@91-distribute-fields-type-2.c:38:3-38:40#top]}}, thread:[main]] (conf. 100) (exp: & *tmp) (91-distribute-fields-type-2.c:40:3-40:17) - [Info][Race] Memory locations race summary: - safe: 2 - vulnerable: 0 - unsafe: 1 - total memory locations: 3 - [Success][Race] Memory location (struct S) (safe): - write with [mhp:{tid=[main, t_fun@91-distribute-fields-type-2.c:38:3-38:40#top]}, thread:[main, t_fun@91-distribute-fields-type-2.c:38:3-38:40#top]] (conf. 100) (exp: & *tmp) (91-distribute-fields-type-2.c:32:3-32:17) - [Success][Race] Memory location (struct T) (safe): - write with [mhp:{tid=[main]; created={[main, t_fun@91-distribute-fields-type-2.c:38:3-38:40#top]}}, thread:[main]] (conf. 100) (exp: & *tmp) (91-distribute-fields-type-2.c:40:3-40:17) - [Info][Deadcode] Logical lines of code (LLoC) summary: - live: 7 - dead: 0 - total lines: 7 - [Info][Unsound] Write to unknown address: privatization is unsound. (91-distribute-fields-type-2.c:32:3-32:17) - [Info][Unsound] Write to unknown address: privatization is unsound. (91-distribute-fields-type-2.c:40:3-40:17) - [Info][Imprecise] INVALIDATING ALL GLOBALS! (91-distribute-fields-type-2.c:32:3-32:17) - [Info][Imprecise] Invalidating expressions: & tmp (91-distribute-fields-type-2.c:32:3-32:17) - [Info][Imprecise] INVALIDATING ALL GLOBALS! (91-distribute-fields-type-2.c:40:3-40:17) - [Info][Imprecise] Invalidating expressions: & tmp (91-distribute-fields-type-2.c:40:3-40:17) - [Error][Imprecise][Unsound] Function definition missing for getS (91-distribute-fields-type-2.c:32:3-32:17) - [Error][Imprecise][Unsound] Function definition missing for getT (91-distribute-fields-type-2.c:40:3-40:17) - [Error][Imprecise][Unsound] Function definition missing + $ goblint --enable warn.deterministic --enable allglobs --enable dbg.full-output 91-distribute-fields-type-2.c > full-output.txt 2>&1 + + $ diff default-output.txt full-output.txt + 4,5c4,5 + < write with thread:[main, t_fun@91-distribute-fields-type-2.c:38:3-38:40] (conf. 100) (exp: & *tmp) (91-distribute-fields-type-2.c:32:3-32:17) + < write with [mhp:{created={[main, t_fun@91-distribute-fields-type-2.c:38:3-38:40]}}, thread:[main]] (conf. 100) (exp: & *tmp) (91-distribute-fields-type-2.c:40:3-40:17) + --- + > write with [mhp:{tid=[main, t_fun@91-distribute-fields-type-2.c:38:3-38:40#top]}, thread:[main, t_fun@91-distribute-fields-type-2.c:38:3-38:40#top]] (conf. 100) (exp: & *tmp) (91-distribute-fields-type-2.c:32:3-32:17) + > write with [mhp:{tid=[main]; created={[main, t_fun@91-distribute-fields-type-2.c:38:3-38:40#top]}}, thread:[main]] (conf. 100) (exp: & *tmp) (91-distribute-fields-type-2.c:40:3-40:17) + 12c12 + < write with thread:[main, t_fun@91-distribute-fields-type-2.c:38:3-38:40] (conf. 100) (exp: & *tmp) (91-distribute-fields-type-2.c:32:3-32:17) + --- + > write with [mhp:{tid=[main, t_fun@91-distribute-fields-type-2.c:38:3-38:40#top]}, thread:[main, t_fun@91-distribute-fields-type-2.c:38:3-38:40#top]] (conf. 100) (exp: & *tmp) (91-distribute-fields-type-2.c:32:3-32:17) + 14c14 + < write with [mhp:{created={[main, t_fun@91-distribute-fields-type-2.c:38:3-38:40]}}, thread:[main]] (conf. 100) (exp: & *tmp) (91-distribute-fields-type-2.c:40:3-40:17) + --- + > write with [mhp:{tid=[main]; created={[main, t_fun@91-distribute-fields-type-2.c:38:3-38:40#top]}}, thread:[main]] (conf. 100) (exp: & *tmp) (91-distribute-fields-type-2.c:40:3-40:17) + [1] diff --git a/tests/regression/04-mutex/92-distribute-fields-type-deep.t b/tests/regression/04-mutex/92-distribute-fields-type-deep.t index eb752ee357..f06f5d5480 100644 --- a/tests/regression/04-mutex/92-distribute-fields-type-deep.t +++ b/tests/regression/04-mutex/92-distribute-fields-type-deep.t @@ -1,4 +1,4 @@ - $ goblint --enable warn.deterministic --enable allglobs 92-distribute-fields-type-deep.c + $ goblint --enable warn.deterministic --enable allglobs 92-distribute-fields-type-deep.c 2>&1 | tee default-output.txt [Warning][Behavior > Undefined > NullPointerDereference][CWE-476] May dereference NULL pointer (92-distribute-fields-type-deep.c:36:3-36:20) [Warning][Behavior > Undefined > NullPointerDereference][CWE-476] May dereference NULL pointer (92-distribute-fields-type-deep.c:44:3-44:17) [Warning][Race] Memory location (struct U).t.s.field (race with conf. 100): @@ -27,31 +27,21 @@ [Error][Imprecise][Unsound] Function definition missing for getU (92-distribute-fields-type-deep.c:44:3-44:17) [Error][Imprecise][Unsound] Function definition missing - $ goblint --enable warn.deterministic --enable allglobs --enable dbg.full-output 92-distribute-fields-type-deep.c - [Warning][Behavior > Undefined > NullPointerDereference][CWE-476] May dereference NULL pointer (92-distribute-fields-type-deep.c:36:3-36:20) - [Warning][Behavior > Undefined > NullPointerDereference][CWE-476] May dereference NULL pointer (92-distribute-fields-type-deep.c:44:3-44:17) - [Warning][Race] Memory location (struct U).t.s.field (race with conf. 100): - write with [mhp:{tid=[main, t_fun@92-distribute-fields-type-deep.c:42:3-42:40#top]}, thread:[main, t_fun@92-distribute-fields-type-deep.c:42:3-42:40#top]] (conf. 100) (exp: & tmp->field) (92-distribute-fields-type-deep.c:36:3-36:20) - write with [mhp:{tid=[main]; created={[main, t_fun@92-distribute-fields-type-deep.c:42:3-42:40#top]}}, thread:[main]] (conf. 100) (exp: & tmp->t) (92-distribute-fields-type-deep.c:44:3-44:17) - [Info][Race] Memory locations race summary: - safe: 2 - vulnerable: 0 - unsafe: 1 - total memory locations: 3 - [Success][Race] Memory location (struct S).field (safe): - write with [mhp:{tid=[main, t_fun@92-distribute-fields-type-deep.c:42:3-42:40#top]}, thread:[main, t_fun@92-distribute-fields-type-deep.c:42:3-42:40#top]] (conf. 100) (exp: & tmp->field) (92-distribute-fields-type-deep.c:36:3-36:20) - [Success][Race] Memory location (struct U).t (safe): - write with [mhp:{tid=[main]; created={[main, t_fun@92-distribute-fields-type-deep.c:42:3-42:40#top]}}, thread:[main]] (conf. 100) (exp: & tmp->t) (92-distribute-fields-type-deep.c:44:3-44:17) - [Info][Deadcode] Logical lines of code (LLoC) summary: - live: 7 - dead: 0 - total lines: 7 - [Info][Unsound] Write to unknown address: privatization is unsound. (92-distribute-fields-type-deep.c:36:3-36:20) - [Info][Unsound] Write to unknown address: privatization is unsound. (92-distribute-fields-type-deep.c:44:3-44:17) - [Info][Imprecise] INVALIDATING ALL GLOBALS! (92-distribute-fields-type-deep.c:36:3-36:20) - [Info][Imprecise] Invalidating expressions: & tmp (92-distribute-fields-type-deep.c:36:3-36:20) - [Info][Imprecise] INVALIDATING ALL GLOBALS! (92-distribute-fields-type-deep.c:44:3-44:17) - [Info][Imprecise] Invalidating expressions: & tmp (92-distribute-fields-type-deep.c:44:3-44:17) - [Error][Imprecise][Unsound] Function definition missing for getS (92-distribute-fields-type-deep.c:36:3-36:20) - [Error][Imprecise][Unsound] Function definition missing for getU (92-distribute-fields-type-deep.c:44:3-44:17) - [Error][Imprecise][Unsound] Function definition missing + $ goblint --enable warn.deterministic --enable allglobs --enable dbg.full-output 92-distribute-fields-type-deep.c > full-output.txt 2>&1 + + $ diff default-output.txt full-output.txt + 4,5c4,5 + < write with thread:[main, t_fun@92-distribute-fields-type-deep.c:42:3-42:40] (conf. 100) (exp: & tmp->field) (92-distribute-fields-type-deep.c:36:3-36:20) + < write with [mhp:{created={[main, t_fun@92-distribute-fields-type-deep.c:42:3-42:40]}}, thread:[main]] (conf. 100) (exp: & tmp->t) (92-distribute-fields-type-deep.c:44:3-44:17) + --- + > write with [mhp:{tid=[main, t_fun@92-distribute-fields-type-deep.c:42:3-42:40#top]}, thread:[main, t_fun@92-distribute-fields-type-deep.c:42:3-42:40#top]] (conf. 100) (exp: & tmp->field) (92-distribute-fields-type-deep.c:36:3-36:20) + > write with [mhp:{tid=[main]; created={[main, t_fun@92-distribute-fields-type-deep.c:42:3-42:40#top]}}, thread:[main]] (conf. 100) (exp: & tmp->t) (92-distribute-fields-type-deep.c:44:3-44:17) + 12c12 + < write with thread:[main, t_fun@92-distribute-fields-type-deep.c:42:3-42:40] (conf. 100) (exp: & tmp->field) (92-distribute-fields-type-deep.c:36:3-36:20) + --- + > write with [mhp:{tid=[main, t_fun@92-distribute-fields-type-deep.c:42:3-42:40#top]}, thread:[main, t_fun@92-distribute-fields-type-deep.c:42:3-42:40#top]] (conf. 100) (exp: & tmp->field) (92-distribute-fields-type-deep.c:36:3-36:20) + 14c14 + < write with [mhp:{created={[main, t_fun@92-distribute-fields-type-deep.c:42:3-42:40]}}, thread:[main]] (conf. 100) (exp: & tmp->t) (92-distribute-fields-type-deep.c:44:3-44:17) + --- + > write with [mhp:{tid=[main]; created={[main, t_fun@92-distribute-fields-type-deep.c:42:3-42:40#top]}}, thread:[main]] (conf. 100) (exp: & tmp->t) (92-distribute-fields-type-deep.c:44:3-44:17) + [1] diff --git a/tests/regression/04-mutex/93-distribute-fields-type-global.t b/tests/regression/04-mutex/93-distribute-fields-type-global.t index 2e8b4a78f2..d7b302f03a 100644 --- a/tests/regression/04-mutex/93-distribute-fields-type-global.t +++ b/tests/regression/04-mutex/93-distribute-fields-type-global.t @@ -1,4 +1,4 @@ - $ goblint --enable warn.deterministic --enable allglobs 93-distribute-fields-type-global.c + $ goblint --enable warn.deterministic --enable allglobs 93-distribute-fields-type-global.c 2>&1 | tee default-output.txt [Warning][Behavior > Undefined > NullPointerDereference][CWE-476] May dereference NULL pointer (93-distribute-fields-type-global.c:13:3-13:29) [Warning][Race] Memory location s.field (race with conf. 110): (93-distribute-fields-type-global.c:8:10-8:11) read with thread:[main, t_fun@93-distribute-fields-type-global.c:20:3-20:40] (conf. 100) (exp: & tmp->field) (93-distribute-fields-type-global.c:13:3-13:29) @@ -23,27 +23,21 @@ [Error][Imprecise][Unsound] Function definition missing for getS (93-distribute-fields-type-global.c:13:3-13:29) [Error][Imprecise][Unsound] Function definition missing - $ goblint --enable warn.deterministic --enable allglobs --enable dbg.full-output 93-distribute-fields-type-global.c - [Warning][Behavior > Undefined > NullPointerDereference][CWE-476] May dereference NULL pointer (93-distribute-fields-type-global.c:13:3-13:29) - [Warning][Race] Memory location s.field (race with conf. 110): (93-distribute-fields-type-global.c:8:10-8:11) - read with [mhp:{tid=[main, t_fun@93-distribute-fields-type-global.c:20:3-20:40#top]}, thread:[main, t_fun@93-distribute-fields-type-global.c:20:3-20:40#top]] (conf. 100) (exp: & tmp->field) (93-distribute-fields-type-global.c:13:3-13:29) - write with [mhp:{tid=[main]; created={[main, t_fun@93-distribute-fields-type-global.c:20:3-20:40#top]}}, thread:[main]] (conf. 110) (exp: & s) (93-distribute-fields-type-global.c:22:3-22:9) - [Info][Race] Memory locations race summary: - safe: 2 - vulnerable: 0 - unsafe: 1 - total memory locations: 3 - [Success][Race] Memory location (struct S).field (safe): - read with [mhp:{tid=[main, t_fun@93-distribute-fields-type-global.c:20:3-20:40#top]}, thread:[main, t_fun@93-distribute-fields-type-global.c:20:3-20:40#top]] (conf. 100) (exp: & tmp->field) (93-distribute-fields-type-global.c:13:3-13:29) - [Success][Race] Memory location s (safe): (93-distribute-fields-type-global.c:8:10-8:11) - write with [mhp:{tid=[main]; created={[main, t_fun@93-distribute-fields-type-global.c:20:3-20:40#top]}}, thread:[main]] (conf. 110) (exp: & s) (93-distribute-fields-type-global.c:22:3-22:9) - [Info][Deadcode] Logical lines of code (LLoC) summary: - live: 7 - dead: 0 - total lines: 7 - [Info][Unsound] Write to unknown address: privatization is unsound. (93-distribute-fields-type-global.c:13:3-13:29) - [Info][Imprecise] INVALIDATING ALL GLOBALS! (93-distribute-fields-type-global.c:13:3-13:29) - [Info][Imprecise] Invalidating expressions: & s (93-distribute-fields-type-global.c:13:3-13:29) - [Info][Imprecise] Invalidating expressions: & tmp (93-distribute-fields-type-global.c:13:3-13:29) - [Error][Imprecise][Unsound] Function definition missing for getS (93-distribute-fields-type-global.c:13:3-13:29) - [Error][Imprecise][Unsound] Function definition missing + $ goblint --enable warn.deterministic --enable allglobs --enable dbg.full-output 93-distribute-fields-type-global.c > full-output.txt 2>&1 + + $ diff default-output.txt full-output.txt + 3,4c3,4 + < read with thread:[main, t_fun@93-distribute-fields-type-global.c:20:3-20:40] (conf. 100) (exp: & tmp->field) (93-distribute-fields-type-global.c:13:3-13:29) + < write with [mhp:{created={[main, t_fun@93-distribute-fields-type-global.c:20:3-20:40]}}, thread:[main]] (conf. 110) (exp: & s) (93-distribute-fields-type-global.c:22:3-22:9) + --- + > read with [mhp:{tid=[main, t_fun@93-distribute-fields-type-global.c:20:3-20:40#top]}, thread:[main, t_fun@93-distribute-fields-type-global.c:20:3-20:40#top]] (conf. 100) (exp: & tmp->field) (93-distribute-fields-type-global.c:13:3-13:29) + > write with [mhp:{tid=[main]; created={[main, t_fun@93-distribute-fields-type-global.c:20:3-20:40#top]}}, thread:[main]] (conf. 110) (exp: & s) (93-distribute-fields-type-global.c:22:3-22:9) + 11c11 + < read with thread:[main, t_fun@93-distribute-fields-type-global.c:20:3-20:40] (conf. 100) (exp: & tmp->field) (93-distribute-fields-type-global.c:13:3-13:29) + --- + > read with [mhp:{tid=[main, t_fun@93-distribute-fields-type-global.c:20:3-20:40#top]}, thread:[main, t_fun@93-distribute-fields-type-global.c:20:3-20:40#top]] (conf. 100) (exp: & tmp->field) (93-distribute-fields-type-global.c:13:3-13:29) + 13c13 + < write with [mhp:{created={[main, t_fun@93-distribute-fields-type-global.c:20:3-20:40]}}, thread:[main]] (conf. 110) (exp: & s) (93-distribute-fields-type-global.c:22:3-22:9) + --- + > write with [mhp:{tid=[main]; created={[main, t_fun@93-distribute-fields-type-global.c:20:3-20:40#top]}}, thread:[main]] (conf. 110) (exp: & s) (93-distribute-fields-type-global.c:22:3-22:9) + [1] diff --git a/tests/regression/06-symbeq/14-list_entry_rc.t b/tests/regression/06-symbeq/14-list_entry_rc.t index 354c0e85e8..2f7704fd22 100644 --- a/tests/regression/06-symbeq/14-list_entry_rc.t +++ b/tests/regression/06-symbeq/14-list_entry_rc.t @@ -1,4 +1,4 @@ - $ goblint --enable ana.race.direct-arithmetic --set ana.activated[+] "'var_eq'" --set ana.activated[+] "'symb_locks'" 14-list_entry_rc.c | sed -r 's/sid:[0-9]+/sid:$SID/' + $ goblint --enable ana.race.direct-arithmetic --set ana.activated[+] "'var_eq'" --set ana.activated[+] "'symb_locks'" 14-list_entry_rc.c 2>&1 | sed -r 's/sid:[0-9]+/sid:$SID/' | tee default-output.txt [Info][Imprecise] Invalidating expressions: & mutexattr (14-list_entry_rc.c:37:3-37:37) [Warning][Unknown] unlocking mutex ((alloc@sid:$SID@tid:[main])[1].mutex) which may not be held (14-list_entry_rc.c:28:3-28:34) [Info][Deadcode] Logical lines of code (LLoC) summary: @@ -16,20 +16,23 @@ unsafe: 1 total memory locations: 2 - $ goblint --enable ana.race.direct-arithmetic --set ana.activated[+] "'var_eq'" --set ana.activated[+] "'symb_locks'" --enable dbg.full-output 14-list_entry_rc.c | sed -r 's/sid:[0-9]+/sid:$SID/' - [Info][Imprecise] Invalidating expressions: & mutexattr (14-list_entry_rc.c:37:3-37:37) - [Warning][Unknown] unlocking mutex ((alloc@sid:$SID@tid:[main](#top))[def_exc:1].mutex) which may not be held (14-list_entry_rc.c:28:3-28:34) - [Info][Deadcode] Logical lines of code (LLoC) summary: - live: 23 - dead: 0 - total lines: 23 - [Warning][Race] Memory location (alloc@sid:$SID@tid:[main](#top))[?].datum (race with conf. 110): (14-list_entry_rc.c:41:3-41:35) - write with [mhp:{tid=[main, t_fun@14-list_entry_rc.c:45:3-45:40#top]}, thread:[main, t_fun@14-list_entry_rc.c:45:3-45:40#top]] (conf. 110) (exp: & s->datum) (14-list_entry_rc.c:27:3-27:13) - write with [mhp:{tid=[main]; created={[main, t_fun@14-list_entry_rc.c:45:3-45:40#top]}}, thread:[main]] (conf. 110) (exp: & s->datum) (14-list_entry_rc.c:27:3-27:13) - read with [mhp:{tid=[main, t_fun@14-list_entry_rc.c:45:3-45:40#top]}, thread:[main, t_fun@14-list_entry_rc.c:45:3-45:40#top]] (conf. 110) (exp: & s->datum) (14-list_entry_rc.c:27:3-27:13) - read with [mhp:{tid=[main]; created={[main, t_fun@14-list_entry_rc.c:45:3-45:40#top]}}, thread:[main]] (conf. 110) (exp: & s->datum) (14-list_entry_rc.c:27:3-27:13) - [Info][Race] Memory locations race summary: - safe: 1 - vulnerable: 0 - unsafe: 1 - total memory locations: 2 + $ goblint --enable ana.race.direct-arithmetic --set ana.activated[+] "'var_eq'" --set ana.activated[+] "'symb_locks'" --enable dbg.full-output 14-list_entry_rc.c 2>&1 | sed -r 's/sid:[0-9]+/sid:$SID/' > full-output.txt + + $ diff default-output.txt full-output.txt + 2c2 + < [Warning][Unknown] unlocking mutex ((alloc@sid:$SID@tid:[main])[1].mutex) which may not be held (14-list_entry_rc.c:28:3-28:34) + --- + > [Warning][Unknown] unlocking mutex ((alloc@sid:$SID@tid:[main](#top))[def_exc:1].mutex) which may not be held (14-list_entry_rc.c:28:3-28:34) + 7,11c7,11 + < [Warning][Race] Memory location (alloc@sid:$SID@tid:[main])[?].datum (race with conf. 110): (14-list_entry_rc.c:41:3-41:35) + < write with thread:[main, t_fun@14-list_entry_rc.c:45:3-45:40] (conf. 110) (exp: & s->datum) (14-list_entry_rc.c:27:3-27:13) + < write with [mhp:{created={[main, t_fun@14-list_entry_rc.c:45:3-45:40]}}, thread:[main]] (conf. 110) (exp: & s->datum) (14-list_entry_rc.c:27:3-27:13) + < read with thread:[main, t_fun@14-list_entry_rc.c:45:3-45:40] (conf. 110) (exp: & s->datum) (14-list_entry_rc.c:27:3-27:13) + < read with [mhp:{created={[main, t_fun@14-list_entry_rc.c:45:3-45:40]}}, thread:[main]] (conf. 110) (exp: & s->datum) (14-list_entry_rc.c:27:3-27:13) + --- + > [Warning][Race] Memory location (alloc@sid:$SID@tid:[main](#top))[?].datum (race with conf. 110): (14-list_entry_rc.c:41:3-41:35) + > write with [mhp:{tid=[main, t_fun@14-list_entry_rc.c:45:3-45:40#top]}, thread:[main, t_fun@14-list_entry_rc.c:45:3-45:40#top]] (conf. 110) (exp: & s->datum) (14-list_entry_rc.c:27:3-27:13) + > write with [mhp:{tid=[main]; created={[main, t_fun@14-list_entry_rc.c:45:3-45:40#top]}}, thread:[main]] (conf. 110) (exp: & s->datum) (14-list_entry_rc.c:27:3-27:13) + > read with [mhp:{tid=[main, t_fun@14-list_entry_rc.c:45:3-45:40#top]}, thread:[main, t_fun@14-list_entry_rc.c:45:3-45:40#top]] (conf. 110) (exp: & s->datum) (14-list_entry_rc.c:27:3-27:13) + > read with [mhp:{tid=[main]; created={[main, t_fun@14-list_entry_rc.c:45:3-45:40#top]}}, thread:[main]] (conf. 110) (exp: & s->datum) (14-list_entry_rc.c:27:3-27:13) + [1] diff --git a/tests/regression/06-symbeq/16-type_rc.t b/tests/regression/06-symbeq/16-type_rc.t index c4c4eaade8..d28d45ccca 100644 --- a/tests/regression/06-symbeq/16-type_rc.t +++ b/tests/regression/06-symbeq/16-type_rc.t @@ -1,6 +1,6 @@ Disable info messages because race summary contains (safe) memory location count, which is different on Linux and OSX. - $ goblint --enable warn.deterministic --disable warn.info --enable ana.race.direct-arithmetic --set ana.activated[+] "'var_eq'" --set ana.activated[+] "'symb_locks'" 16-type_rc.c + $ goblint --enable warn.deterministic --disable warn.info --enable ana.race.direct-arithmetic --set ana.activated[+] "'var_eq'" --set ana.activated[+] "'symb_locks'" 16-type_rc.c 2>&1 | tee default-output-1.txt [Warning][Behavior > Undefined > NullPointerDereference][CWE-476] May dereference NULL pointer (16-type_rc.c:21:3-21:15) [Warning][Behavior > Undefined > NullPointerDereference][CWE-476] May dereference NULL pointer (16-type_rc.c:32:3-32:16) [Warning][Behavior > Undefined > NullPointerDereference][CWE-476] May dereference NULL pointer (16-type_rc.c:33:3-33:16) @@ -12,7 +12,7 @@ Disable info messages because race summary contains (safe) memory location count [Error][Imprecise][Unsound] Function definition missing for get_s (16-type_rc.c:31:3-31:14) [Error][Imprecise][Unsound] Function definition missing - $ goblint --enable warn.deterministic --disable warn.info --disable ana.race.direct-arithmetic --set ana.activated[+] "'var_eq'" --set ana.activated[+] "'symb_locks'" --enable allglobs 16-type_rc.c + $ goblint --enable warn.deterministic --disable warn.info --disable ana.race.direct-arithmetic --set ana.activated[+] "'var_eq'" --set ana.activated[+] "'symb_locks'" --enable allglobs 16-type_rc.c 2>&1 | tee default-output-2.txt [Warning][Behavior > Undefined > NullPointerDereference][CWE-476] May dereference NULL pointer (16-type_rc.c:21:3-21:15) [Warning][Behavior > Undefined > NullPointerDereference][CWE-476] May dereference NULL pointer (16-type_rc.c:32:3-32:16) [Warning][Behavior > Undefined > NullPointerDereference][CWE-476] May dereference NULL pointer (16-type_rc.c:33:3-33:16) @@ -23,25 +23,22 @@ Disable info messages because race summary contains (safe) memory location count [Error][Imprecise][Unsound] Function definition missing for get_s (16-type_rc.c:31:3-31:14) [Error][Imprecise][Unsound] Function definition missing - $ goblint --enable warn.deterministic --disable warn.info --enable ana.race.direct-arithmetic --set ana.activated[+] "'var_eq'" --set ana.activated[+] "'symb_locks'" --enable dbg.full-output 16-type_rc.c - [Warning][Behavior > Undefined > NullPointerDereference][CWE-476] May dereference NULL pointer (16-type_rc.c:21:3-21:15) - [Warning][Behavior > Undefined > NullPointerDereference][CWE-476] May dereference NULL pointer (16-type_rc.c:32:3-32:16) - [Warning][Behavior > Undefined > NullPointerDereference][CWE-476] May dereference NULL pointer (16-type_rc.c:33:3-33:16) - [Warning][Behavior > Undefined > NullPointerDereference][CWE-476] May dereference NULL pointer (16-type_rc.c:36:3-36:9) - [Warning][Race] Memory location (struct s).datum (race with conf. 100): - write with [mhp:{tid=[main, t_fun@16-type_rc.c:35:3-35:37#top]}, thread:[main, t_fun@16-type_rc.c:35:3-35:37#top]] (conf. 100) (exp: & s->datum) (16-type_rc.c:21:3-21:15) - write with [mhp:{tid=[main]; created={[main, t_fun@16-type_rc.c:35:3-35:37#top]}}, thread:[main]] (conf. 100) (exp: & *d) (16-type_rc.c:36:3-36:9) - [Error][Imprecise][Unsound] Function definition missing for get_s (16-type_rc.c:20:12-20:24) - [Error][Imprecise][Unsound] Function definition missing for get_s (16-type_rc.c:31:3-31:14) - [Error][Imprecise][Unsound] Function definition missing + $ goblint --enable warn.deterministic --disable warn.info --enable ana.race.direct-arithmetic --set ana.activated[+] "'var_eq'" --set ana.activated[+] "'symb_locks'" --enable dbg.full-output 16-type_rc.c > full-output-1.txt 2>&1 - $ goblint --enable warn.deterministic --disable warn.info --disable ana.race.direct-arithmetic --set ana.activated[+] "'var_eq'" --set ana.activated[+] "'symb_locks'" --enable allglobs --enable dbg.full-output 16-type_rc.c - [Warning][Behavior > Undefined > NullPointerDereference][CWE-476] May dereference NULL pointer (16-type_rc.c:21:3-21:15) - [Warning][Behavior > Undefined > NullPointerDereference][CWE-476] May dereference NULL pointer (16-type_rc.c:32:3-32:16) - [Warning][Behavior > Undefined > NullPointerDereference][CWE-476] May dereference NULL pointer (16-type_rc.c:33:3-33:16) - [Warning][Behavior > Undefined > NullPointerDereference][CWE-476] May dereference NULL pointer (16-type_rc.c:36:3-36:9) - [Success][Race] Memory location (struct s).datum (safe): - write with [mhp:{tid=[main, t_fun@16-type_rc.c:35:3-35:37#top]}, thread:[main, t_fun@16-type_rc.c:35:3-35:37#top]] (conf. 100) (exp: & s->datum) (16-type_rc.c:21:3-21:15) - [Error][Imprecise][Unsound] Function definition missing for get_s (16-type_rc.c:20:12-20:24) - [Error][Imprecise][Unsound] Function definition missing for get_s (16-type_rc.c:31:3-31:14) - [Error][Imprecise][Unsound] Function definition missing + $ diff default-output-1.txt full-output-1.txt + 6,7c6,7 + < write with thread:[main, t_fun@16-type_rc.c:35:3-35:37] (conf. 100) (exp: & s->datum) (16-type_rc.c:21:3-21:15) + < write with [mhp:{created={[main, t_fun@16-type_rc.c:35:3-35:37]}}, thread:[main]] (conf. 100) (exp: & *d) (16-type_rc.c:36:3-36:9) + --- + > write with [mhp:{tid=[main, t_fun@16-type_rc.c:35:3-35:37#top]}, thread:[main, t_fun@16-type_rc.c:35:3-35:37#top]] (conf. 100) (exp: & s->datum) (16-type_rc.c:21:3-21:15) + > write with [mhp:{tid=[main]; created={[main, t_fun@16-type_rc.c:35:3-35:37#top]}}, thread:[main]] (conf. 100) (exp: & *d) (16-type_rc.c:36:3-36:9) + [1] + + $ goblint --enable warn.deterministic --disable warn.info --disable ana.race.direct-arithmetic --set ana.activated[+] "'var_eq'" --set ana.activated[+] "'symb_locks'" --enable allglobs --enable dbg.full-output 16-type_rc.c > full-output-2.txt 2>&1 + + $ diff default-output-2.txt full-output-2.txt + 6c6 + < write with thread:[main, t_fun@16-type_rc.c:35:3-35:37] (conf. 100) (exp: & s->datum) (16-type_rc.c:21:3-21:15) + --- + > write with [mhp:{tid=[main, t_fun@16-type_rc.c:35:3-35:37#top]}, thread:[main, t_fun@16-type_rc.c:35:3-35:37#top]] (conf. 100) (exp: & s->datum) (16-type_rc.c:21:3-21:15) + [1] diff --git a/tests/regression/06-symbeq/21-mult_accs_rc.t b/tests/regression/06-symbeq/21-mult_accs_rc.t index e1b9cdc8ec..376b79ae88 100644 --- a/tests/regression/06-symbeq/21-mult_accs_rc.t +++ b/tests/regression/06-symbeq/21-mult_accs_rc.t @@ -1,6 +1,6 @@ Disable info messages because race summary contains (safe) memory location count, which is different on Linux and OSX. - $ goblint --enable warn.deterministic --disable warn.info --enable ana.race.direct-arithmetic --set ana.activated[+] "'var_eq'" --set ana.activated[+] "'symb_locks'" 21-mult_accs_rc.c + $ goblint --enable warn.deterministic --disable warn.info --enable ana.race.direct-arithmetic --set ana.activated[+] "'var_eq'" --set ana.activated[+] "'symb_locks'" 21-mult_accs_rc.c 2>&1 | tee default-output-1.txt [Warning][Behavior > Undefined > NullPointerDereference][CWE-476] May dereference NULL pointer (21-mult_accs_rc.c:14:3-14:32) [Warning][Behavior > Undefined > NullPointerDereference][CWE-476] May dereference NULL pointer (21-mult_accs_rc.c:16:3-16:14) [Warning][Behavior > Undefined > NullPointerDereference][CWE-476] May dereference NULL pointer (21-mult_accs_rc.c:17:3-17:32) @@ -17,7 +17,7 @@ Disable info messages because race summary contains (safe) memory location count [Error][Imprecise][Unsound] Function definition missing for get_s (21-mult_accs_rc.c:27:3-27:14) [Error][Imprecise][Unsound] Function definition missing - $ goblint --enable warn.deterministic --disable warn.info --disable ana.race.direct-arithmetic --set ana.activated[+] "'var_eq'" --set ana.activated[+] "'symb_locks'" --enable allglobs 21-mult_accs_rc.c + $ goblint --enable warn.deterministic --disable warn.info --disable ana.race.direct-arithmetic --set ana.activated[+] "'var_eq'" --set ana.activated[+] "'symb_locks'" --enable allglobs 21-mult_accs_rc.c 2>&1 | tee default-output-2.txt [Warning][Behavior > Undefined > NullPointerDereference][CWE-476] May dereference NULL pointer (21-mult_accs_rc.c:14:3-14:32) [Warning][Behavior > Undefined > NullPointerDereference][CWE-476] May dereference NULL pointer (21-mult_accs_rc.c:16:3-16:14) [Warning][Behavior > Undefined > NullPointerDereference][CWE-476] May dereference NULL pointer (21-mult_accs_rc.c:17:3-17:32) @@ -33,35 +33,22 @@ Disable info messages because race summary contains (safe) memory location count [Error][Imprecise][Unsound] Function definition missing for get_s (21-mult_accs_rc.c:27:3-27:14) [Error][Imprecise][Unsound] Function definition missing - $ goblint --enable warn.deterministic --disable warn.info --enable ana.race.direct-arithmetic --set ana.activated[+] "'var_eq'" --set ana.activated[+] "'symb_locks'" --enable dbg.full-output 21-mult_accs_rc.c - [Warning][Behavior > Undefined > NullPointerDereference][CWE-476] May dereference NULL pointer (21-mult_accs_rc.c:14:3-14:32) - [Warning][Behavior > Undefined > NullPointerDereference][CWE-476] May dereference NULL pointer (21-mult_accs_rc.c:16:3-16:14) - [Warning][Behavior > Undefined > NullPointerDereference][CWE-476] May dereference NULL pointer (21-mult_accs_rc.c:17:3-17:32) - [Warning][Behavior > Undefined > NullPointerDereference][CWE-476] May dereference NULL pointer (21-mult_accs_rc.c:28:3-28:16) - [Warning][Behavior > Undefined > NullPointerDereference][CWE-476] May dereference NULL pointer (21-mult_accs_rc.c:29:3-29:15) - [Warning][Behavior > Undefined > NullPointerDereference][CWE-476] May dereference NULL pointer (21-mult_accs_rc.c:34:3-34:9) - [Warning][Race] Memory location (struct s).data (race with conf. 100): - write with [mhp:{tid=[main, t_fun@21-mult_accs_rc.c:31:3-31:37#top]}, thread:[main, t_fun@21-mult_accs_rc.c:31:3-31:37#top]] (conf. 100) (exp: & s->data) (21-mult_accs_rc.c:16:3-16:14) - write with [symblock:{p-lock:*.mutex}, mhp:{tid=[main]; created={[main, t_fun@21-mult_accs_rc.c:31:3-31:37#top]}}, thread:[main]] (conf. 100) (exp: & *d) (21-mult_accs_rc.c:34:3-34:9) - [Warning][Unknown] unlocking mutex (NULL) which may not be held (21-mult_accs_rc.c:35:3-35:26) - [Warning][Unknown] unlocking unknown mutex which may not be held (21-mult_accs_rc.c:35:3-35:26) - [Error][Imprecise][Unsound] Function definition missing for get_s (21-mult_accs_rc.c:13:3-13:14) - [Error][Imprecise][Unsound] Function definition missing for get_s (21-mult_accs_rc.c:15:3-15:14) - [Error][Imprecise][Unsound] Function definition missing for get_s (21-mult_accs_rc.c:27:3-27:14) - [Error][Imprecise][Unsound] Function definition missing + $ goblint --enable warn.deterministic --disable warn.info --enable ana.race.direct-arithmetic --set ana.activated[+] "'var_eq'" --set ana.activated[+] "'symb_locks'" --enable dbg.full-output 21-mult_accs_rc.c > full-output-1.txt 2>&1 - $ goblint --enable warn.deterministic --disable warn.info --disable ana.race.direct-arithmetic --set ana.activated[+] "'var_eq'" --set ana.activated[+] "'symb_locks'" --enable allglobs --enable dbg.full-output 21-mult_accs_rc.c - [Warning][Behavior > Undefined > NullPointerDereference][CWE-476] May dereference NULL pointer (21-mult_accs_rc.c:14:3-14:32) - [Warning][Behavior > Undefined > NullPointerDereference][CWE-476] May dereference NULL pointer (21-mult_accs_rc.c:16:3-16:14) - [Warning][Behavior > Undefined > NullPointerDereference][CWE-476] May dereference NULL pointer (21-mult_accs_rc.c:17:3-17:32) - [Warning][Behavior > Undefined > NullPointerDereference][CWE-476] May dereference NULL pointer (21-mult_accs_rc.c:28:3-28:16) - [Warning][Behavior > Undefined > NullPointerDereference][CWE-476] May dereference NULL pointer (21-mult_accs_rc.c:29:3-29:15) - [Warning][Behavior > Undefined > NullPointerDereference][CWE-476] May dereference NULL pointer (21-mult_accs_rc.c:34:3-34:9) - [Success][Race] Memory location (struct s).data (safe): - write with [mhp:{tid=[main, t_fun@21-mult_accs_rc.c:31:3-31:37#top]}, thread:[main, t_fun@21-mult_accs_rc.c:31:3-31:37#top]] (conf. 100) (exp: & s->data) (21-mult_accs_rc.c:16:3-16:14) - [Warning][Unknown] unlocking mutex (NULL) which may not be held (21-mult_accs_rc.c:35:3-35:26) - [Warning][Unknown] unlocking unknown mutex which may not be held (21-mult_accs_rc.c:35:3-35:26) - [Error][Imprecise][Unsound] Function definition missing for get_s (21-mult_accs_rc.c:13:3-13:14) - [Error][Imprecise][Unsound] Function definition missing for get_s (21-mult_accs_rc.c:15:3-15:14) - [Error][Imprecise][Unsound] Function definition missing for get_s (21-mult_accs_rc.c:27:3-27:14) - [Error][Imprecise][Unsound] Function definition missing + $ diff default-output-1.txt full-output-1.txt + 8,9c8,9 + < write with thread:[main, t_fun@21-mult_accs_rc.c:31:3-31:37] (conf. 100) (exp: & s->data) (21-mult_accs_rc.c:16:3-16:14) + < write with [symblock:{p-lock:*.mutex}, mhp:{created={[main, t_fun@21-mult_accs_rc.c:31:3-31:37]}}, thread:[main]] (conf. 100) (exp: & *d) (21-mult_accs_rc.c:34:3-34:9) + --- + > write with [mhp:{tid=[main, t_fun@21-mult_accs_rc.c:31:3-31:37#top]}, thread:[main, t_fun@21-mult_accs_rc.c:31:3-31:37#top]] (conf. 100) (exp: & s->data) (21-mult_accs_rc.c:16:3-16:14) + > write with [symblock:{p-lock:*.mutex}, mhp:{tid=[main]; created={[main, t_fun@21-mult_accs_rc.c:31:3-31:37#top]}}, thread:[main]] (conf. 100) (exp: & *d) (21-mult_accs_rc.c:34:3-34:9) + [1] + + $ goblint --enable warn.deterministic --disable warn.info --disable ana.race.direct-arithmetic --set ana.activated[+] "'var_eq'" --set ana.activated[+] "'symb_locks'" --enable allglobs --enable dbg.full-output 21-mult_accs_rc.c > full-output-2.txt 2>&1 + + $ diff default-output-2.txt full-output-2.txt + 8c8 + < write with thread:[main, t_fun@21-mult_accs_rc.c:31:3-31:37] (conf. 100) (exp: & s->data) (21-mult_accs_rc.c:16:3-16:14) + --- + > write with [mhp:{tid=[main, t_fun@21-mult_accs_rc.c:31:3-31:37#top]}, thread:[main, t_fun@21-mult_accs_rc.c:31:3-31:37#top]] (conf. 100) (exp: & s->data) (21-mult_accs_rc.c:16:3-16:14) + [1] diff --git a/tests/regression/45-escape/51-fresh-global.t b/tests/regression/45-escape/51-fresh-global.t index c045859ff5..ceb21425e8 100644 --- a/tests/regression/45-escape/51-fresh-global.t +++ b/tests/regression/45-escape/51-fresh-global.t @@ -1,4 +1,4 @@ - $ goblint --set ana.activated[+] mallocFresh --set ana.activated[-] mhp --set ana.thread.domain plain 51-fresh-global.c | sed -r 's/sid:[0-9]+/sid:$SID/' + $ goblint --set ana.activated[+] mallocFresh --set ana.activated[-] mhp --set ana.thread.domain plain 51-fresh-global.c 2>&1 | sed -r 's/sid:[0-9]+/sid:$SID/' | tee default-output.txt [Info][Deadcode] Logical lines of code (LLoC) summary: live: 15 dead: 0 @@ -12,16 +12,11 @@ unsafe: 1 total memory locations: 2 - $ goblint --set ana.activated[+] mallocFresh --set ana.activated[-] mhp --set ana.thread.domain plain --enable dbg.full-output 51-fresh-global.c | sed -r 's/sid:[0-9]+/sid:$SID/' - [Info][Deadcode] Logical lines of code (LLoC) summary: - live: 15 - dead: 0 - total lines: 15 - [Warning][Race] Memory location (alloc@sid:$SID@tid:main(#top)) (race with conf. 110): (51-fresh-global.c:25:7-25:31) - write with lock:{A} (conf. 110) (exp: & *i) (51-fresh-global.c:10:3-10:10) - write with thread:main (conf. 110) (exp: & *i) (51-fresh-global.c:27:3-27:9) - [Info][Race] Memory locations race summary: - safe: 1 - vulnerable: 0 - unsafe: 1 - total memory locations: 2 + $ goblint --set ana.activated[+] mallocFresh --set ana.activated[-] mhp --set ana.thread.domain plain --enable dbg.full-output 51-fresh-global.c 2>&1 | sed -r 's/sid:[0-9]+/sid:$SID/' > full-output.txt + + $ diff default-output.txt full-output.txt + 5c5 + < [Warning][Race] Memory location (alloc@sid:$SID@tid:main) (race with conf. 110): (51-fresh-global.c:25:7-25:31) + --- + > [Warning][Race] Memory location (alloc@sid:$SID@tid:main(#top)) (race with conf. 110): (51-fresh-global.c:25:7-25:31) + [1] diff --git a/tests/regression/74-invalid_deref/01-oob-heap-simple.t b/tests/regression/74-invalid_deref/01-oob-heap-simple.t index 19b09d6be7..a9e76c722d 100644 --- a/tests/regression/74-invalid_deref/01-oob-heap-simple.t +++ b/tests/regression/74-invalid_deref/01-oob-heap-simple.t @@ -1,4 +1,4 @@ - $ goblint --set ana.activated[+] memOutOfBounds --enable ana.int.interval 01-oob-heap-simple.c + $ goblint --set ana.activated[+] memOutOfBounds --enable ana.int.interval 01-oob-heap-simple.c 2>&1 | tee default-output.txt Option warning: The memOutOfBounds analysis enables cil.addNestedScopeAttr. [Warning][Behavior > Undefined > MemoryOutOfBoundsAccess][CWE-823] Size of pointer in expression ptr + 10 is 5 (in bytes). It is offset by 10 (in bytes). Memory out-of-bounds access must occur (01-oob-heap-simple.c:10:5-10:22) [Warning][Behavior > Undefined > MemoryOutOfBoundsAccess][CWE-823] Could not compare pointer size (5) with offset (⊤). Memory out-of-bounds access may occur (01-oob-heap-simple.c:11:5-11:21) @@ -7,11 +7,13 @@ dead: 0 total lines: 8 - $ goblint --set ana.activated[+] memOutOfBounds --enable ana.int.interval --enable dbg.full-output 01-oob-heap-simple.c - Option warning: The memOutOfBounds analysis enables cil.addNestedScopeAttr. - [Warning][Behavior > Undefined > MemoryOutOfBoundsAccess][CWE-823] Size of pointer in expression ptr + 10 is (5,[5,5]) (in bytes). It is offset by (10,[10,10]) (in bytes). Memory out-of-bounds access must occur (01-oob-heap-simple.c:10:5-10:22) - [Warning][Behavior > Undefined > MemoryOutOfBoundsAccess][CWE-823] Could not compare pointer size ((5,[5,5])) with offset ((Unknown int([-63,63]),[-9223372036854775808,9223372036854775807])). Memory out-of-bounds access may occur (01-oob-heap-simple.c:11:5-11:21) - [Info][Deadcode] Logical lines of code (LLoC) summary: - live: 8 - dead: 0 - total lines: 8 + $ goblint --set ana.activated[+] memOutOfBounds --enable ana.int.interval --enable dbg.full-output 01-oob-heap-simple.c > full-output.txt 2>&1 + + $ diff default-output.txt full-output.txt + 2,3c2,3 + < [Warning][Behavior > Undefined > MemoryOutOfBoundsAccess][CWE-823] Size of pointer in expression ptr + 10 is 5 (in bytes). It is offset by 10 (in bytes). Memory out-of-bounds access must occur (01-oob-heap-simple.c:10:5-10:22) + < [Warning][Behavior > Undefined > MemoryOutOfBoundsAccess][CWE-823] Could not compare pointer size (5) with offset (⊤). Memory out-of-bounds access may occur (01-oob-heap-simple.c:11:5-11:21) + --- + > [Warning][Behavior > Undefined > MemoryOutOfBoundsAccess][CWE-823] Size of pointer in expression ptr + 10 is (5,[5,5]) (in bytes). It is offset by (10,[10,10]) (in bytes). Memory out-of-bounds access must occur (01-oob-heap-simple.c:10:5-10:22) + > [Warning][Behavior > Undefined > MemoryOutOfBoundsAccess][CWE-823] Could not compare pointer size ((5,[5,5])) with offset ((Unknown int([-63,63]),[-9223372036854775808,9223372036854775807])). Memory out-of-bounds access may occur (01-oob-heap-simple.c:11:5-11:21) + [1] From c28e863e5b980c2a430dede92eff5e986558b44e Mon Sep 17 00:00:00 2001 From: Karoliine Holter Date: Wed, 14 Feb 2024 13:33:29 +0200 Subject: [PATCH 33/35] Use dbg.full-output in printXml --- src/cdomain/value/cdomains/intDomain.ml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/cdomain/value/cdomains/intDomain.ml b/src/cdomain/value/cdomains/intDomain.ml index fb9a2a7e2f..b2e38b2fea 100644 --- a/src/cdomain/value/cdomains/intDomain.ml +++ b/src/cdomain/value/cdomains/intDomain.ml @@ -3727,8 +3727,8 @@ module IntDomTupleImpl = struct let pretty_diff () (x,y) = dprintf "%a instead of %a" pretty x pretty y let printXml f x = match to_int x with - | Some v -> BatPrintf.fprintf f "\n\n%s\n\n\n" (Z.to_string v) - | None -> BatPrintf.fprintf f "\n\n%s\n\n\n" (show x) + | Some v when not (GobConfig.get_bool "dbg.full-output") -> BatPrintf.fprintf f "\n\n%s\n\n\n" (Z.to_string v) + | _ -> BatPrintf.fprintf f "\n\n%s\n\n\n" (show x) let invariant_ikind e ik x = match to_int x with From cfd6b0e46fe2ca8844a90d6499fbb7d94516c12e Mon Sep 17 00:00:00 2001 From: Karoliine Holter Date: Wed, 14 Feb 2024 13:37:59 +0200 Subject: [PATCH 34/35] =?UTF-8?q?tID=20#top=20->=20=E2=8A=A4=20and=20chang?= =?UTF-8?q?e=20cram=20tests=20accordingly?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/cdomain/value/cdomains/threadIdDomain.ml | 2 +- tests/regression/04-mutex/01-simple_rc.t | 8 ++++---- tests/regression/04-mutex/49-type-invariants.t | 12 ++++++------ tests/regression/04-mutex/77-type-nested-fields.t | 6 +++--- .../04-mutex/79-type-nested-fields-deep1.t | 6 +++--- .../04-mutex/80-type-nested-fields-deep2.t | 6 +++--- tests/regression/04-mutex/84-distribute-fields-1.t | 6 +++--- tests/regression/04-mutex/85-distribute-fields-2.t | 6 +++--- tests/regression/04-mutex/86-distribute-fields-3.t | 6 +++--- tests/regression/04-mutex/87-distribute-fields-4.t | 4 ++-- tests/regression/04-mutex/88-distribute-fields-5.t | 4 ++-- tests/regression/04-mutex/89-distribute-fields-6.t | 4 ++-- .../04-mutex/90-distribute-fields-type-1.t | 8 ++++---- .../04-mutex/91-distribute-fields-type-2.t | 8 ++++---- .../04-mutex/92-distribute-fields-type-deep.t | 8 ++++---- .../04-mutex/93-distribute-fields-type-global.t | 8 ++++---- tests/regression/06-symbeq/14-list_entry_rc.t | 8 ++++---- tests/regression/06-symbeq/16-type_rc.t | 6 +++--- tests/regression/06-symbeq/21-mult_accs_rc.t | 6 +++--- 19 files changed, 61 insertions(+), 61 deletions(-) diff --git a/src/cdomain/value/cdomains/threadIdDomain.ml b/src/cdomain/value/cdomains/threadIdDomain.ml index 8d1f1e4d97..19ac502c23 100644 --- a/src/cdomain/value/cdomains/threadIdDomain.ml +++ b/src/cdomain/value/cdomains/threadIdDomain.ml @@ -63,7 +63,7 @@ struct let vname_loc = vname ^ "@" ^ CilType.Location.show (UpdateCil.getLoc n) in match i_opt with | Some i -> vname_loc ^ "#" ^ string_of_int i - | None when GobConfig.get_bool "dbg.full-output" -> vname_loc ^ "#top" + | None when GobConfig.get_bool "dbg.full-output" -> vname_loc ^ "#⊤" | None -> vname_loc include Printable.SimpleShow ( diff --git a/tests/regression/04-mutex/01-simple_rc.t b/tests/regression/04-mutex/01-simple_rc.t index 04427803cb..bd0bc0e161 100644 --- a/tests/regression/04-mutex/01-simple_rc.t +++ b/tests/regression/04-mutex/01-simple_rc.t @@ -23,8 +23,8 @@ < read with [lock:{mutex1}, thread:[main, t_fun@01-simple_rc.c:17:3-17:40]] (conf. 110) (exp: & myglobal) (01-simple_rc.c:10:3-10:22) < read with [mhp:{created={[main, t_fun@01-simple_rc.c:17:3-17:40]}}, lock:{mutex2}, thread:[main]] (conf. 110) (exp: & myglobal) (01-simple_rc.c:19:3-19:22) --- - > write with [mhp:{tid=[main, t_fun@01-simple_rc.c:17:3-17:40#top]}, lock:{mutex1}, thread:[main, t_fun@01-simple_rc.c:17:3-17:40#top]] (conf. 110) (exp: & myglobal) (01-simple_rc.c:10:3-10:22) - > write with [mhp:{tid=[main]; created={[main, t_fun@01-simple_rc.c:17:3-17:40#top]}}, lock:{mutex2}, thread:[main]] (conf. 110) (exp: & myglobal) (01-simple_rc.c:19:3-19:22) - > read with [mhp:{tid=[main, t_fun@01-simple_rc.c:17:3-17:40#top]}, lock:{mutex1}, thread:[main, t_fun@01-simple_rc.c:17:3-17:40#top]] (conf. 110) (exp: & myglobal) (01-simple_rc.c:10:3-10:22) - > read with [mhp:{tid=[main]; created={[main, t_fun@01-simple_rc.c:17:3-17:40#top]}}, lock:{mutex2}, thread:[main]] (conf. 110) (exp: & myglobal) (01-simple_rc.c:19:3-19:22) + > write with [mhp:{tid=[main, t_fun@01-simple_rc.c:17:3-17:40#⊤]}, lock:{mutex1}, thread:[main, t_fun@01-simple_rc.c:17:3-17:40#⊤]] (conf. 110) (exp: & myglobal) (01-simple_rc.c:10:3-10:22) + > write with [mhp:{tid=[main]; created={[main, t_fun@01-simple_rc.c:17:3-17:40#⊤]}}, lock:{mutex2}, thread:[main]] (conf. 110) (exp: & myglobal) (01-simple_rc.c:19:3-19:22) + > read with [mhp:{tid=[main, t_fun@01-simple_rc.c:17:3-17:40#⊤]}, lock:{mutex1}, thread:[main, t_fun@01-simple_rc.c:17:3-17:40#⊤]] (conf. 110) (exp: & myglobal) (01-simple_rc.c:10:3-10:22) + > read with [mhp:{tid=[main]; created={[main, t_fun@01-simple_rc.c:17:3-17:40#⊤]}}, lock:{mutex2}, thread:[main]] (conf. 110) (exp: & myglobal) (01-simple_rc.c:19:3-19:22) [1] diff --git a/tests/regression/04-mutex/49-type-invariants.t b/tests/regression/04-mutex/49-type-invariants.t index 8ce3fb9b4c..d757519b29 100644 --- a/tests/regression/04-mutex/49-type-invariants.t +++ b/tests/regression/04-mutex/49-type-invariants.t @@ -51,12 +51,12 @@ < write with [mhp:{created={[main, t_fun@49-type-invariants.c:20:3-20:40]}}, thread:[main]] (conf. 100) (exp: & tmp->field) (49-type-invariants.c:21:3-21:21) < read with thread:[main, t_fun@49-type-invariants.c:20:3-20:40] (conf. 110) (exp: & s.field) (49-type-invariants.c:11:3-11:23) --- - > write with [mhp:{tid=[main]; created={[main, t_fun@49-type-invariants.c:20:3-20:40#top]}}, thread:[main]] (conf. 100) (exp: & tmp->field) (49-type-invariants.c:21:3-21:21) - > read with [mhp:{tid=[main, t_fun@49-type-invariants.c:20:3-20:40#top]}, thread:[main, t_fun@49-type-invariants.c:20:3-20:40#top]] (conf. 110) (exp: & s.field) (49-type-invariants.c:11:3-11:23) + > write with [mhp:{tid=[main]; created={[main, t_fun@49-type-invariants.c:20:3-20:40#⊤]}}, thread:[main]] (conf. 100) (exp: & tmp->field) (49-type-invariants.c:21:3-21:21) + > read with [mhp:{tid=[main, t_fun@49-type-invariants.c:20:3-20:40#⊤]}, thread:[main, t_fun@49-type-invariants.c:20:3-20:40#⊤]] (conf. 110) (exp: & s.field) (49-type-invariants.c:11:3-11:23) 11c11 < write with [mhp:{created={[main, t_fun@49-type-invariants.c:20:3-20:40]}}, thread:[main]] (conf. 100) (exp: & tmp->field) (49-type-invariants.c:21:3-21:21) --- - > write with [mhp:{tid=[main]; created={[main, t_fun@49-type-invariants.c:20:3-20:40#top]}}, thread:[main]] (conf. 100) (exp: & tmp->field) (49-type-invariants.c:21:3-21:21) + > write with [mhp:{tid=[main]; created={[main, t_fun@49-type-invariants.c:20:3-20:40#⊤]}}, thread:[main]] (conf. 100) (exp: & tmp->field) (49-type-invariants.c:21:3-21:21) [1] $ goblint --enable warn.deterministic --disable ana.race.direct-arithmetic --enable allglobs --enable dbg.full-output 49-type-invariants.c > full-output-2.txt 2>&1 @@ -66,10 +66,10 @@ < write with [mhp:{created={[main, t_fun@49-type-invariants.c:20:3-20:40]}}, thread:[main]] (conf. 100) (exp: & tmp->field) (49-type-invariants.c:21:3-21:21) < read with thread:[main, t_fun@49-type-invariants.c:20:3-20:40] (conf. 110) (exp: & s.field) (49-type-invariants.c:11:3-11:23) --- - > write with [mhp:{tid=[main]; created={[main, t_fun@49-type-invariants.c:20:3-20:40#top]}}, thread:[main]] (conf. 100) (exp: & tmp->field) (49-type-invariants.c:21:3-21:21) - > read with [mhp:{tid=[main, t_fun@49-type-invariants.c:20:3-20:40#top]}, thread:[main, t_fun@49-type-invariants.c:20:3-20:40#top]] (conf. 110) (exp: & s.field) (49-type-invariants.c:11:3-11:23) + > write with [mhp:{tid=[main]; created={[main, t_fun@49-type-invariants.c:20:3-20:40#⊤]}}, thread:[main]] (conf. 100) (exp: & tmp->field) (49-type-invariants.c:21:3-21:21) + > read with [mhp:{tid=[main, t_fun@49-type-invariants.c:20:3-20:40#⊤]}, thread:[main, t_fun@49-type-invariants.c:20:3-20:40#⊤]] (conf. 110) (exp: & s.field) (49-type-invariants.c:11:3-11:23) 11c11 < write with [mhp:{created={[main, t_fun@49-type-invariants.c:20:3-20:40]}}, thread:[main]] (conf. 100) (exp: & tmp->field) (49-type-invariants.c:21:3-21:21) --- - > write with [mhp:{tid=[main]; created={[main, t_fun@49-type-invariants.c:20:3-20:40#top]}}, thread:[main]] (conf. 100) (exp: & tmp->field) (49-type-invariants.c:21:3-21:21) + > write with [mhp:{tid=[main]; created={[main, t_fun@49-type-invariants.c:20:3-20:40#⊤]}}, thread:[main]] (conf. 100) (exp: & tmp->field) (49-type-invariants.c:21:3-21:21) [1] diff --git a/tests/regression/04-mutex/77-type-nested-fields.t b/tests/regression/04-mutex/77-type-nested-fields.t index 3f2de12a66..15559cefec 100644 --- a/tests/regression/04-mutex/77-type-nested-fields.t +++ b/tests/regression/04-mutex/77-type-nested-fields.t @@ -32,10 +32,10 @@ < write with thread:[main, t_fun@77-type-nested-fields.c:37:3-37:40] (conf. 100) (exp: & tmp->field) (77-type-nested-fields.c:31:3-31:20) < write with [mhp:{created={[main, t_fun@77-type-nested-fields.c:37:3-37:40]}}, thread:[main]] (conf. 100) (exp: & tmp->s.field) (77-type-nested-fields.c:38:3-38:22) --- - > write with [mhp:{tid=[main, t_fun@77-type-nested-fields.c:37:3-37:40#top]}, thread:[main, t_fun@77-type-nested-fields.c:37:3-37:40#top]] (conf. 100) (exp: & tmp->field) (77-type-nested-fields.c:31:3-31:20) - > write with [mhp:{tid=[main]; created={[main, t_fun@77-type-nested-fields.c:37:3-37:40#top]}}, thread:[main]] (conf. 100) (exp: & tmp->s.field) (77-type-nested-fields.c:38:3-38:22) + > write with [mhp:{tid=[main, t_fun@77-type-nested-fields.c:37:3-37:40#⊤]}, thread:[main, t_fun@77-type-nested-fields.c:37:3-37:40#⊤]] (conf. 100) (exp: & tmp->field) (77-type-nested-fields.c:31:3-31:20) + > write with [mhp:{tid=[main]; created={[main, t_fun@77-type-nested-fields.c:37:3-37:40#⊤]}}, thread:[main]] (conf. 100) (exp: & tmp->s.field) (77-type-nested-fields.c:38:3-38:22) 12c12 < write with thread:[main, t_fun@77-type-nested-fields.c:37:3-37:40] (conf. 100) (exp: & tmp->field) (77-type-nested-fields.c:31:3-31:20) --- - > write with [mhp:{tid=[main, t_fun@77-type-nested-fields.c:37:3-37:40#top]}, thread:[main, t_fun@77-type-nested-fields.c:37:3-37:40#top]] (conf. 100) (exp: & tmp->field) (77-type-nested-fields.c:31:3-31:20) + > write with [mhp:{tid=[main, t_fun@77-type-nested-fields.c:37:3-37:40#⊤]}, thread:[main, t_fun@77-type-nested-fields.c:37:3-37:40#⊤]] (conf. 100) (exp: & tmp->field) (77-type-nested-fields.c:31:3-31:20) [1] diff --git a/tests/regression/04-mutex/79-type-nested-fields-deep1.t b/tests/regression/04-mutex/79-type-nested-fields-deep1.t index 244e705d4a..680200aecd 100644 --- a/tests/regression/04-mutex/79-type-nested-fields-deep1.t +++ b/tests/regression/04-mutex/79-type-nested-fields-deep1.t @@ -32,10 +32,10 @@ < write with thread:[main, t_fun@79-type-nested-fields-deep1.c:42:3-42:40] (conf. 100) (exp: & tmp->field) (79-type-nested-fields-deep1.c:36:3-36:20) < write with [mhp:{created={[main, t_fun@79-type-nested-fields-deep1.c:42:3-42:40]}}, thread:[main]] (conf. 100) (exp: & tmp->t.s.field) (79-type-nested-fields-deep1.c:43:3-43:24) --- - > write with [mhp:{tid=[main, t_fun@79-type-nested-fields-deep1.c:42:3-42:40#top]}, thread:[main, t_fun@79-type-nested-fields-deep1.c:42:3-42:40#top]] (conf. 100) (exp: & tmp->field) (79-type-nested-fields-deep1.c:36:3-36:20) - > write with [mhp:{tid=[main]; created={[main, t_fun@79-type-nested-fields-deep1.c:42:3-42:40#top]}}, thread:[main]] (conf. 100) (exp: & tmp->t.s.field) (79-type-nested-fields-deep1.c:43:3-43:24) + > write with [mhp:{tid=[main, t_fun@79-type-nested-fields-deep1.c:42:3-42:40#⊤]}, thread:[main, t_fun@79-type-nested-fields-deep1.c:42:3-42:40#⊤]] (conf. 100) (exp: & tmp->field) (79-type-nested-fields-deep1.c:36:3-36:20) + > write with [mhp:{tid=[main]; created={[main, t_fun@79-type-nested-fields-deep1.c:42:3-42:40#⊤]}}, thread:[main]] (conf. 100) (exp: & tmp->t.s.field) (79-type-nested-fields-deep1.c:43:3-43:24) 12c12 < write with thread:[main, t_fun@79-type-nested-fields-deep1.c:42:3-42:40] (conf. 100) (exp: & tmp->field) (79-type-nested-fields-deep1.c:36:3-36:20) --- - > write with [mhp:{tid=[main, t_fun@79-type-nested-fields-deep1.c:42:3-42:40#top]}, thread:[main, t_fun@79-type-nested-fields-deep1.c:42:3-42:40#top]] (conf. 100) (exp: & tmp->field) (79-type-nested-fields-deep1.c:36:3-36:20) + > write with [mhp:{tid=[main, t_fun@79-type-nested-fields-deep1.c:42:3-42:40#⊤]}, thread:[main, t_fun@79-type-nested-fields-deep1.c:42:3-42:40#⊤]] (conf. 100) (exp: & tmp->field) (79-type-nested-fields-deep1.c:36:3-36:20) [1] diff --git a/tests/regression/04-mutex/80-type-nested-fields-deep2.t b/tests/regression/04-mutex/80-type-nested-fields-deep2.t index cebd5ed7ec..4a2811ccbd 100644 --- a/tests/regression/04-mutex/80-type-nested-fields-deep2.t +++ b/tests/regression/04-mutex/80-type-nested-fields-deep2.t @@ -32,10 +32,10 @@ < write with thread:[main, t_fun@80-type-nested-fields-deep2.c:42:3-42:40] (conf. 100) (exp: & tmp->s.field) (80-type-nested-fields-deep2.c:36:3-36:22) < write with [mhp:{created={[main, t_fun@80-type-nested-fields-deep2.c:42:3-42:40]}}, thread:[main]] (conf. 100) (exp: & tmp->t.s.field) (80-type-nested-fields-deep2.c:43:3-43:24) --- - > write with [mhp:{tid=[main, t_fun@80-type-nested-fields-deep2.c:42:3-42:40#top]}, thread:[main, t_fun@80-type-nested-fields-deep2.c:42:3-42:40#top]] (conf. 100) (exp: & tmp->s.field) (80-type-nested-fields-deep2.c:36:3-36:22) - > write with [mhp:{tid=[main]; created={[main, t_fun@80-type-nested-fields-deep2.c:42:3-42:40#top]}}, thread:[main]] (conf. 100) (exp: & tmp->t.s.field) (80-type-nested-fields-deep2.c:43:3-43:24) + > write with [mhp:{tid=[main, t_fun@80-type-nested-fields-deep2.c:42:3-42:40#⊤]}, thread:[main, t_fun@80-type-nested-fields-deep2.c:42:3-42:40#⊤]] (conf. 100) (exp: & tmp->s.field) (80-type-nested-fields-deep2.c:36:3-36:22) + > write with [mhp:{tid=[main]; created={[main, t_fun@80-type-nested-fields-deep2.c:42:3-42:40#⊤]}}, thread:[main]] (conf. 100) (exp: & tmp->t.s.field) (80-type-nested-fields-deep2.c:43:3-43:24) 12c12 < write with thread:[main, t_fun@80-type-nested-fields-deep2.c:42:3-42:40] (conf. 100) (exp: & tmp->s.field) (80-type-nested-fields-deep2.c:36:3-36:22) --- - > write with [mhp:{tid=[main, t_fun@80-type-nested-fields-deep2.c:42:3-42:40#top]}, thread:[main, t_fun@80-type-nested-fields-deep2.c:42:3-42:40#top]] (conf. 100) (exp: & tmp->s.field) (80-type-nested-fields-deep2.c:36:3-36:22) + > write with [mhp:{tid=[main, t_fun@80-type-nested-fields-deep2.c:42:3-42:40#⊤]}, thread:[main, t_fun@80-type-nested-fields-deep2.c:42:3-42:40#⊤]] (conf. 100) (exp: & tmp->s.field) (80-type-nested-fields-deep2.c:36:3-36:22) [1] diff --git a/tests/regression/04-mutex/84-distribute-fields-1.t b/tests/regression/04-mutex/84-distribute-fields-1.t index bee688e709..0fd55dcb53 100644 --- a/tests/regression/04-mutex/84-distribute-fields-1.t +++ b/tests/regression/04-mutex/84-distribute-fields-1.t @@ -21,10 +21,10 @@ < write with thread:[main, t_fun@84-distribute-fields-1.c:18:3-18:40] (conf. 110) (exp: & s.data) (84-distribute-fields-1.c:12:3-12:13) < write with [mhp:{created={[main, t_fun@84-distribute-fields-1.c:18:3-18:40]}}, thread:[main]] (conf. 110) (exp: & s) (84-distribute-fields-1.c:20:3-20:9) --- - > write with [mhp:{tid=[main, t_fun@84-distribute-fields-1.c:18:3-18:40#top]}, thread:[main, t_fun@84-distribute-fields-1.c:18:3-18:40#top]] (conf. 110) (exp: & s.data) (84-distribute-fields-1.c:12:3-12:13) - > write with [mhp:{tid=[main]; created={[main, t_fun@84-distribute-fields-1.c:18:3-18:40#top]}}, thread:[main]] (conf. 110) (exp: & s) (84-distribute-fields-1.c:20:3-20:9) + > write with [mhp:{tid=[main, t_fun@84-distribute-fields-1.c:18:3-18:40#⊤]}, thread:[main, t_fun@84-distribute-fields-1.c:18:3-18:40#⊤]] (conf. 110) (exp: & s.data) (84-distribute-fields-1.c:12:3-12:13) + > write with [mhp:{tid=[main]; created={[main, t_fun@84-distribute-fields-1.c:18:3-18:40#⊤]}}, thread:[main]] (conf. 110) (exp: & s) (84-distribute-fields-1.c:20:3-20:9) 10c10 < write with [mhp:{created={[main, t_fun@84-distribute-fields-1.c:18:3-18:40]}}, thread:[main]] (conf. 110) (exp: & s) (84-distribute-fields-1.c:20:3-20:9) --- - > write with [mhp:{tid=[main]; created={[main, t_fun@84-distribute-fields-1.c:18:3-18:40#top]}}, thread:[main]] (conf. 110) (exp: & s) (84-distribute-fields-1.c:20:3-20:9) + > write with [mhp:{tid=[main]; created={[main, t_fun@84-distribute-fields-1.c:18:3-18:40#⊤]}}, thread:[main]] (conf. 110) (exp: & s) (84-distribute-fields-1.c:20:3-20:9) [1] diff --git a/tests/regression/04-mutex/85-distribute-fields-2.t b/tests/regression/04-mutex/85-distribute-fields-2.t index a6288fc534..7f8fb7c942 100644 --- a/tests/regression/04-mutex/85-distribute-fields-2.t +++ b/tests/regression/04-mutex/85-distribute-fields-2.t @@ -21,10 +21,10 @@ < write with thread:[main, t_fun@85-distribute-fields-2.c:24:3-24:40] (conf. 110) (exp: & t.s.data) (85-distribute-fields-2.c:18:3-18:15) < write with [mhp:{created={[main, t_fun@85-distribute-fields-2.c:24:3-24:40]}}, thread:[main]] (conf. 110) (exp: & t.s) (85-distribute-fields-2.c:26:3-26:11) --- - > write with [mhp:{tid=[main, t_fun@85-distribute-fields-2.c:24:3-24:40#top]}, thread:[main, t_fun@85-distribute-fields-2.c:24:3-24:40#top]] (conf. 110) (exp: & t.s.data) (85-distribute-fields-2.c:18:3-18:15) - > write with [mhp:{tid=[main]; created={[main, t_fun@85-distribute-fields-2.c:24:3-24:40#top]}}, thread:[main]] (conf. 110) (exp: & t.s) (85-distribute-fields-2.c:26:3-26:11) + > write with [mhp:{tid=[main, t_fun@85-distribute-fields-2.c:24:3-24:40#⊤]}, thread:[main, t_fun@85-distribute-fields-2.c:24:3-24:40#⊤]] (conf. 110) (exp: & t.s.data) (85-distribute-fields-2.c:18:3-18:15) + > write with [mhp:{tid=[main]; created={[main, t_fun@85-distribute-fields-2.c:24:3-24:40#⊤]}}, thread:[main]] (conf. 110) (exp: & t.s) (85-distribute-fields-2.c:26:3-26:11) 10c10 < write with [mhp:{created={[main, t_fun@85-distribute-fields-2.c:24:3-24:40]}}, thread:[main]] (conf. 110) (exp: & t.s) (85-distribute-fields-2.c:26:3-26:11) --- - > write with [mhp:{tid=[main]; created={[main, t_fun@85-distribute-fields-2.c:24:3-24:40#top]}}, thread:[main]] (conf. 110) (exp: & t.s) (85-distribute-fields-2.c:26:3-26:11) + > write with [mhp:{tid=[main]; created={[main, t_fun@85-distribute-fields-2.c:24:3-24:40#⊤]}}, thread:[main]] (conf. 110) (exp: & t.s) (85-distribute-fields-2.c:26:3-26:11) [1] diff --git a/tests/regression/04-mutex/86-distribute-fields-3.t b/tests/regression/04-mutex/86-distribute-fields-3.t index c370f3593b..c5ebd6d28a 100644 --- a/tests/regression/04-mutex/86-distribute-fields-3.t +++ b/tests/regression/04-mutex/86-distribute-fields-3.t @@ -21,10 +21,10 @@ < write with thread:[main, t_fun@86-distribute-fields-3.c:24:3-24:40] (conf. 110) (exp: & t.s.data) (86-distribute-fields-3.c:18:3-18:15) < write with [mhp:{created={[main, t_fun@86-distribute-fields-3.c:24:3-24:40]}}, thread:[main]] (conf. 110) (exp: & t) (86-distribute-fields-3.c:26:3-26:9) --- - > write with [mhp:{tid=[main, t_fun@86-distribute-fields-3.c:24:3-24:40#top]}, thread:[main, t_fun@86-distribute-fields-3.c:24:3-24:40#top]] (conf. 110) (exp: & t.s.data) (86-distribute-fields-3.c:18:3-18:15) - > write with [mhp:{tid=[main]; created={[main, t_fun@86-distribute-fields-3.c:24:3-24:40#top]}}, thread:[main]] (conf. 110) (exp: & t) (86-distribute-fields-3.c:26:3-26:9) + > write with [mhp:{tid=[main, t_fun@86-distribute-fields-3.c:24:3-24:40#⊤]}, thread:[main, t_fun@86-distribute-fields-3.c:24:3-24:40#⊤]] (conf. 110) (exp: & t.s.data) (86-distribute-fields-3.c:18:3-18:15) + > write with [mhp:{tid=[main]; created={[main, t_fun@86-distribute-fields-3.c:24:3-24:40#⊤]}}, thread:[main]] (conf. 110) (exp: & t) (86-distribute-fields-3.c:26:3-26:9) 10c10 < write with [mhp:{created={[main, t_fun@86-distribute-fields-3.c:24:3-24:40]}}, thread:[main]] (conf. 110) (exp: & t) (86-distribute-fields-3.c:26:3-26:9) --- - > write with [mhp:{tid=[main]; created={[main, t_fun@86-distribute-fields-3.c:24:3-24:40#top]}}, thread:[main]] (conf. 110) (exp: & t) (86-distribute-fields-3.c:26:3-26:9) + > write with [mhp:{tid=[main]; created={[main, t_fun@86-distribute-fields-3.c:24:3-24:40#⊤]}}, thread:[main]] (conf. 110) (exp: & t) (86-distribute-fields-3.c:26:3-26:9) [1] diff --git a/tests/regression/04-mutex/87-distribute-fields-4.t b/tests/regression/04-mutex/87-distribute-fields-4.t index 904594224a..2d3dfb6b7c 100644 --- a/tests/regression/04-mutex/87-distribute-fields-4.t +++ b/tests/regression/04-mutex/87-distribute-fields-4.t @@ -19,6 +19,6 @@ < write with thread:[main, t_fun@87-distribute-fields-4.c:19:3-19:40] (conf. 110) (exp: & s) (87-distribute-fields-4.c:13:3-13:9) < write with [mhp:{created={[main, t_fun@87-distribute-fields-4.c:19:3-19:40]}}, thread:[main]] (conf. 110) (exp: & s) (87-distribute-fields-4.c:21:3-21:9) --- - > write with [mhp:{tid=[main, t_fun@87-distribute-fields-4.c:19:3-19:40#top]}, thread:[main, t_fun@87-distribute-fields-4.c:19:3-19:40#top]] (conf. 110) (exp: & s) (87-distribute-fields-4.c:13:3-13:9) - > write with [mhp:{tid=[main]; created={[main, t_fun@87-distribute-fields-4.c:19:3-19:40#top]}}, thread:[main]] (conf. 110) (exp: & s) (87-distribute-fields-4.c:21:3-21:9) + > write with [mhp:{tid=[main, t_fun@87-distribute-fields-4.c:19:3-19:40#⊤]}, thread:[main, t_fun@87-distribute-fields-4.c:19:3-19:40#⊤]] (conf. 110) (exp: & s) (87-distribute-fields-4.c:13:3-13:9) + > write with [mhp:{tid=[main]; created={[main, t_fun@87-distribute-fields-4.c:19:3-19:40#⊤]}}, thread:[main]] (conf. 110) (exp: & s) (87-distribute-fields-4.c:21:3-21:9) [1] diff --git a/tests/regression/04-mutex/88-distribute-fields-5.t b/tests/regression/04-mutex/88-distribute-fields-5.t index 7bae9c0c36..0afdc729ef 100644 --- a/tests/regression/04-mutex/88-distribute-fields-5.t +++ b/tests/regression/04-mutex/88-distribute-fields-5.t @@ -19,6 +19,6 @@ < write with thread:[main, t_fun@88-distribute-fields-5.c:25:3-25:40] (conf. 110) (exp: & t.s) (88-distribute-fields-5.c:19:3-19:11) < write with [mhp:{created={[main, t_fun@88-distribute-fields-5.c:25:3-25:40]}}, thread:[main]] (conf. 110) (exp: & t.s) (88-distribute-fields-5.c:27:3-27:11) --- - > write with [mhp:{tid=[main, t_fun@88-distribute-fields-5.c:25:3-25:40#top]}, thread:[main, t_fun@88-distribute-fields-5.c:25:3-25:40#top]] (conf. 110) (exp: & t.s) (88-distribute-fields-5.c:19:3-19:11) - > write with [mhp:{tid=[main]; created={[main, t_fun@88-distribute-fields-5.c:25:3-25:40#top]}}, thread:[main]] (conf. 110) (exp: & t.s) (88-distribute-fields-5.c:27:3-27:11) + > write with [mhp:{tid=[main, t_fun@88-distribute-fields-5.c:25:3-25:40#⊤]}, thread:[main, t_fun@88-distribute-fields-5.c:25:3-25:40#⊤]] (conf. 110) (exp: & t.s) (88-distribute-fields-5.c:19:3-19:11) + > write with [mhp:{tid=[main]; created={[main, t_fun@88-distribute-fields-5.c:25:3-25:40#⊤]}}, thread:[main]] (conf. 110) (exp: & t.s) (88-distribute-fields-5.c:27:3-27:11) [1] diff --git a/tests/regression/04-mutex/89-distribute-fields-6.t b/tests/regression/04-mutex/89-distribute-fields-6.t index 95af01540e..20533099de 100644 --- a/tests/regression/04-mutex/89-distribute-fields-6.t +++ b/tests/regression/04-mutex/89-distribute-fields-6.t @@ -19,6 +19,6 @@ < write with thread:[main, t_fun@89-distribute-fields-6.c:25:3-25:40] (conf. 110) (exp: & t) (89-distribute-fields-6.c:19:3-19:9) < write with [mhp:{created={[main, t_fun@89-distribute-fields-6.c:25:3-25:40]}}, thread:[main]] (conf. 110) (exp: & t) (89-distribute-fields-6.c:27:3-27:9) --- - > write with [mhp:{tid=[main, t_fun@89-distribute-fields-6.c:25:3-25:40#top]}, thread:[main, t_fun@89-distribute-fields-6.c:25:3-25:40#top]] (conf. 110) (exp: & t) (89-distribute-fields-6.c:19:3-19:9) - > write with [mhp:{tid=[main]; created={[main, t_fun@89-distribute-fields-6.c:25:3-25:40#top]}}, thread:[main]] (conf. 110) (exp: & t) (89-distribute-fields-6.c:27:3-27:9) + > write with [mhp:{tid=[main, t_fun@89-distribute-fields-6.c:25:3-25:40#⊤]}, thread:[main, t_fun@89-distribute-fields-6.c:25:3-25:40#⊤]] (conf. 110) (exp: & t) (89-distribute-fields-6.c:19:3-19:9) + > write with [mhp:{tid=[main]; created={[main, t_fun@89-distribute-fields-6.c:25:3-25:40#⊤]}}, thread:[main]] (conf. 110) (exp: & t) (89-distribute-fields-6.c:27:3-27:9) [1] diff --git a/tests/regression/04-mutex/90-distribute-fields-type-1.t b/tests/regression/04-mutex/90-distribute-fields-type-1.t index bbe3962366..1a5c739e9c 100644 --- a/tests/regression/04-mutex/90-distribute-fields-type-1.t +++ b/tests/regression/04-mutex/90-distribute-fields-type-1.t @@ -34,14 +34,14 @@ < write with thread:[main, t_fun@90-distribute-fields-type-1.c:37:3-37:40] (conf. 100) (exp: & tmp->field) (90-distribute-fields-type-1.c:31:3-31:20) < write with [mhp:{created={[main, t_fun@90-distribute-fields-type-1.c:37:3-37:40]}}, thread:[main]] (conf. 100) (exp: & tmp->s) (90-distribute-fields-type-1.c:39:3-39:17) --- - > write with [mhp:{tid=[main, t_fun@90-distribute-fields-type-1.c:37:3-37:40#top]}, thread:[main, t_fun@90-distribute-fields-type-1.c:37:3-37:40#top]] (conf. 100) (exp: & tmp->field) (90-distribute-fields-type-1.c:31:3-31:20) - > write with [mhp:{tid=[main]; created={[main, t_fun@90-distribute-fields-type-1.c:37:3-37:40#top]}}, thread:[main]] (conf. 100) (exp: & tmp->s) (90-distribute-fields-type-1.c:39:3-39:17) + > write with [mhp:{tid=[main, t_fun@90-distribute-fields-type-1.c:37:3-37:40#⊤]}, thread:[main, t_fun@90-distribute-fields-type-1.c:37:3-37:40#⊤]] (conf. 100) (exp: & tmp->field) (90-distribute-fields-type-1.c:31:3-31:20) + > write with [mhp:{tid=[main]; created={[main, t_fun@90-distribute-fields-type-1.c:37:3-37:40#⊤]}}, thread:[main]] (conf. 100) (exp: & tmp->s) (90-distribute-fields-type-1.c:39:3-39:17) 12c12 < write with thread:[main, t_fun@90-distribute-fields-type-1.c:37:3-37:40] (conf. 100) (exp: & tmp->field) (90-distribute-fields-type-1.c:31:3-31:20) --- - > write with [mhp:{tid=[main, t_fun@90-distribute-fields-type-1.c:37:3-37:40#top]}, thread:[main, t_fun@90-distribute-fields-type-1.c:37:3-37:40#top]] (conf. 100) (exp: & tmp->field) (90-distribute-fields-type-1.c:31:3-31:20) + > write with [mhp:{tid=[main, t_fun@90-distribute-fields-type-1.c:37:3-37:40#⊤]}, thread:[main, t_fun@90-distribute-fields-type-1.c:37:3-37:40#⊤]] (conf. 100) (exp: & tmp->field) (90-distribute-fields-type-1.c:31:3-31:20) 14c14 < write with [mhp:{created={[main, t_fun@90-distribute-fields-type-1.c:37:3-37:40]}}, thread:[main]] (conf. 100) (exp: & tmp->s) (90-distribute-fields-type-1.c:39:3-39:17) --- - > write with [mhp:{tid=[main]; created={[main, t_fun@90-distribute-fields-type-1.c:37:3-37:40#top]}}, thread:[main]] (conf. 100) (exp: & tmp->s) (90-distribute-fields-type-1.c:39:3-39:17) + > write with [mhp:{tid=[main]; created={[main, t_fun@90-distribute-fields-type-1.c:37:3-37:40#⊤]}}, thread:[main]] (conf. 100) (exp: & tmp->s) (90-distribute-fields-type-1.c:39:3-39:17) [1] diff --git a/tests/regression/04-mutex/91-distribute-fields-type-2.t b/tests/regression/04-mutex/91-distribute-fields-type-2.t index 80e6d9972e..e22b21d2bd 100644 --- a/tests/regression/04-mutex/91-distribute-fields-type-2.t +++ b/tests/regression/04-mutex/91-distribute-fields-type-2.t @@ -34,14 +34,14 @@ < write with thread:[main, t_fun@91-distribute-fields-type-2.c:38:3-38:40] (conf. 100) (exp: & *tmp) (91-distribute-fields-type-2.c:32:3-32:17) < write with [mhp:{created={[main, t_fun@91-distribute-fields-type-2.c:38:3-38:40]}}, thread:[main]] (conf. 100) (exp: & *tmp) (91-distribute-fields-type-2.c:40:3-40:17) --- - > write with [mhp:{tid=[main, t_fun@91-distribute-fields-type-2.c:38:3-38:40#top]}, thread:[main, t_fun@91-distribute-fields-type-2.c:38:3-38:40#top]] (conf. 100) (exp: & *tmp) (91-distribute-fields-type-2.c:32:3-32:17) - > write with [mhp:{tid=[main]; created={[main, t_fun@91-distribute-fields-type-2.c:38:3-38:40#top]}}, thread:[main]] (conf. 100) (exp: & *tmp) (91-distribute-fields-type-2.c:40:3-40:17) + > write with [mhp:{tid=[main, t_fun@91-distribute-fields-type-2.c:38:3-38:40#⊤]}, thread:[main, t_fun@91-distribute-fields-type-2.c:38:3-38:40#⊤]] (conf. 100) (exp: & *tmp) (91-distribute-fields-type-2.c:32:3-32:17) + > write with [mhp:{tid=[main]; created={[main, t_fun@91-distribute-fields-type-2.c:38:3-38:40#⊤]}}, thread:[main]] (conf. 100) (exp: & *tmp) (91-distribute-fields-type-2.c:40:3-40:17) 12c12 < write with thread:[main, t_fun@91-distribute-fields-type-2.c:38:3-38:40] (conf. 100) (exp: & *tmp) (91-distribute-fields-type-2.c:32:3-32:17) --- - > write with [mhp:{tid=[main, t_fun@91-distribute-fields-type-2.c:38:3-38:40#top]}, thread:[main, t_fun@91-distribute-fields-type-2.c:38:3-38:40#top]] (conf. 100) (exp: & *tmp) (91-distribute-fields-type-2.c:32:3-32:17) + > write with [mhp:{tid=[main, t_fun@91-distribute-fields-type-2.c:38:3-38:40#⊤]}, thread:[main, t_fun@91-distribute-fields-type-2.c:38:3-38:40#⊤]] (conf. 100) (exp: & *tmp) (91-distribute-fields-type-2.c:32:3-32:17) 14c14 < write with [mhp:{created={[main, t_fun@91-distribute-fields-type-2.c:38:3-38:40]}}, thread:[main]] (conf. 100) (exp: & *tmp) (91-distribute-fields-type-2.c:40:3-40:17) --- - > write with [mhp:{tid=[main]; created={[main, t_fun@91-distribute-fields-type-2.c:38:3-38:40#top]}}, thread:[main]] (conf. 100) (exp: & *tmp) (91-distribute-fields-type-2.c:40:3-40:17) + > write with [mhp:{tid=[main]; created={[main, t_fun@91-distribute-fields-type-2.c:38:3-38:40#⊤]}}, thread:[main]] (conf. 100) (exp: & *tmp) (91-distribute-fields-type-2.c:40:3-40:17) [1] diff --git a/tests/regression/04-mutex/92-distribute-fields-type-deep.t b/tests/regression/04-mutex/92-distribute-fields-type-deep.t index f06f5d5480..d754ded21b 100644 --- a/tests/regression/04-mutex/92-distribute-fields-type-deep.t +++ b/tests/regression/04-mutex/92-distribute-fields-type-deep.t @@ -34,14 +34,14 @@ < write with thread:[main, t_fun@92-distribute-fields-type-deep.c:42:3-42:40] (conf. 100) (exp: & tmp->field) (92-distribute-fields-type-deep.c:36:3-36:20) < write with [mhp:{created={[main, t_fun@92-distribute-fields-type-deep.c:42:3-42:40]}}, thread:[main]] (conf. 100) (exp: & tmp->t) (92-distribute-fields-type-deep.c:44:3-44:17) --- - > write with [mhp:{tid=[main, t_fun@92-distribute-fields-type-deep.c:42:3-42:40#top]}, thread:[main, t_fun@92-distribute-fields-type-deep.c:42:3-42:40#top]] (conf. 100) (exp: & tmp->field) (92-distribute-fields-type-deep.c:36:3-36:20) - > write with [mhp:{tid=[main]; created={[main, t_fun@92-distribute-fields-type-deep.c:42:3-42:40#top]}}, thread:[main]] (conf. 100) (exp: & tmp->t) (92-distribute-fields-type-deep.c:44:3-44:17) + > write with [mhp:{tid=[main, t_fun@92-distribute-fields-type-deep.c:42:3-42:40#⊤]}, thread:[main, t_fun@92-distribute-fields-type-deep.c:42:3-42:40#⊤]] (conf. 100) (exp: & tmp->field) (92-distribute-fields-type-deep.c:36:3-36:20) + > write with [mhp:{tid=[main]; created={[main, t_fun@92-distribute-fields-type-deep.c:42:3-42:40#⊤]}}, thread:[main]] (conf. 100) (exp: & tmp->t) (92-distribute-fields-type-deep.c:44:3-44:17) 12c12 < write with thread:[main, t_fun@92-distribute-fields-type-deep.c:42:3-42:40] (conf. 100) (exp: & tmp->field) (92-distribute-fields-type-deep.c:36:3-36:20) --- - > write with [mhp:{tid=[main, t_fun@92-distribute-fields-type-deep.c:42:3-42:40#top]}, thread:[main, t_fun@92-distribute-fields-type-deep.c:42:3-42:40#top]] (conf. 100) (exp: & tmp->field) (92-distribute-fields-type-deep.c:36:3-36:20) + > write with [mhp:{tid=[main, t_fun@92-distribute-fields-type-deep.c:42:3-42:40#⊤]}, thread:[main, t_fun@92-distribute-fields-type-deep.c:42:3-42:40#⊤]] (conf. 100) (exp: & tmp->field) (92-distribute-fields-type-deep.c:36:3-36:20) 14c14 < write with [mhp:{created={[main, t_fun@92-distribute-fields-type-deep.c:42:3-42:40]}}, thread:[main]] (conf. 100) (exp: & tmp->t) (92-distribute-fields-type-deep.c:44:3-44:17) --- - > write with [mhp:{tid=[main]; created={[main, t_fun@92-distribute-fields-type-deep.c:42:3-42:40#top]}}, thread:[main]] (conf. 100) (exp: & tmp->t) (92-distribute-fields-type-deep.c:44:3-44:17) + > write with [mhp:{tid=[main]; created={[main, t_fun@92-distribute-fields-type-deep.c:42:3-42:40#⊤]}}, thread:[main]] (conf. 100) (exp: & tmp->t) (92-distribute-fields-type-deep.c:44:3-44:17) [1] diff --git a/tests/regression/04-mutex/93-distribute-fields-type-global.t b/tests/regression/04-mutex/93-distribute-fields-type-global.t index d7b302f03a..7e0dc61a3c 100644 --- a/tests/regression/04-mutex/93-distribute-fields-type-global.t +++ b/tests/regression/04-mutex/93-distribute-fields-type-global.t @@ -30,14 +30,14 @@ < read with thread:[main, t_fun@93-distribute-fields-type-global.c:20:3-20:40] (conf. 100) (exp: & tmp->field) (93-distribute-fields-type-global.c:13:3-13:29) < write with [mhp:{created={[main, t_fun@93-distribute-fields-type-global.c:20:3-20:40]}}, thread:[main]] (conf. 110) (exp: & s) (93-distribute-fields-type-global.c:22:3-22:9) --- - > read with [mhp:{tid=[main, t_fun@93-distribute-fields-type-global.c:20:3-20:40#top]}, thread:[main, t_fun@93-distribute-fields-type-global.c:20:3-20:40#top]] (conf. 100) (exp: & tmp->field) (93-distribute-fields-type-global.c:13:3-13:29) - > write with [mhp:{tid=[main]; created={[main, t_fun@93-distribute-fields-type-global.c:20:3-20:40#top]}}, thread:[main]] (conf. 110) (exp: & s) (93-distribute-fields-type-global.c:22:3-22:9) + > read with [mhp:{tid=[main, t_fun@93-distribute-fields-type-global.c:20:3-20:40#⊤]}, thread:[main, t_fun@93-distribute-fields-type-global.c:20:3-20:40#⊤]] (conf. 100) (exp: & tmp->field) (93-distribute-fields-type-global.c:13:3-13:29) + > write with [mhp:{tid=[main]; created={[main, t_fun@93-distribute-fields-type-global.c:20:3-20:40#⊤]}}, thread:[main]] (conf. 110) (exp: & s) (93-distribute-fields-type-global.c:22:3-22:9) 11c11 < read with thread:[main, t_fun@93-distribute-fields-type-global.c:20:3-20:40] (conf. 100) (exp: & tmp->field) (93-distribute-fields-type-global.c:13:3-13:29) --- - > read with [mhp:{tid=[main, t_fun@93-distribute-fields-type-global.c:20:3-20:40#top]}, thread:[main, t_fun@93-distribute-fields-type-global.c:20:3-20:40#top]] (conf. 100) (exp: & tmp->field) (93-distribute-fields-type-global.c:13:3-13:29) + > read with [mhp:{tid=[main, t_fun@93-distribute-fields-type-global.c:20:3-20:40#⊤]}, thread:[main, t_fun@93-distribute-fields-type-global.c:20:3-20:40#⊤]] (conf. 100) (exp: & tmp->field) (93-distribute-fields-type-global.c:13:3-13:29) 13c13 < write with [mhp:{created={[main, t_fun@93-distribute-fields-type-global.c:20:3-20:40]}}, thread:[main]] (conf. 110) (exp: & s) (93-distribute-fields-type-global.c:22:3-22:9) --- - > write with [mhp:{tid=[main]; created={[main, t_fun@93-distribute-fields-type-global.c:20:3-20:40#top]}}, thread:[main]] (conf. 110) (exp: & s) (93-distribute-fields-type-global.c:22:3-22:9) + > write with [mhp:{tid=[main]; created={[main, t_fun@93-distribute-fields-type-global.c:20:3-20:40#⊤]}}, thread:[main]] (conf. 110) (exp: & s) (93-distribute-fields-type-global.c:22:3-22:9) [1] diff --git a/tests/regression/06-symbeq/14-list_entry_rc.t b/tests/regression/06-symbeq/14-list_entry_rc.t index 2f7704fd22..0e5ec3ce9f 100644 --- a/tests/regression/06-symbeq/14-list_entry_rc.t +++ b/tests/regression/06-symbeq/14-list_entry_rc.t @@ -31,8 +31,8 @@ < read with [mhp:{created={[main, t_fun@14-list_entry_rc.c:45:3-45:40]}}, thread:[main]] (conf. 110) (exp: & s->datum) (14-list_entry_rc.c:27:3-27:13) --- > [Warning][Race] Memory location (alloc@sid:$SID@tid:[main](#top))[?].datum (race with conf. 110): (14-list_entry_rc.c:41:3-41:35) - > write with [mhp:{tid=[main, t_fun@14-list_entry_rc.c:45:3-45:40#top]}, thread:[main, t_fun@14-list_entry_rc.c:45:3-45:40#top]] (conf. 110) (exp: & s->datum) (14-list_entry_rc.c:27:3-27:13) - > write with [mhp:{tid=[main]; created={[main, t_fun@14-list_entry_rc.c:45:3-45:40#top]}}, thread:[main]] (conf. 110) (exp: & s->datum) (14-list_entry_rc.c:27:3-27:13) - > read with [mhp:{tid=[main, t_fun@14-list_entry_rc.c:45:3-45:40#top]}, thread:[main, t_fun@14-list_entry_rc.c:45:3-45:40#top]] (conf. 110) (exp: & s->datum) (14-list_entry_rc.c:27:3-27:13) - > read with [mhp:{tid=[main]; created={[main, t_fun@14-list_entry_rc.c:45:3-45:40#top]}}, thread:[main]] (conf. 110) (exp: & s->datum) (14-list_entry_rc.c:27:3-27:13) + > write with [mhp:{tid=[main, t_fun@14-list_entry_rc.c:45:3-45:40#⊤]}, thread:[main, t_fun@14-list_entry_rc.c:45:3-45:40#⊤]] (conf. 110) (exp: & s->datum) (14-list_entry_rc.c:27:3-27:13) + > write with [mhp:{tid=[main]; created={[main, t_fun@14-list_entry_rc.c:45:3-45:40#⊤]}}, thread:[main]] (conf. 110) (exp: & s->datum) (14-list_entry_rc.c:27:3-27:13) + > read with [mhp:{tid=[main, t_fun@14-list_entry_rc.c:45:3-45:40#⊤]}, thread:[main, t_fun@14-list_entry_rc.c:45:3-45:40#⊤]] (conf. 110) (exp: & s->datum) (14-list_entry_rc.c:27:3-27:13) + > read with [mhp:{tid=[main]; created={[main, t_fun@14-list_entry_rc.c:45:3-45:40#⊤]}}, thread:[main]] (conf. 110) (exp: & s->datum) (14-list_entry_rc.c:27:3-27:13) [1] diff --git a/tests/regression/06-symbeq/16-type_rc.t b/tests/regression/06-symbeq/16-type_rc.t index d28d45ccca..a5f977008d 100644 --- a/tests/regression/06-symbeq/16-type_rc.t +++ b/tests/regression/06-symbeq/16-type_rc.t @@ -30,8 +30,8 @@ Disable info messages because race summary contains (safe) memory location count < write with thread:[main, t_fun@16-type_rc.c:35:3-35:37] (conf. 100) (exp: & s->datum) (16-type_rc.c:21:3-21:15) < write with [mhp:{created={[main, t_fun@16-type_rc.c:35:3-35:37]}}, thread:[main]] (conf. 100) (exp: & *d) (16-type_rc.c:36:3-36:9) --- - > write with [mhp:{tid=[main, t_fun@16-type_rc.c:35:3-35:37#top]}, thread:[main, t_fun@16-type_rc.c:35:3-35:37#top]] (conf. 100) (exp: & s->datum) (16-type_rc.c:21:3-21:15) - > write with [mhp:{tid=[main]; created={[main, t_fun@16-type_rc.c:35:3-35:37#top]}}, thread:[main]] (conf. 100) (exp: & *d) (16-type_rc.c:36:3-36:9) + > write with [mhp:{tid=[main, t_fun@16-type_rc.c:35:3-35:37#⊤]}, thread:[main, t_fun@16-type_rc.c:35:3-35:37#⊤]] (conf. 100) (exp: & s->datum) (16-type_rc.c:21:3-21:15) + > write with [mhp:{tid=[main]; created={[main, t_fun@16-type_rc.c:35:3-35:37#⊤]}}, thread:[main]] (conf. 100) (exp: & *d) (16-type_rc.c:36:3-36:9) [1] $ goblint --enable warn.deterministic --disable warn.info --disable ana.race.direct-arithmetic --set ana.activated[+] "'var_eq'" --set ana.activated[+] "'symb_locks'" --enable allglobs --enable dbg.full-output 16-type_rc.c > full-output-2.txt 2>&1 @@ -40,5 +40,5 @@ Disable info messages because race summary contains (safe) memory location count 6c6 < write with thread:[main, t_fun@16-type_rc.c:35:3-35:37] (conf. 100) (exp: & s->datum) (16-type_rc.c:21:3-21:15) --- - > write with [mhp:{tid=[main, t_fun@16-type_rc.c:35:3-35:37#top]}, thread:[main, t_fun@16-type_rc.c:35:3-35:37#top]] (conf. 100) (exp: & s->datum) (16-type_rc.c:21:3-21:15) + > write with [mhp:{tid=[main, t_fun@16-type_rc.c:35:3-35:37#⊤]}, thread:[main, t_fun@16-type_rc.c:35:3-35:37#⊤]] (conf. 100) (exp: & s->datum) (16-type_rc.c:21:3-21:15) [1] diff --git a/tests/regression/06-symbeq/21-mult_accs_rc.t b/tests/regression/06-symbeq/21-mult_accs_rc.t index 376b79ae88..90f0661f67 100644 --- a/tests/regression/06-symbeq/21-mult_accs_rc.t +++ b/tests/regression/06-symbeq/21-mult_accs_rc.t @@ -40,8 +40,8 @@ Disable info messages because race summary contains (safe) memory location count < write with thread:[main, t_fun@21-mult_accs_rc.c:31:3-31:37] (conf. 100) (exp: & s->data) (21-mult_accs_rc.c:16:3-16:14) < write with [symblock:{p-lock:*.mutex}, mhp:{created={[main, t_fun@21-mult_accs_rc.c:31:3-31:37]}}, thread:[main]] (conf. 100) (exp: & *d) (21-mult_accs_rc.c:34:3-34:9) --- - > write with [mhp:{tid=[main, t_fun@21-mult_accs_rc.c:31:3-31:37#top]}, thread:[main, t_fun@21-mult_accs_rc.c:31:3-31:37#top]] (conf. 100) (exp: & s->data) (21-mult_accs_rc.c:16:3-16:14) - > write with [symblock:{p-lock:*.mutex}, mhp:{tid=[main]; created={[main, t_fun@21-mult_accs_rc.c:31:3-31:37#top]}}, thread:[main]] (conf. 100) (exp: & *d) (21-mult_accs_rc.c:34:3-34:9) + > write with [mhp:{tid=[main, t_fun@21-mult_accs_rc.c:31:3-31:37#⊤]}, thread:[main, t_fun@21-mult_accs_rc.c:31:3-31:37#⊤]] (conf. 100) (exp: & s->data) (21-mult_accs_rc.c:16:3-16:14) + > write with [symblock:{p-lock:*.mutex}, mhp:{tid=[main]; created={[main, t_fun@21-mult_accs_rc.c:31:3-31:37#⊤]}}, thread:[main]] (conf. 100) (exp: & *d) (21-mult_accs_rc.c:34:3-34:9) [1] $ goblint --enable warn.deterministic --disable warn.info --disable ana.race.direct-arithmetic --set ana.activated[+] "'var_eq'" --set ana.activated[+] "'symb_locks'" --enable allglobs --enable dbg.full-output 21-mult_accs_rc.c > full-output-2.txt 2>&1 @@ -50,5 +50,5 @@ Disable info messages because race summary contains (safe) memory location count 8c8 < write with thread:[main, t_fun@21-mult_accs_rc.c:31:3-31:37] (conf. 100) (exp: & s->data) (21-mult_accs_rc.c:16:3-16:14) --- - > write with [mhp:{tid=[main, t_fun@21-mult_accs_rc.c:31:3-31:37#top]}, thread:[main, t_fun@21-mult_accs_rc.c:31:3-31:37#top]] (conf. 100) (exp: & s->data) (21-mult_accs_rc.c:16:3-16:14) + > write with [mhp:{tid=[main, t_fun@21-mult_accs_rc.c:31:3-31:37#⊤]}, thread:[main, t_fun@21-mult_accs_rc.c:31:3-31:37#⊤]] (conf. 100) (exp: & s->data) (21-mult_accs_rc.c:16:3-16:14) [1] From 24b666442d29123848a4626f489147e5f6c4f629 Mon Sep 17 00:00:00 2001 From: Karoliine Holter <44437975+karoliineh@users.noreply.github.com> Date: Wed, 14 Feb 2024 13:38:58 +0200 Subject: [PATCH 35/35] Update dbg.full-output description in options.schema.json Co-authored-by: Simmo Saan --- src/config/options.schema.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/config/options.schema.json b/src/config/options.schema.json index dee334d5c8..16db177bf0 100644 --- a/src/config/options.schema.json +++ b/src/config/options.schema.json @@ -2040,7 +2040,7 @@ }, "full-output": { "title": "dbg.full-output", - "description": "Should the analysis print full output?", + "description": "Output abstract values, etc. with full internal details, without readability-oriented simplifications.", "type": "boolean", "default": false }