./run_relay.sh /mnt/goblint-svcomp/goblint-bench/bench/concrat/race-challenges/per-thread-array-join-counter-race-2.i


--------------------------------------------------------------------------------


duppy -c per-thread-array-join-counter-race-2.c
duppy'ing per-thread-array-join-counter-race-2.c to /mnt/goblint-svcomp/benchexec/tools-pldi/relay-sv/tmp.YUSDR5WvY1/ciltrees
gcc -D_GNUCC -E -DCIL=1 per-thread-array-join-counter-race-2.c -o /tmp/cil-9JbboxpO.i
../cil/obj/x86_LINUX/cilly.asm.exe --out /tmp/cil-J2c8dr6t.cil.c --doheapify_sep --heapify_locals --dotrans_alloc --domyptranal --dodumpfile /tmp/cil-9JbboxpO.i
Making cfg for assume_abort_if_not
Making cfg for thread
Making cfg for cleaner
Making cfg for main
Trans_alloc: void  <> pthread_t 
Trans_alloc: void  <> _Bool 
Trans_alloc: void  <> pthread_mutex_t 
Trans_alloc: main per-thread-array-join-counter-race-2.c:1049
gcc -D_GNUCC -E /tmp/cil-J2c8dr6t.cil.c -o /tmp/cil-Sql4dMTD.cil.i
gcc -D_GNUCC -c -o ./per-thread-array-join-counter-race-2.o /tmp/cil-Sql4dMTD.cil.i
per-thread-array-join-counter-race-2.c:424:43: warning: conflicting types for built-in function ‘malloc’; expected ‘void *(long unsigned int)’ [-Wbuiltin-declaration-mismatch]
  424 | extern void *malloc (size_t __size) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__))
      |                                           ^~~~~~
per-thread-array-join-counter-race-2.c:1:1: note: ‘malloc’ is declared in header ‘<stdlib.h>’
  +++ |+#include <stdlib.h>
    1 | typedef unsigned int size_t;
per-thread-array-join-counter-race-2.c:426:43: warning: conflicting types for built-in function ‘calloc’; expected ‘void *(long unsigned int,  long unsigned int)’ [-Wbuiltin-declaration-mismatch]
  426 | extern void *calloc (size_t __nmemb, size_t __size)
      |                                           ^~~~~~
per-thread-array-join-counter-race-2.c:1:1: note: ‘calloc’ is declared in header ‘<stdlib.h>’
  +++ |+#include <stdlib.h>
    1 | typedef unsigned int size_t;
per-thread-array-join-counter-race-2.c: In function ‘thread’:
per-thread-array-join-counter-race-2.c:1023:7: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
 1023 |   int i = (int)arg;
      |       ^
per-thread-array-join-counter-race-2.c: In function ‘main’:
per-thread-array-join-counter-race-2.c:1061:51: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
 1061 |     pthread_mutex_lock(&threads_alive_mutex);
      |                                                   ^
per-thread-array-join-counter-race-2.c:1071:3: warning: ‘free’ called on unallocated object ‘_a1049_48436_per_1’ [-Wfree-nonheap-object]
 1071 |   return data;
      |   ^~~~~~~~~~~~                 
per-thread-array-join-counter-race-2.c:1049:11: note: declared here
 1049 | int main() {
      |           ^~                
Generating stats for steens
DONE!
Generating stats for cil
DONE!
Generating stats for anders
DONE!
Generating stats for noalias
DONE!
Dumped in 5 seconds
Mon Nov 13 09:57:33 UTC 2023
WARNING: tempfile is deprecated; consider using mktemp instead.
reserved status file: /tmp//temp.statusLJqrIi
running analysis on ./tmp.YUSDR5WvY1/ciltrees
Registered summary type: rs_scc
Registered summary type: rs
Registered summary type: ss
Registered summary type: rad_ss
Args: 
 ./race_anal.exe -cg ./tmp.YUSDR5WvY1/ciltrees -r -u benchexec -st /tmp//temp.statusLJqrIi -su client.cfg
Checking for data races
-----
Loading Cil Varinfo ID ranges for lookup tables
Loading ranges from .vids_ckeys_fixed
Setting Cil Varinfo ID ranges
Finished parsing config group: SUMMARY_DB
Finished parsing config group: REQUEST
Finished parsing config group: DISTRIBUTED
Finished parsing config group: FILE_SERVER
Finished parsing config group: LOCK_FUNCS
Finished parsing config group: THREAD_FUNCS
Finished parsing config group: EXIT_FUNCS
Finished parsing config group: BUILTIN_FUNCS
Finished parsing config group: ALIAS_ANALYSIS
Finished parsing config group: ENTRY_POINTS
Finished parsing config group: SYM_EX
Done reading config file
myIP: 127.0.0.1
using /tmp/relay_scratch to store acquired files
using: /tmp//temp.statusLJqrIi to track status
Initializing Steensgaard AA info
Loading function info
Loading tempVar info
Using old PTA results
Old PTA results loaded
Initializing Andersen's AA info
Using old PTA results: ./tmp.YUSDR5WvY1/ciltrees/.pta_results.anders
Old PTA results loaded
Reached end of ./tmp.YUSDR5WvY1/ciltrees/calls.anders call graph file
Num funcs: 14
Scc_cg: Pruned 10 funcs w/out bodies for scc DAG
summary database will use:
	./tmp.YUSDR5WvY1/ciltrees/relay_sums
Initializing summary rad_ss
Checking leftover state: rad_ss
[Er]: Checkpoint: No left-over status file
Initializing summary ss
Checking leftover state: ss
[Er]: Checkpoint: No left-over status file
Initializing summary rs
BS: Not doing any post-reboot cleanup
[Er]: Multiple lock summaries for pthread_mutex_unlock:9.f
[Er]: makeSimpleLock: Couldn't find global kernel_sem
[Er]: makeSimpleLock: Couldn't find global kernel_flag
[Er]: Multiple lock summaries for pthread_mutex_lock:8.f
Initializing summary rs_scc
BS: Not doing any post-reboot cleanup
SH: initEscapeable found (1, 2) thread (acts, formals)

Entry points use roots: true
file server will use: 14440
[Er]: Request fault handler with Connection refused
[Er]: Request retrying
[Er]: retry succeeded!

trying to clear old summaries / local srcs, etc.
Starting bottomup analysis
-----
[Er]: Checkpoint: No left-over status file
getting next SCC from server
Acquiring needed summaries
=================================
Starting an SCC (1) #0
=================================
Summarizing function: cleaner : per-thread-array-join-counter-race-2.c
-----
doing symstate
Prev ldiffCache hits: 0	misses: 0

Prev GAPostCache hits: 0	misses: 0

doing lockset
doing guarded access
=================================
Finished an SCC (1)
=================================
Summary for function: cleaner:27.f
=======

SUMS (nm, lo, un, wr, re):	cleaner	1	0	2	5	

SS Sum:
 |-> Vval: 0
SIZES: 27.f : 91
>>> PROGRESS 1/4 SCCs DONE!

=================================
getting next SCC from server
Acquiring needed summaries
=================================
Starting an SCC (1) #1
=================================
Summarizing function: thread : per-thread-array-join-counter-race-2.c
-----
doing symstate
Prev ldiffCache hits: 0	misses: 6

Prev GAPostCache hits: 0	misses: 0

doing lockset
doing guarded access
=================================
Finished an SCC (1)
=================================
Summary for function: thread:24.f
=======

SUMS (nm, lo, un, wr, re):	thread	0	0	2	1	

SS Sum:
 |-> Vval: 0
SIZES: 24.f : 34
>>> PROGRESS 2/4 SCCs DONE!

=================================
getting next SCC from server
Acquiring needed summaries
=================================
Starting an SCC (1) #3
=================================
Summarizing function: assume_abort_if_not : per-thread-array-join-counter-race-2.c
-----
doing symstate
Prev ldiffCache hits: 0	misses: 5

Prev GAPostCache hits: 0	misses: 0

doing lockset
doing guarded access
=================================
Finished an SCC (1)
=================================
Summary for function: assume_abort_if_not:12.f
=======

SUMS (nm, lo, un, wr, re):	assume_abort_if_not	0	0	0	0	

SS Sum:
 |-> $SSBOT
SIZES: 12.f : 34
>>> PROGRESS 3/4 SCCs DONE!

=================================
getting next SCC from server
Acquiring needed summaries
=================================
Starting an SCC (1) #2
=================================
Summarizing function: main : per-thread-array-join-counter-race-2.c
-----
doing symstate
Prev ldiffCache hits: 0	misses: 1

Prev GAPostCache hits: 0	misses: 0

doing lockset
doing guarded access
=================================
Finished an SCC (1)
=================================
Summary for function: main:34.f
=======

SUMS (nm, lo, un, wr, re):	main	0	0	5	5	

SS Sum:
 |-> $SSTOP
SIZES: 34.f : 34
>>> PROGRESS 4/4 SCCs DONE!

=================================
getting next SCC from server
Bottomup analysis complete
-----



Beginning Thread Analysis:
-----
[Er]: No entry-points file!
Expected # thread-creation site pairs: 3
checking a thread-creation pair
Prev ldiffCache hits: 8	misses: 5

doing symstate
Prev ldiffCache hits: 8	misses: 4

doing symstate
now checking thread roots: thread(24.f), thread(24.f)
now checking thread roots: thread(27.f), cleaner(27.f)
now checking thread roots: cleaner(24.f), thread(24.f)
now checking thread roots: cleaner(27.f), cleaner(27.f)
done with pair, sending notification
checking a thread-creation pair
Prev ldiffCache hits: 8	misses: 4

doing symstate
now checking thread roots: thread(34.f), main(34.f)
New race added to race reports
New race added to race reports
New race added to race reports
now checking thread roots: cleaner(34.f), main(34.f)
New race added to race reports
New race added to race reports
New race added to race reports
done with pair, sending notification
checking a thread-creation pair
now checking thread roots: main(34.f), main(34.f)
done with pair, sending notification
completed all thread pairs
Sorting races

Printing races

****
Possible race between access to:

flags_mutex @ per-thread-array-join-counter-race-2.c:1019 and
flags_mutex @ per-thread-array-join-counter-race-2.c:1019
	Cluster ID: 2
	Escapes? true / true 
	Accessed at locs:
	[per-thread-array-join-counter-race-2.c:1029:(24.f)] and
	[per-thread-array-join-counter-race-2.c:1054:(34.f)]

	Confidence: Syntactic

LS for 1st access:
L+ = {[REP: 9]#g} (1)
	(rep. lock)
LS for 2nd access:
L+ = empty;
	Th. 1 spawned: per-thread-array-join-counter-race-2.c:1060 48937 w/ func: thread
	Th. 2 spawned: #entry_point:0 0 w/ func: main

Different possible paths & LS (first 4):

****
Possible race between access to:

flags_mutex @ per-thread-array-join-counter-race-2.c:1019 and
flags_mutex @ per-thread-array-join-counter-race-2.c:1019
	Cluster ID: 5
	Escapes? true / true 
	Accessed at locs:
	[per-thread-array-join-counter-race-2.c:1044:(27.f)] and
	[per-thread-array-join-counter-race-2.c:1054:(34.f)]

	Confidence: Syntactic

LS for 1st access:
L+ = {[REP: 9]#g} (1)
	(rep. lock)
LS for 2nd access:
L+ = empty;
	Th. 1 spawned: per-thread-array-join-counter-race-2.c:1058 48823 w/ func: cleaner
	Th. 2 spawned: #entry_point:0 0 w/ func: main

Different possible paths & LS (first 4):

****
Possible race between access to:

threads_total @ per-thread-array-join-counter-race-2.c:1013 and
threads_total @ per-thread-array-join-counter-race-2.c:1013
	Cluster ID: 3
	Escapes? true / true 
	Accessed at locs:
	[per-thread-array-join-counter-race-2.c:1034:(27.f)] and
	[per-thread-array-join-counter-race-2.c:1050:(34.f)]

	Confidence: Syntactic

LS for 1st access:
L+ = empty;
LS for 2nd access:
L+ = empty;
	Th. 1 spawned: per-thread-array-join-counter-race-2.c:1058 48823 w/ func: cleaner
	Th. 2 spawned: #entry_point:0 0 w/ func: main

Different possible paths & LS (first 4):

****
Possible race between access to:

flags_mutex @ per-thread-array-join-counter-race-2.c:1019 and
flags_mutex @ per-thread-array-join-counter-race-2.c:1019
	Cluster ID: 1
	Escapes? true / true 
	Accessed at locs:
	[per-thread-array-join-counter-race-2.c:1027:(24.f)] and
	[per-thread-array-join-counter-race-2.c:1054:(34.f)]

	Confidence: Syntactic

LS for 1st access:
L+ = empty;
LS for 2nd access:
L+ = empty;
	Th. 1 spawned: per-thread-array-join-counter-race-2.c:1060 48937 w/ func: thread
	Th. 2 spawned: #entry_point:0 0 w/ func: main

Different possible paths & LS (first 4):

****
Possible race between access to:

flags_mutex @ per-thread-array-join-counter-race-2.c:1019 and
flags_mutex @ per-thread-array-join-counter-race-2.c:1019
	Cluster ID: 4
	Escapes? true / true 
	Accessed at locs:
	[per-thread-array-join-counter-race-2.c:1035:(27.f)] and
	[per-thread-array-join-counter-race-2.c:1054:(34.f)]

	Confidence: Syntactic

LS for 1st access:
L+ = empty;
LS for 2nd access:
L+ = empty;
	Th. 1 spawned: per-thread-array-join-counter-race-2.c:1058 48823 w/ func: cleaner
	Th. 2 spawned: #entry_point:0 0 w/ func: main

Different possible paths & LS (first 4):

****
Possible race between access to:

data @ per-thread-array-join-counter-race-2.c:1020 and
data @ per-thread-array-join-counter-race-2.c:1020
	Cluster ID: 0
	Escapes? true / true 
	Accessed at locs:
	[per-thread-array-join-counter-race-2.c:1025:(24.f)] and
	[per-thread-array-join-counter-race-2.c:1071:(34.f)]

	Confidence: Syntactic

LS for 1st access:
L+ = {data_mutex#g:23} (1)
LS for 2nd access:
L+ = empty;
	Th. 1 spawned: per-thread-array-join-counter-race-2.c:1060 48937 w/ func: thread
	Th. 2 spawned: #entry_point:0 0 w/ func: main

Different possible paths & LS (first 4):



$$$$$$
Total Warnings: 6


Printing Alias assumptions used by warnings
-----


writeState: writing new state for Andersen to ./tmp.YUSDR5WvY1/ciltrees/.pta_temp.anders

writeState: Not needed for Steens PTA
Elapsed time (secs): 0.023847
Top heap size (MB): 0
Current heap size (MB): 0
Lifetime allocated bytes (MB): 5
Collections -- minor: 11 major: 2 compactions: 0
Bytes per word: 8
Exhausted tries: 1
return value is 0
ran 1 times
cleared status file: /tmp//temp.statusLJqrIi
Mon Nov 13 09:57:36 UTC 2023
server.exe: no process found
