Skip to content

Commit

Permalink
Merge pull request #1510 from goblint/mutexType-default
Browse files Browse the repository at this point in the history
Enable `pthreadMutexType` analysis by default
  • Loading branch information
sim642 authored Jun 25, 2024
2 parents ad1ed06 + ecda3f7 commit 52af9cd
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 7 deletions.
2 changes: 2 additions & 0 deletions conf/examples/medium-program.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"base",
"threadid",
"threadflag",
"threadreturn",
"mallocWrapper",
"mutexEvents",
"mutex",
Expand All @@ -18,6 +19,7 @@
"expRelation",
"mhp",
"assert",
"pthreadMutexType",
"var_eq",
"symb_locks",
"region",
Expand Down
2 changes: 2 additions & 0 deletions conf/examples/very-precise.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"base",
"threadid",
"threadflag",
"threadreturn",
"mallocWrapper",
"mutexEvents",
"mutex",
Expand All @@ -31,6 +32,7 @@
"expRelation",
"mhp",
"assert",
"pthreadMutexType",
"var_eq",
"symb_locks",
"region",
Expand Down
11 changes: 6 additions & 5 deletions src/analyses/mutexTypeAnalysis.ml
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,17 @@ struct

let name () = "pthreadMutexType"

(* Removing indexes here avoids complicated lookups and allows to have the LVals as vars here, at the price that different types of mutexes in arrays are not dinstinguished *)
module O = Offset.Unit

module V = struct
include Printable.Prod(CilType.Varinfo)(O) (* TODO: use Mval.Unit *)
module V =
struct
(* Removing indexes here avoids complicated lookups and allows to have the LVals as vars here, at the price that different types of mutexes in arrays are not dinstinguished *)
include Mval.Unit
let is_write_only _ = false
end

module G = MAttr

module O = Offset.Unit

(* transfer functions *)
let assign ctx (lval:lval) (rval:exp) : D.t =
match lval with
Expand Down
2 changes: 1 addition & 1 deletion src/autoTune.ml
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ let enableAnalyses anas =
(*escape is also still enabled, because otherwise we get a warning*)
(*does not consider dynamic calls!*)

let notNeccessaryThreadAnalyses = ["race"; "deadlock"; "maylocks"; "symb_locks"; "thread"; "threadid"; "threadJoins"; "threadreturn"; "mhp"; "region"]
let notNeccessaryThreadAnalyses = ["race"; "deadlock"; "maylocks"; "symb_locks"; "thread"; "threadid"; "threadJoins"; "threadreturn"; "mhp"; "region"; "pthreadMutexType"]
let reduceThreadAnalyses () =
let isThreadCreate = function
| LibraryDesc.ThreadCreate _ -> true
Expand Down
2 changes: 1 addition & 1 deletion src/config/options.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@
"default": [
"expRelation", "base", "threadid", "threadflag", "threadreturn",
"escape", "mutexEvents", "mutex", "access", "race", "mallocWrapper", "mhp",
"assert"
"assert", "pthreadMutexType"
]
},
"path_sens": {
Expand Down

0 comments on commit 52af9cd

Please sign in to comment.