hg02_deadlock.vgtest hg02_deadlock.stdout.exp hg02_deadlock.stderr.exp \
hg03_inherit.vgtest hg03_inherit.stdout.exp hg03_inherit.stderr.exp \
hg04_race.vgtest hg04_race.stdout.exp hg04_race.stderr.exp \
+ hg04_race_h9.vgtest hg04_race_h9.stdout.exp hg04_race_h9.stderr.exp \
hg05_race2.vgtest hg05_race2.stdout.exp hg05_race2.stderr.exp \
hg06_readshared.vgtest hg06_readshared.stdout.exp \
hg06_readshared.stderr.exp \
static int shared;
+__attribute__((noinline))
+static void th10(void)
+{
+ shared++;
+}
+
+__attribute__((noinline))
+static void th9(void)
+{
+ th10();
+}
+
+__attribute__((noinline))
+static void th8(void)
+{
+ th9();
+}
+
+__attribute__((noinline))
+static void th7(void)
+{
+ th8();
+}
+
+__attribute__((noinline))
+static void th6(void)
+{
+ th7();
+}
+
+__attribute__((noinline))
+static void th5(void)
+{
+ th6();
+}
+
+__attribute__((noinline))
+static void th4(void)
+{
+ th5();
+}
+
+__attribute__((noinline))
+static void th3(void)
+{
+ th4();
+}
+
+__attribute__((noinline))
+static void th2(void)
+{
+ th3();
+}
+
+
+__attribute__((noinline))
+static void th1(void)
+{
+ th2();
+}
+
static void *th(void *v)
{
- shared++;
+ th1();
- return 0;
+ return 0;
}
int main()
{
pthread_t a, b;
- pthread_create(&a, NULL, th, NULL);
+ pthread_create(&a, NULL, th, NULL);
sleep(1); /* force ordering */
pthread_create(&b, NULL, th, NULL);
Thread #x was created
...
by 0x........: pthread_create@* (hg_intercepts.c:...)
- by 0x........: main (hg04_race.c:21)
+ by 0x........: main (hg04_race.c:82)
---Thread-Announcement------------------------------------------
Thread #x was created
...
by 0x........: pthread_create@* (hg_intercepts.c:...)
- by 0x........: main (hg04_race.c:19)
+ by 0x........: main (hg04_race.c:80)
----------------------------------------------------------------
Possible data race during read of size 4 at 0x........ by thread #x
Locks held: none
- at 0x........: th (hg04_race.c:10)
+ at 0x........: th10 (hg04_race.c:11)
+ by 0x........: th9 (hg04_race.c:17)
+ by 0x........: th8 (hg04_race.c:23)
+ by 0x........: th7 (hg04_race.c:29)
+ by 0x........: th6 (hg04_race.c:35)
+ by 0x........: th5 (hg04_race.c:41)
+ by 0x........: th4 (hg04_race.c:47)
+ by 0x........: th3 (hg04_race.c:53)
+ by 0x........: th2 (hg04_race.c:59)
+ by 0x........: th1 (hg04_race.c:66)
+ by 0x........: th (hg04_race.c:71)
by 0x........: mythread_wrapper (hg_intercepts.c:...)
- ...
This conflicts with a previous write of size 4 by thread #x
Locks held: none
- at 0x........: th (hg04_race.c:10)
- by 0x........: mythread_wrapper (hg_intercepts.c:...)
- ...
+ at 0x........: th10 (hg04_race.c:11)
+ by 0x........: th9 (hg04_race.c:17)
+ by 0x........: th8 (hg04_race.c:23)
+ by 0x........: th7 (hg04_race.c:29)
+ by 0x........: th6 (hg04_race.c:35)
+ by 0x........: th5 (hg04_race.c:41)
+ by 0x........: th4 (hg04_race.c:47)
+ by 0x........: th3 (hg04_race.c:53)
Location 0x........ is 0 bytes inside global var "shared"
declared at hg04_race.c:6
Possible data race during write of size 4 at 0x........ by thread #x
Locks held: none
- at 0x........: th (hg04_race.c:10)
+ at 0x........: th10 (hg04_race.c:11)
+ by 0x........: th9 (hg04_race.c:17)
+ by 0x........: th8 (hg04_race.c:23)
+ by 0x........: th7 (hg04_race.c:29)
+ by 0x........: th6 (hg04_race.c:35)
+ by 0x........: th5 (hg04_race.c:41)
+ by 0x........: th4 (hg04_race.c:47)
+ by 0x........: th3 (hg04_race.c:53)
+ by 0x........: th2 (hg04_race.c:59)
+ by 0x........: th1 (hg04_race.c:66)
+ by 0x........: th (hg04_race.c:71)
by 0x........: mythread_wrapper (hg_intercepts.c:...)
- ...
This conflicts with a previous write of size 4 by thread #x
Locks held: none
- at 0x........: th (hg04_race.c:10)
- by 0x........: mythread_wrapper (hg_intercepts.c:...)
- ...
+ at 0x........: th10 (hg04_race.c:11)
+ by 0x........: th9 (hg04_race.c:17)
+ by 0x........: th8 (hg04_race.c:23)
+ by 0x........: th7 (hg04_race.c:29)
+ by 0x........: th6 (hg04_race.c:35)
+ by 0x........: th5 (hg04_race.c:41)
+ by 0x........: th4 (hg04_race.c:47)
+ by 0x........: th3 (hg04_race.c:53)
Location 0x........ is 0 bytes inside global var "shared"
declared at hg04_race.c:6
--- /dev/null
+
+---Thread-Announcement------------------------------------------
+
+Thread #x was created
+ ...
+ by 0x........: pthread_create@* (hg_intercepts.c:...)
+ by 0x........: main (hg04_race.c:82)
+
+---Thread-Announcement------------------------------------------
+
+Thread #x was created
+ ...
+ by 0x........: pthread_create@* (hg_intercepts.c:...)
+ by 0x........: main (hg04_race.c:80)
+
+----------------------------------------------------------------
+
+Possible data race during read of size 4 at 0x........ by thread #x
+Locks held: none
+ at 0x........: th10 (hg04_race.c:11)
+ by 0x........: th9 (hg04_race.c:17)
+ by 0x........: th8 (hg04_race.c:23)
+ by 0x........: th7 (hg04_race.c:29)
+ by 0x........: th6 (hg04_race.c:35)
+ by 0x........: th5 (hg04_race.c:41)
+ by 0x........: th4 (hg04_race.c:47)
+ by 0x........: th3 (hg04_race.c:53)
+ by 0x........: th2 (hg04_race.c:59)
+ by 0x........: th1 (hg04_race.c:66)
+ by 0x........: th (hg04_race.c:71)
+ by 0x........: mythread_wrapper (hg_intercepts.c:...)
+
+This conflicts with a previous write of size 4 by thread #x
+Locks held: none
+ at 0x........: th10 (hg04_race.c:11)
+ by 0x........: th9 (hg04_race.c:17)
+ by 0x........: th8 (hg04_race.c:23)
+ by 0x........: th7 (hg04_race.c:29)
+ by 0x........: th6 (hg04_race.c:35)
+ by 0x........: th5 (hg04_race.c:41)
+ by 0x........: th4 (hg04_race.c:47)
+ by 0x........: th3 (hg04_race.c:53)
+ by 0x........: th2 (hg04_race.c:59)
+ Location 0x........ is 0 bytes inside global var "shared"
+ declared at hg04_race.c:6
+
+----------------------------------------------------------------
+
+Possible data race during write of size 4 at 0x........ by thread #x
+Locks held: none
+ at 0x........: th10 (hg04_race.c:11)
+ by 0x........: th9 (hg04_race.c:17)
+ by 0x........: th8 (hg04_race.c:23)
+ by 0x........: th7 (hg04_race.c:29)
+ by 0x........: th6 (hg04_race.c:35)
+ by 0x........: th5 (hg04_race.c:41)
+ by 0x........: th4 (hg04_race.c:47)
+ by 0x........: th3 (hg04_race.c:53)
+ by 0x........: th2 (hg04_race.c:59)
+ by 0x........: th1 (hg04_race.c:66)
+ by 0x........: th (hg04_race.c:71)
+ by 0x........: mythread_wrapper (hg_intercepts.c:...)
+
+This conflicts with a previous write of size 4 by thread #x
+Locks held: none
+ at 0x........: th10 (hg04_race.c:11)
+ by 0x........: th9 (hg04_race.c:17)
+ by 0x........: th8 (hg04_race.c:23)
+ by 0x........: th7 (hg04_race.c:29)
+ by 0x........: th6 (hg04_race.c:35)
+ by 0x........: th5 (hg04_race.c:41)
+ by 0x........: th4 (hg04_race.c:47)
+ by 0x........: th3 (hg04_race.c:53)
+ by 0x........: th2 (hg04_race.c:59)
+ Location 0x........ is 0 bytes inside global var "shared"
+ declared at hg04_race.c:6
+
+
+ERROR SUMMARY: 2 errors from 2 contexts (suppressed: 0 from 0)
--- /dev/null
+prog: hg04_race
+vgopts: --read-var-info=yes --history-backtrace-size=9
+stderr_filter_args: hg04_race.c