[valgrind] [Bug 454346] [PATCH] ARM fixes from the Yocto project

2024-02-08 Thread Alexander Kanavin
https://bugs.kde.org/show_bug.cgi?id=454346

Alexander Kanavin  changed:

   What|Removed |Added

 CC||raj.k...@gmail.com

--- Comment #5 from Alexander Kanavin  ---
The patches weren't written by me, so it's difficult to answer about their
specifics. I only wanted to check if the fixes are obvious and suitable, and
it's fine if they're not. 

We run the tests in qemu arm64 virtual machine. I added Khem at least if he
would like to comment (he knows more about the area).

We're now in the process of updating to latest valgrind release, so when that's
done, I can review again what if anything needs to be rebased to valgrind trunk
and re-submitted, with more detailed explanations/logs of the errors we get if
the respective patch is not applied.

-- 
You are receiving this mail because:
You are watching all bug changes.

[valgrind] [Bug 382034] Testcases build fixes for musl

2023-05-11 Thread Alexander Kanavin
https://bugs.kde.org/show_bug.cgi?id=382034

--- Comment #20 from Alexander Kanavin  ---
(In reply to Paul Floyd from comment #19)
> > I'll try to do some musl testing before closing this.
> 
> Did you use an x86 install of Alpine?
> 
> Or is there way to add an x86 subsystem to amd64?

I build valgrind using yocto set to use musl and 32bit x86. If you want to try
that, do it on the most powerful (cpu cores wise) computer you have.

-- 
You are receiving this mail because:
You are watching all bug changes.

[valgrind] [Bug 382034] Testcases build fixes for musl

2023-05-09 Thread Alexander Kanavin
https://bugs.kde.org/show_bug.cgi?id=382034

Alexander Kanavin  changed:

   What|Removed |Added

 Resolution|FIXED   |---
 Status|RESOLVED|REOPENED
 Ever confirmed|0   |1

--- Comment #17 from Alexander Kanavin  ---
There's one more fix needed (add needed includes on musl), I've attached the
patch for it. Hope you don't mind reusing this ticket, which I'll reopen.

-- 
You are receiving this mail because:
You are watching all bug changes.

[valgrind] [Bug 382034] Testcases build fixes for musl

2023-05-09 Thread Alexander Kanavin
https://bugs.kde.org/show_bug.cgi?id=382034

Alexander Kanavin  changed:

   What|Removed |Added

 CC||alex.kana...@gmail.com

--- Comment #16 from Alexander Kanavin  ---
Created attachment 158792
  --> https://bugs.kde.org/attachment.cgi?id=158792=edit
Add missing includes to avoid 'SYS_modify_ldt is undefined' errors

-- 
You are receiving this mail because:
You are watching all bug changes.

[valgrind] [Bug 463463] New: none/tests/amd64/fma fails when executed under valgrind on a x86-64-v3 system

2022-12-25 Thread Alexander Kanavin
https://bugs.kde.org/show_bug.cgi?id=463463

Bug ID: 463463
   Summary: none/tests/amd64/fma fails when executed under
valgrind on a x86-64-v3 system
Classification: Developer tools
   Product: valgrind
   Version: 3.20.0
  Platform: Other
OS: Linux
Status: REPORTED
  Severity: normal
  Priority: NOR
 Component: general
  Assignee: jsew...@acm.org
  Reporter: alex.kana...@gmail.com
  Target Milestone: ---

Yocto project is transitioning x86_64 builds to build for x86-64-v3 (e.g.
enabling AVX, AVX2, BMI1, BMI2, F16C, FMA, LZCNT, MOVBE, XSAVE), and one of the
regressions is in none/tests/amd64/fma:

none/tests/amd64/fma.stdout.diff

--- fma.stdout.exp  2018-03-09 12:34:56.0 +
+++ fma.stdout.out  2022-12-25 14:55:01.18200 +
@@ -1 +1,42 @@
-Testing successful
+Failure 1 32 0x1p+0 0x1.fp-1
+Failure 2 32 -0x1p+0 0x1.fp-1
+Failure 1 35 0x1.fefffp+1011 0x1.fp+1011
+Failure 2 35 -0x1.fefffp+1011 0x1.fp+1011
+Failure 1 48 0x1.7e8p-983 0x1.7e7ffp-983
+Failure 2 48 -0x1.7e8p-983 0x1.7e7ffp-983
+Failure 3 32 0x1p+0 0x1.fp-1
+Failure 4 32 -0x1p+0 0x1.fp-1
+Failure 3 35 0x1.fefffp+1011 0x1.fp+1011
+Failure 4 35 -0x1.fefffp+1011 0x1.fp+1011
+Failure 3 48 0x1.7e8p-983 0x1.7e7ffp-983
+Failure 4 48 -0x1.7e8p-983 0x1.7e7ffp-983
+Failure 5 32 0x1p+0 0x1.fp-1 0x1.0989687bc9da4p-53
0x1.0989687bc9da4p-53
+Failure 6 32 -0x1p+0 0x1.fp-1 -0x1.0989687bc9da4p-53
0x1.0989687bc9da4p-53
+Failure 5 34 0x1.0989687bc9da4p-176 0x1.0989687bc9da4p-176
0x1.fefffp+1011 0x1.fp+1011
+Failure 6 34 -0x1.0989687bc9da4p-176 0x1.0989687bc9da4p-176
-0x1.fefffp+1011 0x1.fp+1011
+Failure 5 48 0x1.7e8p-983 0x1.7e7ffp-983 0x0p+0 0x0p+0
+Failure 6 48 -0x1.7e8p-983 0x1.7e7ffp-983 -0x0p+0 0x0p+0
+Failure 7 32 0x1p+0 0x1.fp-1 0x1.0989687bc9da4p-53
0x1.0989687bc9da4p-53
+Failure 8 32 -0x1p+0 0x1.fp-1 -0x1.0989687bc9da4p-53
0x1.0989687bc9da4p-53
+Failure 7 34 0x1.0989687bc9da4p-176 0x1.0989687bc9da4p-176
0x1.fefffp+1011 0x1.fp+1011
+Failure 8 34 -0x1.0989687bc9da4p-176 0x1.0989687bc9da4p-176
-0x1.fefffp+1011 0x1.fp+1011
+Failure 7 48 0x1.7e8p-983 0x1.7e7ffp-983 0x0p+0 0x0p+0
+Failure 8 48 -0x1.7e8p-983 0x1.7e7ffp-983 -0x0p+0 0x0p+0
+Failure 9 32 0x1p+0 0x1.fp-1 0x1.0989687bc9da4p-53
0x1.0989687bc9da4p-53
+Failure 9 34 0x1.0989687bc9da4p-176 0x1.0989687bc9da4p-176
0x1.fefffp+1011 0x1.fp+1011
+Failure 9 48 0x1.7e8p-983 0x1.7e7ffp-983 0x0p+0 0x0p+0
+Failure 10 32 0x1p+0 0x1.fp-1 0x1.0989687bc9da4p-53
0x1.0989687bc9da4p-53
+Failure 10 34 0x1.0989687bc9da4p-176 0x1.0989687bc9da4p-176
0x1.fefffp+1011 0x1.fp+1011
+Failure 10 48 0x1.7e8p-983 0x1.7e7ffp-983 0x0p+0 0x0p+0
+Failure 11 32 0x1p+0 0x1.fp-1 0x1.0989687bc9da4p-53
0x1.0989687bc9da4p-53 0x1.0989687bc9da4p-176 0x1.0989687bc9da4p-176
0x1.fefffp+1011 0x1.fp+1011
+Failure 12 32 -0x1p+0 0x1.fp-1 -0x1.0989687bc9da4p-53
0x1.0989687bc9da4p-53 -0x1.0989687bc9da4p-176 0x1.0989687bc9da4p-176
-0x1.fefffp+1011 0x1.fp+1011
+Failure 11 48 0x1.7e8p-983 0x1.7e7ffp-983 0x0p+0 0x0p+0 0x0p+0
0x0p+0 0x0p+0 0x0p+0
+Failure 12 48 -0x1.7e8p-983 0x1.7e7ffp-983 -0x0p+0 0x0p+0
-0x0p+0 0x0p+0 -0x0p+0 0x0p+0
+Failure 13 32 0x1p+0 0x1.fp-1 0x1.0989687bc9da4p-53
0x1.0989687bc9da4p-53 0x1.0989687bc9da4p-176 0x1.0989687bc9da4p-176
0x1.fefffp+1011 0x1.fp+1011
+Failure 14 32 -0x1p+0 0x1.fp-1 -0x1.0989687bc9da4p-53
0x1.0989687bc9da4p-53 -0x1.0989687bc9da4p-176 0x1.0989687bc9da4p-176
-0x1.fefffp+1011 0x1.fp+1011
+Failure 13 48 0x1.7e8p-983 0x1.7e7ffp-983 0x0p+0 0x0p+0 0x0p+0
0x0p+0 0x0p+0 0x0p+0
+Failure 14 48 -0x1.7e8p-983 0x1.7e7ffp-983 -0x0p+0 0x0p+0
-0x0p+0 0x0p+0 -0x0p+0 0x0p+0
+Failure 15 32 0x1p+0 0x1.fp-1 0x1.0989687bc9da4p-53
0x1.0989687bc9da4p-53 0x1.0989687bc9da4p-176 0x1.0989687bc9da4p-176
0x1.fefffp+1011 0x1.fp+1011
+Failure 15 48 0x1.7e8p-983 0x1.7e7ffp-983 0x0p+0 0x0p+0 0x0p+0
0x0p+0 0x0p+0 0x0p+0
+Failure 16 32 0x1p+0 0x1.fp-1 0x1.0989687bc9da4p-53
0x1.0989687bc9da4p-53 0x1.0989687bc9da4p-176 0x1.0989687bc9da4p-176
0x1.fefffp+1011 0x1.fp+1011
+Failure 16 48 0x1.7e8p-983 0x1.7e7ffp-983 0x0p+0 0x0p+0 0x0p+0
0x0p+0 0x0p+0 0x0p+0


Note that this happens only when executing fma test under valgrind, when run

[valgrind] [Bug 463458] New: memcheck/tests/vcpu_fnfns fails when glibc is built for x86-64-v3 target

2022-12-25 Thread Alexander Kanavin
https://bugs.kde.org/show_bug.cgi?id=463458

Bug ID: 463458
   Summary: memcheck/tests/vcpu_fnfns fails when glibc is built
for x86-64-v3 target
Classification: Developer tools
   Product: valgrind
   Version: 3.20.0
  Platform: Other
OS: Linux
Status: REPORTED
  Severity: normal
  Priority: NOR
 Component: memcheck
  Assignee: jsew...@acm.org
  Reporter: alex.kana...@gmail.com
  Target Milestone: ---

Yocto project is transitioning x86_64 builds to build for x86-64-v3 (e.g.
enabling AVX, AVX2, BMI1, BMI2, F16C, FMA, LZCNT, MOVBE, XSAVE).

Presumably, something in the instructions enabled by that target (AVX, AVX2,
BMI1, BMI2, F16C, FMA, LZCNT, MOVBE, XSAVE) distorts the floating point results
slightly in libm math functions:

memcheck/tests/vcpu_fnfns.stdout.diff

--- vcpu_fnfns.stdout.exp   2018-03-09 12:34:56.0 +
+++ vcpu_fnfns.stdout.out   2022-12-25 14:43:29.19500 +
@@ -305,7 +305,7 @@
   cosF( -3.0170e-01) =  +9.5483e-01
   cosF( -2.0180e-01) =  +9.7971e-01
   cosF( -1.0190e-01) =  +9.9481e-01
-  cosF( -1.e-03) =  +1.e-00
+  cosF( -1.e-03) =  +1.e+00
   cosF( +9.7900e-02) =  +9.9521e-01
   cosF( +1.9780e-01) =  +9.8050e-01
   cosF( +2.9770e-01) =  +9.5601e-01
@@ -536,7 +536,7 @@
   logD(+9.0e-02) = -2.3025850939940e+00
   logD(+1.8e-01) = -1.6094379134341e+00
   logD(+2.7e-01) = -1.2039728053259e+00
-  logD(+3.6e-01) = -9.1629073287415e-01
+  logD(+3.6e-01) = -9.1629073287416e-01
   logD(+4.5e-01) = -6.9314718155995e-01
   logD(+5.4e-01) = -5.1082562476599e-01
   logD(+6.3e-01) = -3.5667494493873e-01


More detailed information about the feature level targets in gcc is here:
https://www.phoronix.com/news/GCC-11-x86-64-Feature-Levels

-- 
You are receiving this mail because:
You are watching all bug changes.

[valgrind] [Bug 463456] New: memcheck/tests/origin6-fp fails when building for x86-64-v3 target

2022-12-25 Thread Alexander Kanavin
https://bugs.kde.org/show_bug.cgi?id=463456

Bug ID: 463456
   Summary: memcheck/tests/origin6-fp fails when building for
x86-64-v3 target
Classification: Developer tools
   Product: valgrind
   Version: 3.20.0
  Platform: Other
OS: Linux
Status: REPORTED
  Severity: normal
  Priority: NOR
 Component: memcheck
  Assignee: jsew...@acm.org
  Reporter: alex.kana...@gmail.com
  Target Milestone: ---

Yocto project is transitioning x86_64 builds to build for x86-64-v3 (e.g.
enabling AVX, AVX2, BMI1, BMI2, F16C, FMA, LZCNT, MOVBE, XSAVE), and one of the
regressions is in memcheck/tests/origin6-fp.

Specifically:

Correct output for  x86-64-v2:

root@qemux86-64:~/origin6-test# gcc -march=x86-64-v2 -g -O origin6-fp.c 
root@qemux86-64:~/origin6-test# valgrind   -q --track-origins=yes ./a.out 
==19942== Conditional jump or move depends on uninitialised value(s)
==19942==at 0x1094A0: main (origin6-fp.c:97)
==19942==  Uninitialised value was created by a client request
==19942==at 0x109409: setup_arr (origin6-fp.c:75)
==19942==by 0x109467: main (origin6-fp.c:87)
==19942== 
Test succeeded.

Incorrect output for v3 (missing the uninitialized value bit):

root@qemux86-64:~/origin6-test# gcc -march=x86-64-v3 -g -O origin6-fp.c 
root@qemux86-64:~/origin6-test# valgrind   -q --track-origins=yes ./a.out 
==19948== Conditional jump or move depends on uninitialised value(s)
==19948==at 0x1094A0: main (origin6-fp.c:97)
==19948== 
Test succeeded.

The more detailed information about the levels is here:
https://www.phoronix.com/news/GCC-11-x86-64-Feature-Levels

-- 
You are receiving this mail because:
You are watching all bug changes.

[valgrind] [Bug 462553] -mpreferred-stack-boundary=2 on 32 bit x86 causes crashes when SSE is also enabled (e.g. used by glibc)

2022-12-05 Thread Alexander Kanavin
https://bugs.kde.org/show_bug.cgi?id=462553

--- Comment #2 from Alexander Kanavin  ---
Yocto/qemux86. We use the following flags across the stack:

-march=core2 -mtune=core2 -msse3 -mfpmath=sse

glibc is at 2.36.

-- 
You are receiving this mail because:
You are watching all bug changes.

[valgrind] [Bug 462553] New: -mpreferred-stack-boundary=2 on 32 bit x86 causes crashes when SSE is also enabled (e.g. used by glibc)

2022-12-02 Thread Alexander Kanavin
https://bugs.kde.org/show_bug.cgi?id=462553

Bug ID: 462553
   Summary: -mpreferred-stack-boundary=2 on 32 bit x86 causes
crashes when SSE is also enabled (e.g. used by glibc)
Classification: Developer tools
   Product: valgrind
   Version: 3.20.0
  Platform: Other
OS: Linux
Status: REPORTED
  Severity: normal
  Priority: NOR
 Component: general
  Assignee: jsew...@acm.org
  Reporter: alex.kana...@gmail.com
  Target Milestone: ---

Valgrind build itself with -mpreferred-stack-boundary=2 on x86 (32 bit)
targets. On the other hand,  SSE instructions expect things to be aligned on 16
byte boundary (e.g. -mpreferred-stack-boundary=4). This won't be reported at
compile time and results in crashes at runtime, e.g. vgdb simply does not work
at all and crashes out immediately when calling into glibc code which moves
things to and from XMM registers (because it was built with SSE enabled).

-- 
You are receiving this mail because:
You are watching all bug changes.

[valgrind] [Bug 289836] Unhanded instructions mfatbu and mfatbl

2022-08-30 Thread Alexander Kanavin
https://bugs.kde.org/show_bug.cgi?id=289836

Alexander Kanavin  changed:

   What|Removed |Added

  Attachment #67114|0   |1
is obsolete||
 CC||alex.kana...@gmail.com

--- Comment #8 from Alexander Kanavin  ---
Created attachment 151700
  --> https://bugs.kde.org/attachment.cgi?id=151700=edit
A rebased (to latest upstream commit) version of the patch

-- 
You are receiving this mail because:
You are watching all bug changes.

[valgrind] [Bug 454346] [PATCH] ARM fixes from the Yocto project

2022-05-24 Thread Alexander Kanavin
https://bugs.kde.org/show_bug.cgi?id=454346

--- Comment #2 from Alexander Kanavin  ---
Created attachment 149174
  --> https://bugs.kde.org/attachment.cgi?id=149174=edit
makefiles: Drop setting -mcpu to cortex-a8 on arm  architecture

-- 
You are receiving this mail because:
You are watching all bug changes.

[valgrind] [Bug 454346] [PATCH] ARM fixes from the Yocto project

2022-05-24 Thread Alexander Kanavin
https://bugs.kde.org/show_bug.cgi?id=454346

--- Comment #1 from Alexander Kanavin  ---
Created attachment 149173
  --> https://bugs.kde.org/attachment.cgi?id=149173=edit
avoid neon for targets which don't support it

-- 
You are receiving this mail because:
You are watching all bug changes.

[valgrind] [Bug 454346] New: [PATCH] ARM fixes from the Yocto project

2022-05-24 Thread Alexander Kanavin
https://bugs.kde.org/show_bug.cgi?id=454346

Bug ID: 454346
   Summary: [PATCH] ARM fixes from the Yocto project
   Product: valgrind
   Version: unspecified
  Platform: Other
OS: Linux
Status: REPORTED
  Severity: normal
  Priority: NOR
 Component: general
  Assignee: jsew...@acm.org
  Reporter: alex.kana...@gmail.com
  Target Milestone: ---

Created attachment 149172
  --> https://bugs.kde.org/attachment.cgi?id=149172=edit
use appropriate -march/-mcpu/-mfpu for ARM test apps

Yocto has been carrying these patches for a while; please evaluate whether
they're still appropriate.

-- 
You are receiving this mail because:
You are watching all bug changes.

[valgrind] [Bug 445743] "The impossible happened: mutex is locked simultaneously by two threads" while using mutexes with priority inheritance and signals

2022-04-27 Thread Alexander Kanavin
https://bugs.kde.org/show_bug.cgi?id=445743

Alexander Kanavin  changed:

   What|Removed |Added

 CC||alex.kana...@gmail.com

--- Comment #9 from Alexander Kanavin  ---
Yocto project started getting this too with valgrind 3.19.0 on linux:

drd/tests/pth_mutex_signal.stderr.diff

--- pth_mutex_signal.stderr.exp 2018-03-09 12:34:56.0 +
+++ pth_mutex_signal.stderr.out 2022-04-27 07:32:55.31000 +
@@ -6,10 +6,42 @@
 signalling
 sleeping
 nullHandler running
-unlocking
+Thread 2:
+The impossible happened: mutex is locked simultaneously by two threads: mutex
0x, recursion count 1, owner 1.
+   at 0x: pthread_mutex_lock (drd_pthread_intercepts.c:?)
+   by 0x: contender_start (pth_mutex_signal.c:?)
+   by 0x: vgDrd_thread_wrapper (drd_pthread_intercepts.c:?)
+   by 0x: start_thread
+   by 0x: clone (in /...libc...)
+mutex 0x was first observed at:
+   at 0x: pthread_mutex_init (drd_pthread_intercepts.c:?)
+   by 0x: main (pth_mutex_signal.c:?)
+
 contender locked mutex
 contender unlocking mutex
 contender unlocked mutex
+unlocking
+Thread 1:
+Mutex not locked by calling thread: mutex 0x, recursion count 1, owner
2.
+   at 0x: pthread_mutex_unlock (drd_pthread_intercepts.c:?)
+   by 0x: main (pth_mutex_signal.c:?)
+mutex 0x was first observed at:
+   at 0x: pthread_mutex_init (drd_pthread_intercepts.c:?)
+   by 0x: main (pth_mutex_signal.c:?)
+
 joining thread
+Mutex still locked at thread exit: mutex 0x, recursion count 1, owner
2.
+   at 0x: pthread_join (drd_pthread_intercepts.c:?)
+   by 0x: main (pth_mutex_signal.c:?)
+mutex 0x was first observed at:
+   at 0x: pthread_mutex_init (drd_pthread_intercepts.c:?)
+   by 0x: main (pth_mutex_signal.c:?)
+
+Destroying locked mutex: mutex 0x, recursion count 1, owner 0.
+   at 0x: main (pth_mutex_signal.c:?)
+mutex 0x was first observed at:
+   at 0x: pthread_mutex_init (drd_pthread_intercepts.c:?)
+   by 0x: main (pth_mutex_signal.c:?)
+

-ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
+ERROR SUMMARY: 4 errors from 4 contexts (suppressed: 0 from 0)

-- 
You are receiving this mail because:
You are watching all bug changes.

[valgrind] [Bug 445211] [PATCH] fix out of tree builds

2022-04-07 Thread Alexander Kanavin
https://bugs.kde.org/show_bug.cgi?id=445211

--- Comment #9 from Alexander Kanavin  ---
I believe you need to re-run autogen.sh. Somehow automake didn't re-do the
makefiles with this change for me :-/

-- 
You are receiving this mail because:
You are watching all bug changes.

[valgrind] [Bug 445211] [PATCH] fix out of tree builds

2022-04-04 Thread Alexander Kanavin
https://bugs.kde.org/show_bug.cgi?id=445211

Alexander Kanavin  changed:

   What|Removed |Added

 Attachment #143897|0   |1
is obsolete||

--- Comment #7 from Alexander Kanavin  ---
Created attachment 147953
  --> https://bugs.kde.org/attachment.cgi?id=147953=edit
v4 with doc fix

This is now corrected too :)

-- 
You are receiving this mail because:
You are watching all bug changes.

[valgrind] [Bug 445211] [PATCH] fix out of tree builds

2021-11-24 Thread Alexander Kanavin
https://bugs.kde.org/show_bug.cgi?id=445211

Alexander Kanavin  changed:

   What|Removed |Added

 Attachment #143477|0   |1
is obsolete||

--- Comment #5 from Alexander Kanavin  ---
Created attachment 143897
  --> https://bugs.kde.org/attachment.cgi?id=143897=edit
v3 with requested adjustments

Thanks, adjusted patch attached.

-- 
You are receiving this mail because:
You are watching all bug changes.

[valgrind] [Bug 445211] [PATCH] fix out of tree builds

2021-11-12 Thread Alexander Kanavin
https://bugs.kde.org/show_bug.cgi?id=445211

Alexander Kanavin  changed:

   What|Removed |Added

 Attachment #143375|0   |1
is obsolete||

--- Comment #2 from Alexander Kanavin  ---
Created attachment 143477
  --> https://bugs.kde.org/attachment.cgi?id=143477=edit
v2 with requested adjustments

-- 
You are receiving this mail because:
You are watching all bug changes.

[valgrind] [Bug 445211] New: [PATCH] fix out of tree builds

2021-11-09 Thread Alexander Kanavin
https://bugs.kde.org/show_bug.cgi?id=445211

Bug ID: 445211
   Summary: [PATCH] fix out of tree builds
   Product: valgrind
   Version: unspecified
  Platform: Other
OS: Linux
Status: REPORTED
  Severity: normal
  Priority: NOR
 Component: general
  Assignee: jsew...@acm.org
  Reporter: alex.kana...@gmail.com
  Target Milestone: ---

Created attachment 143375
  --> https://bugs.kde.org/attachment.cgi?id=143375=edit
patch to fix out of tree builds

Yocto project has been carrying this patch for a while; I believe this allows
building valgrind in a separate build directory:

-- 
You are receiving this mail because:
You are watching all bug changes.

[valgrind] [Bug 358213] helgrind/drd bar_bad testcase hangs or crashes with new glibc pthread barrier implementation

2020-12-12 Thread Alexander Kanavin
https://bugs.kde.org/show_bug.cgi?id=358213

Alexander Kanavin  changed:

   What|Removed |Added

 CC||alex.kana...@gmail.com

--- Comment #13 from Alexander Kanavin  ---
Sadly I am still seeing the sporadic failures in bar_bad/bar_bad_xml. Reported
here:
https://bugs.kde.org/show_bug.cgi?id=430321

-- 
You are receiving this mail because:
You are watching all bug changes.

[valgrind] [Bug 430321] New: drd/tests/bar_bad and drd/tests/bar_bad_xml are non-deterministic

2020-12-12 Thread Alexander Kanavin
https://bugs.kde.org/show_bug.cgi?id=430321

Bug ID: 430321
   Summary: drd/tests/bar_bad and drd/tests/bar_bad_xml are
non-deterministic
   Product: valgrind
   Version: unspecified
  Platform: Other
OS: Linux
Status: REPORTED
  Severity: normal
  Priority: NOR
 Component: drd
  Assignee: bvanass...@acm.org
  Reporter: alex.kana...@gmail.com
  Target Milestone: ---

When I run the tests under qemu they pass or fail non-deterministically. Note
the difference in "destroy a barrier that has waiting threads" section.

Run 1:

root@qemux86-64:/usr/lib/valgrind/ptest# valgrind --tool=drd --fair-sched=yes
./helgrind/tests/bar_bad
==31394== drd, a thread error detector
==31394== Copyright (C) 2006-2017, and GNU GPL'd, by Bart Van Assche.
==31394== Using Valgrind-3.16.1 and LibVEX; rerun with -h for copyright info
==31394== Command: ./helgrind/tests/bar_bad
==31394== 

initialise a barrier with zero count
==31394== pthread_barrier_init: 'count' argument is zero: barrier 0x4852030
==31394==at 0x48262D2: pthread_barrier_init_intercept
(drd_pthread_intercepts.c:1302)
==31394==by 0x48262D2: pthread_barrier_init (drd_pthread_intercepts.c:1310)
==31394==by 0x401273: main (bar_bad.c:43)
==31394== 

initialise a barrier twice
==31394== Barrier reinitialization: barrier 0x4852070
==31394==at 0x48262D2: pthread_barrier_init_intercept
(drd_pthread_intercepts.c:1302)
==31394==by 0x48262D2: pthread_barrier_init (drd_pthread_intercepts.c:1310)
==31394==by 0x4012CB: main (bar_bad.c:49)
==31394== barrier 0x4852070 was first observed at:
==31394==at 0x48262D2: pthread_barrier_init_intercept
(drd_pthread_intercepts.c:1302)
==31394==by 0x48262D2: pthread_barrier_init (drd_pthread_intercepts.c:1310)
==31394==by 0x4012B5: main (bar_bad.c:48)
==31394== 

initialise a barrier which has threads waiting on it
==31394== Barrier reinitialization: barrier 0x48520b0
==31394==at 0x48262D2: pthread_barrier_init_intercept
(drd_pthread_intercepts.c:1302)
==31394==by 0x48262D2: pthread_barrier_init (drd_pthread_intercepts.c:1310)
==31394==by 0x401367: main (bar_bad.c:64)
==31394== barrier 0x48520b0 was first observed at:
==31394==at 0x48262D2: pthread_barrier_init_intercept
(drd_pthread_intercepts.c:1302)
==31394==by 0x48262D2: pthread_barrier_init (drd_pthread_intercepts.c:1310)
==31394==by 0x40130D: main (bar_bad.c:55)
==31394== 

destroy a barrier that has waiting threads
==31394== Destruction of a barrier with active waiters: barrier 0x4852350
==31394==at 0x4826C71: pthread_barrier_destroy_intercept
(drd_pthread_intercepts.c:1323)
==31394==by 0x4826C71: pthread_barrier_destroy
(drd_pthread_intercepts.c:1328)
==31394==by 0x4013F9: main (bar_bad.c:82)
==31394== barrier 0x4852350 was first observed at:
==31394==at 0x48262D2: pthread_barrier_init_intercept
(drd_pthread_intercepts.c:1302)
==31394==by 0x48262D2: pthread_barrier_init (drd_pthread_intercepts.c:1310)
==31394==by 0x4013A9: main (bar_bad.c:70)
==31394== 

destroy a barrier that was never initialised
==31394== Not a barrier
==31394==at 0x4826C71: pthread_barrier_destroy_intercept
(drd_pthread_intercepts.c:1323)
==31394==by 0x4826C71: pthread_barrier_destroy
(drd_pthread_intercepts.c:1328)
==31394==by 0x40148E: main (bar_bad.c:98)
==31394== 
==31394== 
==31394== For lists of detected and suppressed errors, rerun with: -s
==31394== ERROR SUMMARY: 6 errors from 5 contexts (suppressed: 138 from 15)


Run 2:

root@qemux86-64:/usr/lib/valgrind/ptest# valgrind --tool=drd --fair-sched=yes
./helgrind/tests/bar_bad
==31400== drd, a thread error detector
==31400== Copyright (C) 2006-2017, and GNU GPL'd, by Bart Van Assche.
==31400== Using Valgrind-3.16.1 and LibVEX; rerun with -h for copyright info
==31400== Command: ./helgrind/tests/bar_bad
==31400== 

initialise a barrier with zero count
==31400== pthread_barrier_init: 'count' argument is zero: barrier 0x4852030
==31400==at 0x48262D2: pthread_barrier_init_intercept
(drd_pthread_intercepts.c:1302)
==31400==by 0x48262D2: pthread_barrier_init (drd_pthread_intercepts.c:1310)
==31400==by 0x401273: main (bar_bad.c:43)
==31400== 

initialise a barrier twice
==31400== Barrier reinitialization: barrier 0x4852070
==31400==at 0x48262D2: pthread_barrier_init_intercept
(drd_pthread_intercepts.c:1302)
==31400==by 0x48262D2: pthread_barrier_init (drd_pthread_intercepts.c:1310)
==31400==by 0x4012CB: main (bar_bad.c:49)
==31400== barrier 0x4852070 was first observed at:
==31400==at 0x48262D2: pthread_barrier_init_intercept
(drd_pthread_intercepts.c:1302)
==31400==by 0x48262D2: pthread_barrier_init (drd_pthread_intercepts.c:1310)
==31400==by 0x4012B5: main (bar_bad.c:48)
==31400== 

initialise a barrier which has threads waiting on it
==31400== Barrier reinitialization: barrier 0x48520b0
==31400==at