Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suppress thread-unsafe library function calls in single-threaded mode #1260

Closed
sim642 opened this issue Nov 21, 2023 · 0 comments · Fixed by #1307
Closed

Suppress thread-unsafe library function calls in single-threaded mode #1260

sim642 opened this issue Nov 21, 2023 · 0 comments · Fixed by #1307

Comments

@sim642
Copy link
Member

sim642 commented Nov 21, 2023

We don't record accesses in single-threaded mode for race detection at all (they don't even show with allglobs) to avoid overhead on single-threaded programs. However, thread-unsafe library function calls do get recorded in single-threaded mode, but there's no need to do that either.

#include <stdlib.h>

int main() {
  rand();
  return 0;
}
$ ./goblint bar.c --enable allglobs 
[Info][Deadcode] Logical lines of code (LLoC) summary:
  live: 3
  dead: 0
  total lines: 3
[Success][Race] Memory location rand (safe): (/usr/include/stdlib.h:454:12-454:24)
  call with [mhp:{tid=[main]}, multi:false, thread:[main]] (conf. 110)  (exp: rand) (bar.c:4:3-4:9)
[Info][Race] Memory locations race summary:
  safe: 1
  vulnerable: 0
  unsafe: 0
  total memory locations: 1

There should be no race summary printed for this program at all.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants