https://bugs.kde.org/show_bug.cgi?id=441109

--- Comment #1 from William Ashley <w...@amazon.com> ---
To expand on this a bit, here's a sweep through all of the 'str' sizes:

#include <stdlib.h>
int main(void) {
    char *ptr = malloc(256);
    ptr += 256;
    asm volatile ("str b0, [%0]" :: "r" (ptr) : "b0", "memory");
    asm volatile ("str h0, [%0]" :: "r" (ptr) : "h0", "memory");
    asm volatile ("str s0, [%0]" :: "r" (ptr) : "s0", "memory");
    asm volatile ("str d0, [%0]" :: "r" (ptr) : "d0", "memory");
    asm volatile ("str q0, [%0]" :: "r" (ptr) : "q0", "memory");
    free(ptr - 256);
    return 0;
}

which under the latest valgrind release shows the expected sizes except for q

==5990== Invalid write of size 1
==5990==    at 0x400608: main (strtest.c:5)
==5990==  Address 0x4a1a140 is 0 bytes after a block of size 256 alloc'd
==5990==    at 0x48682A4: malloc (vg_replace_malloc.c:431)
==5990==    by 0x4005F3: main (strtest.c:3)
==5990== 
==5990== Invalid write of size 2
==5990==    at 0x400610: main (strtest.c:6)
==5990==  Address 0x4a1a140 is 0 bytes after a block of size 256 alloc'd
==5990==    at 0x48682A4: malloc (vg_replace_malloc.c:431)
==5990==    by 0x4005F3: main (strtest.c:3)
==5990== 
==5990== Invalid write of size 4
==5990==    at 0x400618: main (strtest.c:7)
==5990==  Address 0x4a1a140 is 0 bytes after a block of size 256 alloc'd
==5990==    at 0x48682A4: malloc (vg_replace_malloc.c:431)
==5990==    by 0x4005F3: main (strtest.c:3)
==5990== 
==5990== Invalid write of size 8
==5990==    at 0x400620: main (strtest.c:8)
==5990==  Address 0x4a1a140 is 0 bytes after a block of size 256 alloc'd
==5990==    at 0x48682A4: malloc (vg_replace_malloc.c:431)
==5990==    by 0x4005F3: main (strtest.c:3)
==5990== 
==5990== Invalid write of size 8
==5990==    at 0x400628: main (strtest.c:9)
==5990==  Address 0x4a1a140 is 0 bytes after a block of size 256 alloc'd
==5990==    at 0x48682A4: malloc (vg_replace_malloc.c:431)
==5990==    by 0x4005F3: main (strtest.c:3)

Decode for the 'q' case does look correct (GET:V128, so it would be a 16-byte
value)

        (arm64) 0x400628:  str q0, [x0, #0]
              ------ IMark(0x400628, 4, 0) ------
              t21 = Add64(GET:I64(16),0x0:I64)
              STle(t21) = GET:V128(320)
              PUT(272) = 0x40062C:I64

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

Reply via email to