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

            Bug ID: 476465
           Summary: AArch64 ARMv8.3 LDAPR/LDAPRH/LDAPRB instructions not
                    supported
    Classification: Developer tools
           Product: valgrind
           Version: 3.22 GIT
          Platform: Android
                OS: Android 13.x
            Status: REPORTED
          Severity: normal
          Priority: NOR
         Component: general
          Assignee: jsew...@acm.org
          Reporter: landfillbab...@gmail.com
  Target Milestone: ---

SUMMARY

Exactly what is says in the title.
AArch64 ARMv8.3 LDAPR/LDAPRH/LDAPRB instructions aren't supported by Valgrind
3.22.0.
It's annoying since on my Pixel 6, the linker64 binary itself has these
instructions.


STEPS TO REPRODUCE

On Termux via an ARMv8.3 device running Android 14:
echo 'int main(void) {}' | clang-17 -g -o test -xc - && valgrind ./test

Alternatively, compile and run something like this quick dirty test (just
returns the first byte of itself):
.text
.globl _start
_start:
adrp    x8, _start
add     x8, x8, :lo12:_start
ldaprb  w0, [x8]
mov     x8, #93 // exit
svc     #0


OBSERVED RESULT

==9889== Memcheck, a memory error detector
==9889== Copyright (C) 2002-2022, and GNU GPL'd, by Julian Seward et al.
==9889== Using Valgrind-3.22.0 and LibVEX; rerun with -h for copyright info
==9889== Command: ./test
==9889==
ARM64 front end: load_store
disInstr(arm64): unhandled instruction 0x38BFC109
disInstr(arm64): 0011'1000 1011'1111 1100'0001 0000'1001
==9889== valgrind: Unrecognised instruction at address 0x411e4f0.
==9889==    at 0x411E4F0: __dl__Z26__libc_safe_arc4random_bufPvm (in
/apex/com.android.runtime/bin/linker64)
==9889==    by 0x41235E7: __dl___libc_init_main_thread_late (in
/apex/com.android.runtime/bin/linker64)                                        
                                ==9889==    by 0x40D4F4F:
__dl__ZL29__linker_init_post_relocationR19KernelArgumentBlockR6soinfo (in
/apex/com.android.runtime/bin/linker64)
==9889==    by 0x40D4ECF: __dl___linker_init (in
/apex/com.android.runtime/bin/linker64)
==9889==    by 0x40640B7: __dl__start (in
/apex/com.android.runtime/bin/linker64)       ==9889== Your program just tried
to execute an instruction that Valgrind
==9889== did not recognise.  There are two possible reasons for this.
==9889== 1. Your program has a bug and erroneously jumped to a non-code
==9889==    location.  If you are running Memcheck and you just saw a
==9889==    warning about a bad jump, it's probably your program's fault.
==9889== 2. The instruction is legitimate but Valgrind doesn't handle it,
==9889==    i.e. it's Valgrind's fault.  If you think this is the case or
==9889==    you are not sure, please let us know and we'll try to fix it.
==9889== Either way, Valgrind will now raise a SIGILL signal which will
==9889== probably kill your program.
==9889==
==9889== Process terminating with default action of signal 4 (SIGILL)
==9889==  Illegal opcode at address 0x411E4F0
==9889==    at 0x411E4F0: __dl__Z26__libc_safe_arc4random_bufPvm (in
/apex/com.android.runtime/bin/linker64)
==9889==    by 0x41235E7: __dl___libc_init_main_thread_late (in
/apex/com.android.runtime/bin/linker64)
==9889==    by 0x40D4F4F:
__dl__ZL29__linker_init_post_relocationR19KernelArgumentBlockR6soinfo (in
/apex/com.android.runtime/bin/linker64)                                    
==9889==    by 0x40D4ECF: __dl___linker_init (in
/apex/com.android.runtime/bin/linker64)
==9889==    by 0x40640B7: __dl__start (in
/apex/com.android.runtime/bin/linker64)       ==9889==
==9889== HEAP SUMMARY:                                                         
        ==9889==     in use at exit: 0 bytes in 0 blocks
==9889==   total heap usage: 0 allocs, 0 frees, 0 bytes allocated              
        ==9889==
==9889== All heap blocks were freed -- no leaks are possible
==9889==
==9889== For lists of detected and suppressed errors, rerun with: -s
==9889== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
Illegal instruction

Note: 0x38BFC109 is ldaprb w9, [x8]


EXPECTED RESULT

No failure.

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

Reply via email to