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

2024-05-14 Thread Khem Raj
https://bugs.kde.org/show_bug.cgi?id=454346

--- Comment #10 from Khem Raj  ---
(In reply to Paul Floyd from comment #9)
> On my RPi 5 with Raspberry Pi OS
> Linux raspberrypi 6.1.0-rpi8-rpi-v8 #1 SMP PREEMPT Debian 1:6.1.73-1+rpt1
> (2024-01-25) aarch64 GNU/Linux
> 
> Build fails with
> 
> m_dispatch/dispatch-arm-linux.S:102: Error: selected processor does not
> support `movw r1,#47' in ARM mode
> m_dispatch/dispatch-arm-linux.S:103: Error: selected processor does not
> support `movw r2,#0' in ARM mode
> m_dispatch/dispatch-arm-linux.S:155: Error: selected processor does not
> support `movw r4,#:lower16:vgPlain_stats__n_xIndirs_32' in ARM mode
> m_dispatch/dispatch-arm-linux.S:156: Error: selected processor does not
> support `movt r4,#:upper16:vgPlain_stats__n_xIndirs_32' in ARM mode
> m_dispatch/dispatch-arm-linux.S:173: Error: selected processor does not
> support `ubfx r6,r6,#0,#13' in ARM mode
> m_dispatch/dispatch-arm-linux.S:176: Error: selected processor does not
> support `movw r4,#:lower16:vgPlain_tt_fast' in ARM mode
> m_dispatch/dispatch-arm-linux.S:177: Error: selected processor does not
> support `movt r4,#:upper16:vgPlain_tt_fast' in ARM mode
> m_dispatch/dispatch-arm-linux.S:204: Error: selected processor does not
> support `movw r4,#:lower16:vgPlain_stats__n_xIndir_hits1_32' in ARM mode
> m_dispatch/dispatch-arm-linux.S:205: Error: selected processor does not
> support `movt r4,#:upper16:vgPlain_stats__n_xIndir_hits1_32' in ARM mode
> m_dispatch/dispatch-arm-linux.S:226: Error: selected processor does not
> support `movw r4,#:lower16:vgPlain_stats__n_xIndir_hits2_32' in ARM mode
> m_dispatch/dispatch-arm-linux.S:227: Error: selected processor does not
> support `movt r4,#:upper16:vgPlain_stats__n_xIndir_hits2_32' in ARM mode
> m_dispatch/dispatch-arm-linux.S:248: Error: selected processor does not
> support `movw r4,#:lower16:vgPlain_stats__n_xIndir_hits3_32' in ARM mode
> m_dispatch/dispatch-arm-linux.S:249: Error: selected processor does not
> support `movt r4,#:upper16:vgPlain_stats__n_xIndir_hits3_32' in ARM mode
> m_dispatch/dispatch-arm-linux.S:258: Error: selected processor does not
> support `movw r4,#:lower16:vgPlain_stats__n_xIndir_misses_32' in ARM mode
> m_dispatch/dispatch-arm-linux.S:259: Error: selected processor does not
> support `movt r4,#:upper16:vgPlain_stats__n_xIndir_misses_32' in ARM mode
> 
> and also
> 
> gcc -DHAVE_CONFIG_H -I. -I..  -I.. -I../include -I../include -I../VEX/pub
> -I../VEX/pub -DVGA_arm=1 -DVGO_linux=1 -DVGP_arm_linux=1
> -DVGPV_arm_linux_vanilla=1-O2 -g -Wall -Wmissing-prototypes -Wshadow
> -Wpointer-arith -Wstrict-prototypes -Wmissing-declarations -Wcast-qual
> -Wwrite-strings -Wempty-body -Wformat -Wformat-signedness -Wformat-security
> -Wignored-qualifiers -Wmissing-parameter-type -Wlogical-op -Wenum-conversion
> -Wimplicit-fallthrough=2 -Wold-style-declaration -finline-functions
> -fno-stack-protector -fno-strict-aliasing -fno-builtin   -marm -O2  -MT
> memcheck_arm_linux-mc_main.o -MD -MP -MF
> .deps/memcheck_arm_linux-mc_main.Tpo -c -o memcheck_arm_linux-mc_main.o
> `test -f 'mc_main.c' || echo './'`mc_main.c
> /tmp/ccY1NRlM.s: Assembler messages:
> /tmp/ccY1NRlM.s:27: Error: selected processor does not support `movw
> r3,#:lower16:primary_map' in ARM mode
> /tmp/ccY1NRlM.s:29: Error: selected processor does not support `movt
> r3,#:upper16:primary_map' in ARM mode
> /tmp/ccY1NRlM.s:68: Error: selected processor does not support `movw
> r3,#:lower16:primary_map' in ARM mode
> /tmp/ccY1NRlM.s:70: Error: selected processor does not support `movt
> r3,#:upper16:primary_map' in ARM mode
> 
> gcc -DHAVE_CONFIG_H -I. -I..  -I.. -I../include -I../include -I../VEX/pub
> -I../VEX/pub -DVGA_arm=1 -DVGO_linux=1 -DVGP_arm_linux=1
> -DVGPV_arm_linux_vanilla=1-O2 -g -Wall -Wmissing-prototypes -Wshadow
> -Wpointer-arith -Wstrict-prototypes -Wmissing-declarations -Wcast-qual
> -Wwrite-strings -Wempty-body -Wformat -Wformat-signedness -Wformat-security
> -Wignored-qualifiers -Wmissing-parameter-type -Wlogical-op -Wenum-conversion
> -Wimplicit-fallthrough=2 -Wold-style-declaration -finline-functions
> -fno-stack-protector -fno-strict-aliasing -fno-builtin   -marm -O2  -MT
> memcheck_arm_linux-mc_main_asm.o -MD -MP -MF
> .deps/memcheck_arm_linux-mc_main_asm.Tpo -c -o
> memcheck_arm_linux-mc_main_asm.o `test -f 'mc_main_asm.c' || echo
> './'`mc_main_asm.c
> /tmp/cclkrIER.s: Assembler messages:
> /tmp/cclkrIER.s:25: Error: selected processor does not support `movw
> r3,#:lower16:primary_map' in ARM mode
> /tmp/cclkrIER.s:28: Error: selected processor does not support `movt
> r3,#:upper16:primary_map' in ARM mode
> /tmp/cclkrIER.s:31: Error: selected processor does not support `movw
> r3,#0x' in ARM mode
> /tm

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

2024-05-13 Thread Khem Raj
https://bugs.kde.org/show_bug.cgi?id=454346

--- Comment #8 from Khem Raj  ---
(In reply to Paul Floyd from comment #4)
> (And I have made some changes recently - have the patches been rebased?)

@paul, I have rebased on master and uploaded latest 2 patches, dropping -mcpu
makes it working on wider arm systems ( it seems to work on
different versions of rpi boards ).

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

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

2024-05-13 Thread Khem Raj
https://bugs.kde.org/show_bug.cgi?id=454346

Khem Raj  changed:

   What|Removed |Added

 Attachment #149172|0   |1
is obsolete||
 Attachment #149173|0   |1
is obsolete||
 Attachment #149174|0   |1
is obsolete||

--- Comment #7 from Khem Raj  ---
Created attachment 169452
  --> https://bugs.kde.org/attachment.cgi?id=169452=edit
potential fix 2

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

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

2024-05-13 Thread Khem Raj
https://bugs.kde.org/show_bug.cgi?id=454346

--- Comment #6 from Khem Raj  ---
Created attachment 169451
  --> https://bugs.kde.org/attachment.cgi?id=169451=edit
proposed fix.

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

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

2023-01-26 Thread Khem Raj
https://bugs.kde.org/show_bug.cgi?id=382034

--- Comment #12 from Khem Raj  ---
(In reply to Paul Floyd from comment #11)
> If you don't beat me to it I'll probably go ahead and try this tonight.

OK. I wont get to this till weekend.

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

[valgrind] [Bug 464859] Build failures with GCC-13

2023-01-26 Thread Khem Raj
https://bugs.kde.org/show_bug.cgi?id=464859

--- Comment #1 from Khem Raj  ---
Created attachment 155672
  --> https://bugs.kde.org/attachment.cgi?id=155672=edit
fix

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

[valgrind] [Bug 464859] New: Build failures with GCC-13

2023-01-26 Thread Khem Raj
https://bugs.kde.org/show_bug.cgi?id=464859

Bug ID: 464859
   Summary: Build failures with GCC-13
Classification: Developer tools
   Product: valgrind
   Version: 3.21 GIT
  Platform: Other
OS: Other
Status: REPORTED
  Severity: normal
  Priority: NOR
 Component: drd
  Assignee: bart.vanassche+...@gmail.com
  Reporter: raj.k...@gmail.com
  Target Milestone: ---

SUMMARY
***
NOTE: If you are reporting a crash, please try to attach a backtrace with debug
symbols.
See
https://community.kde.org/Guidelines_and_HOWTOs/Debugging/How_to_create_useful_crash_reports
***


STEPS TO REPRODUCE
1. Build tests
2. 
3. 

OBSERVED RESULT

Compile failure

tsan_thread_wrappers_pthread.h:91:9: error: 'int64_t' does not name a type

EXPECTED RESULT


SOFTWARE/OS VERSIONS
Windows: 
macOS: 
Linux/KDE Plasma: 
(available in About System)
KDE Plasma Version: 
KDE Frameworks Version: 
Qt Version: 

ADDITIONAL INFORMATION

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

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

2023-01-25 Thread Khem Raj
https://bugs.kde.org/show_bug.cgi?id=382034

--- Comment #8 from Khem Raj  ---
(In reply to Paul Floyd from comment #6)
> Could you update the patches with expecteds that won't break glibc Linux?

Paul, I do not understand what 'expecteds' you are refrerring to here. If I
understand it better, I will be able to make the needed change

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

[valgrind] [Bug 435732] New: memcheck/tests/leak_cpp_interior fails with gcc11

2021-04-14 Thread Khem Raj
https://bugs.kde.org/show_bug.cgi?id=435732

Bug ID: 435732
   Summary: memcheck/tests/leak_cpp_interior fails with gcc11
   Product: valgrind
   Version: unspecified
  Platform: Other
OS: Linux
Status: REPORTED
  Severity: normal
  Priority: NOR
 Component: memcheck
  Assignee: jsew...@acm.org
  Reporter: raj.k...@gmail.com
  Target Milestone: ---

SUMMARY

Test fails with gcc 11


STEPS TO REPRODUCE
1. compile whole system with gcc11
2. build valgrind from master
3. make tests

OBSERVED RESULT

memcheck/tests/leak_cpp_interior.stderr.diff

--- leak_cpp_interior.stderr.exp
+++ leak_cpp_interior.stderr.out
@@ -9,7 +9,7 @@
definitely lost: x bytes in 1 blocks
indirectly lost: 0 bytes in 0 blocks
  possibly lost: 0 bytes in 0 blocks
-   still reachable: x bytes in 8 blocks
+   still reachable: x bytes in 9 blocks
   of which reachable via heuristic:
 stdstring  : x bytes in 2 blocks
 length64   : x bytes in 1 blocks
@@ -23,7 +23,7 @@
definitely lost: x (+0) bytes in 1 (+0) blocks
indirectly lost: 0 (+0) bytes in 0 (+0) blocks
  possibly lost: x (+x) bytes in 4 (+4) blocks
-   still reachable: x (-x) bytes in 4 (-4) blocks
+   still reachable: x (-x) bytes in 5 (-4) blocks
   of which reachable via heuristic:
 stdstring  : 0 (-x) bytes in 0 (-2) blocks
 length64   : 0 (-x) bytes in 0 (-1) blocks
@@ -35,10 +35,10 @@
 LEAK SUMMARY:
definitely lost: x (+0) bytes in 1 (+0) blocks
indirectly lost: 0 (+0) bytes in 0 (+0) blocks
- possibly lost: x (-x) bytes in 5 (+1) blocks
-   still reachable: x (+x) bytes in 3 (-1) blocks
+ possibly lost: x (-x) bytes in 4 (+0) blocks
+   still reachable: x (+x) bytes in 5 (+0) blocks
   of which reachable via heuristic:
-newarray   : x (+x) bytes in 1 (+1) blocks
+newarray   : x (+x) bytes in 2 (+2) blocks
 multipleinheritance: 0 (-x) bytes in 0 (-2) blocks
 To see details of leaked memory, give 'full' arg to leak_check

@@ -46,11 +46,11 @@
 LEAK SUMMARY:
definitely lost: x (+0) bytes in 1 (+0) blocks
indirectly lost: 0 (+0) bytes in 0 (+0) blocks
- possibly lost: x (-x) bytes in 5 (+0) blocks
-   still reachable: x (+x) bytes in 3 (+0) blocks
+ possibly lost: x (+x) bytes in 5 (+1) blocks
+   still reachable: x (-x) bytes in 4 (-1) blocks
   of which reachable via heuristic:
 length64   : x (+x) bytes in 1 (+1) blocks
-newarray   : 0 (-x) bytes in 0 (-1) blocks
+newarray   : 0 (-x) bytes in 0 (-2) blocks
 To see details of leaked memory, give 'full' arg to leak_check

 leak_check summary heuristics stdstring
@@ -58,7 +58,7 @@
definitely lost: x (+0) bytes in 1 (+0) blocks
indirectly lost: 0 (+0) bytes in 0 (+0) blocks
  possibly lost: x (-x) bytes in 4 (-1) blocks
-   still reachable: x (+x) bytes in 4 (+1) blocks
+   still reachable: x (+x) bytes in 5 (+1) blocks

@@ -82,7 +82,7 @@
definitely lost: x (+0) bytes in 1 (+0) blocks
indirectly lost: 0 (+0) bytes in 0 (+0) blocks
  possibly lost: 0 (+0) bytes in 0 (+0) blocks
-   still reachable: x (+0) bytes in 8 (+0) blocks
+   still reachable: x (+0) bytes in 9 (+0) blocks
   of which reachable via heuristic:
 stdstring  : x (+0) bytes in 2 (+0) blocks
 length64   : x (+0) bytes in 1 (+0) blocks
@@ -95,7 +95,7 @@
definitely lost: x (+0) bytes in 1 (+0) blocks
indirectly lost: 0 (+0) bytes in 0 (+0) blocks
  possibly lost: x (+x) bytes in 6 (+6) blocks
-   still reachable: x (-x) bytes in 2 (-6) blocks
+   still reachable: x (-x) bytes in 3 (-6) blocks
   of which reachable via heuristic:
 stdstring  : 0 (-x) bytes in 0 (-2) blocks
 length64   : 0 (-x) bytes in 0 (-1) blocks
=== Test Summary ===
TOTAL: 736
PASSED: 695
FAILED: 1
SKIPPED: 40
EXPECTED RESULT

No differences

SOFTWARE/OS VERSIONS
Windows: 
macOS: 
Linux/KDE Plasma: Yocto ( master )
(available in About System)
KDE Plasma Version: 
KDE Frameworks Version: 
Qt Version: 

ADDITIONAL INFORMATION

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

[valgrind] [Bug 402480] Do not use %rsp in clobber list

2018-12-23 Thread Khem Raj
https://bugs.kde.org/show_bug.cgi?id=402480

--- Comment #4 from Khem Raj  ---
(In reply to Mark Wielaard from comment #3)
> (In reply to Khem Raj from comment #2)
> > (In reply to Mark Wielaard from comment #1)
> > > So how about just removing the clobber, but keeping stack pointer change
> > > itself:
> >
> > OK that seems fine to me. It will work.
> 
> Thanks. Pushed that to master as:
> 
> commit 022f5af61bc3cbfa2b74ab355b0d2d30b3dab027
> Author: Khem Raj 
> Date:   Sat Dec 22 15:28:40 2018 -0800
> 
> tests/amd64: Do not clobber %rsp register
> 
> This is seen with gcc-9.0 compiler now which is fix that gcc community
> did recently
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=52813
> 
> Signed-off-by: Khem Raj 

Superb Mark, that was quick. Merry Christmas

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

[valgrind] [Bug 402480] Do not use %rsp in clobber list

2018-12-23 Thread Khem Raj
https://bugs.kde.org/show_bug.cgi?id=402480

--- Comment #2 from Khem Raj  ---
(In reply to Mark Wielaard from comment #1)
> Comment on attachment 117070 [details]
> Patch to fix the issue
> 
> While I agree that trying to clobber the stack pointer doesn't make sense
> (and it only "works" because we never return from the asm), the changing of
> the stack pointer itself is deliberate and part of the test (bug #345887 was
> about checking the stack pointer was bogus and not crashing valgrind, even
> though the test program itself does crash).
> 
> Also without the bogus stack pointer the expected output doesn't match
> anymore (because now we get a full backtrace because we can follow the
> stack).
> 
> So how about just removing the clobber, but keeping stack pointer change
> itself:
> 
> diff --git a/none/tests/amd64-linux/bug345887.c
> b/none/tests/amd64-linux/bug345887.c
> index 0f9237d..269bd70 100644
> --- a/none/tests/amd64-linux/bug345887.c
> +++ b/none/tests/amd64-linux/bug345887.c
> @@ -20,13 +20,17 @@ static void inner(void)
>"movq $0x10d, %%r14\n"
>"movq $0x10e, %%r15\n"
>// not %rbp as mdb is then not able to reconstruct stack trace
> +  // Do change %rsp (to test a bogus stack pointer),
> +  // but don't add %rsp to the clobber list since gcc ignores it
> +  // and since gcc >= 9.0 errors about it
> +  // see https://gcc.gnu.org/bugzilla/show_bug.cgi?id=52813
>"movq $0x10f, %%rsp\n"
>"movq $0x1234, (%%rax)\n"  // should cause SEGV here
>"ud2"  // should never get here
>: // no output registers
>: // no input registers
>: "memory", "%rax", "%rbx", "%rcx", "%rdx", "%rsi", "%rdi",
> -"%r8", "%r9", "%r10", "%r11", "%r12", "%r13", "%r14", "%r15",
> "%rsp");
> +"%r8", "%r9", "%r10", "%r11", "%r12", "%r13", "%r14", "%r15");
>  }
>  
>  __attribute__((noinline))


OK that seems fine to me. It will work.

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

[valgrind] [Bug 402480] New: Do not use %rsp in clobber list

2018-12-22 Thread Khem Raj
https://bugs.kde.org/show_bug.cgi?id=402480

Bug ID: 402480
   Summary: Do not use %rsp in clobber list
   Product: valgrind
   Version: 3.15 SVN
  Platform: Other
OS: Linux
Status: REPORTED
  Severity: normal
  Priority: NOR
 Component: general
  Assignee: jsew...@acm.org
  Reporter: raj.k...@gmail.com
  Target Milestone: ---

Created attachment 117070
  --> https://bugs.kde.org/attachment.cgi?id=117070=edit
Patch to fix the issue

SUMMARY

This is a testcase where we are expecting %rsp to be clobbered but its a fixed
register that compiler does not save. This was silently ignored thus far by
gcc, however gcc 9.0 has fixed it and now generates a dignostics error

see
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=52813

STEPS TO REPRODUCE
1. build valgrind with gcc trunk ( would be gcc 9 soon)


OBSERVED RESULT

Compiler error
 ../../../../valgrind-3.14.0/none/tests/amd64-linux/bug345887.c
| ../../../../valgrind-3.14.0/none/tests/amd64-linux/bug345887.c: In function
'inner':
| ../../../../valgrind-3.14.0/none/tests/amd64-linux/bug345887.c:7:4: error:
Stack Pointer register clobbered by '%rsp' in 'a
sm'
| 7 |__asm__ __volatile__(
|   |^~~
| make[5]: *** [Makefile:667: bug345887.o] Error 1

EXPECTED RESULT

No compile error

ADDITIONAL INFORMATION

Seeing this with OpenEmbedded/Yocto cross compile system when upgrading gcc to
trunk

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

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

2018-07-24 Thread Khem Raj
https://bugs.kde.org/show_bug.cgi?id=382034

--- Comment #4 from Khem Raj  ---
musl is an alternative system C library implementation for linux, like glibc or
uclibc and others.

see https://www.musl-libc.org/

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

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

2017-07-05 Thread Khem Raj
https://bugs.kde.org/show_bug.cgi?id=382034

Khem Raj <raj.k...@gmail.com> changed:

   What|Removed |Added

 Attachment #106454|application/mbox|text/plain
  mime type||
 Attachment #106454|0   |1
   is patch||

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

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

2017-07-05 Thread Khem Raj
https://bugs.kde.org/show_bug.cgi?id=382034

--- Comment #2 from Khem Raj <raj.k...@gmail.com> ---
Created attachment 106456
  --> https://bugs.kde.org/attachment.cgi?id=106456=edit
syscall fix

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

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

2017-07-05 Thread Khem Raj
https://bugs.kde.org/show_bug.cgi?id=382034

--- Comment #1 from Khem Raj <raj.k...@gmail.com> ---
Created attachment 106455
  --> https://bugs.kde.org/attachment.cgi?id=106455=edit
x86 fix

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

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

2017-07-05 Thread Khem Raj
https://bugs.kde.org/show_bug.cgi?id=382034

Bug ID: 382034
   Summary: Testcases build fixes for musl
   Product: valgrind
   Version: unspecified
  Platform: Other
OS: Linux
Status: UNCONFIRMED
  Severity: normal
  Priority: NOR
 Component: memcheck
  Assignee: jsew...@acm.org
  Reporter: raj.k...@gmail.com
  Target Milestone: ---

Created attachment 106454
  --> https://bugs.kde.org/attachment.cgi?id=106454=edit
aarch64 fix

While building tests on x86/aarch64 it fails to build few tests. Attached
patches solve the problem, hopefully in a portable way, while keeping the
functionality intact.

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

[valgrind] [Bug 381769] New: Use ucontext_t instead of struct ucontext

2017-06-28 Thread Khem Raj
https://bugs.kde.org/show_bug.cgi?id=381769

Bug ID: 381769
   Summary: Use ucontext_t instead of struct ucontext
   Product: valgrind
   Version: 3.13 SVN
  Platform: Other
OS: Linux
Status: UNCONFIRMED
  Severity: normal
  Priority: NOR
 Component: memcheck
  Assignee: jsew...@acm.org
  Reporter: raj.k...@gmail.com
  Target Milestone: ---

Created attachment 106359
  --> https://bugs.kde.org/attachment.cgi?id=106359=edit
proposed fix

glibc 2.26 does not expose struct ucontext anymore. Attached patch fixes it

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