https://bugs.kde.org/show_bug.cgi?id=466998
Bug ID: 466998 Summary: Illegal instruction on ARMv7 Classification: Developer tools Product: valgrind Version: 3.20.0 Platform: unspecified OS: Linux Status: REPORTED Severity: normal Priority: NOR Component: memcheck Assignee: jsew...@acm.org Reporter: david.dilore...@verizonconnect.com Target Milestone: --- SUMMARY Valgrind does not recognize an instruction when executing code from an external shared library, and thus generates a SIGILL. Memcheck did not report any bad jumps, so it might indeed be an issue with valgrind not recognizing the instruction. There is also an unhandled arm-linux syscall, which I am not sure if it's related. STEPS TO REPRODUCE The instruction not recognized by valgrind is contained within an external library, which unfortunately I cannot legally share. I realize it's usually pointless to submit a bug report without enabling you to reproduce the issue, but in this case maybe knowing the unrecognized instruction opcode might be enough? (I am no expert). See below for the full valgrind log, including the unrecognized opcode. OBSERVED RESULT Here is the valgrind log: ==9735== Memcheck, a memory error detector ==9735== Copyright (C) 2002-2022, and GNU GPL'd, by Julian Seward et al. ==9735== Using Valgrind-3.20.0 and LibVEX; rerun with -h for copyright info ==9735== Command: ./dr_app_simulator frame0.yuv 800 554 ==9735== ==9735== Conditional jump or move depends on uninitialised value(s) ==9735== at 0x4F4DA7C: ??? (in /opt/lib/libSNPE.so) ==9735== ==9735== Use of uninitialised value of size 4 ==9735== at 0x4F4DA7E: ??? (in /opt/lib/libSNPE.so) ==9735== --9735-- WARNING: unhandled arm-linux syscall: 345 --9735-- You may be able to write your own handler. --9735-- Read the file README_MISSING_SYSCALL_OR_IOCTL. --9735-- Nevertheless we consider this a bug. Please report --9735-- it at http://valgrind.org/support/bug_reports.html. --9735-- WARNING: unhandled arm-linux syscall: 345 --9735-- You may be able to write your own handler. --9735-- Read the file README_MISSING_SYSCALL_OR_IOCTL. --9735-- Nevertheless we consider this a bug. Please report --9735-- it at http://valgrind.org/support/bug_reports.html. disInstr(thumb): unhandled instruction: 0xEF0C 0x0CF6 ==9735== valgrind: Unrecognised instruction at address 0x4e927d3. ==9735== at 0x4E927D2: ??? (in /opt/lib/libSNPE.so) ==9735== Your program just tried to execute an instruction that Valgrind ==9735== did not recognise. There are two possible reasons for this. ==9735== 1. Your program has a bug and erroneously jumped to a non-code ==9735== location. If you are running Memcheck and you just saw a ==9735== warning about a bad jump, it's probably your program's fault. ==9735== 2. The instruction is legitimate but Valgrind doesn't handle it, ==9735== i.e. it's Valgrind's fault. If you think this is the case or ==9735== you are not sure, please let us know and we'll try to fix it. ==9735== Either way, Valgrind will now raise a SIGILL signal which will ==9735== probably kill your program. ==9735== ==9735== Process terminating with default action of signal 4 (SIGILL) ==9735== Illegal opcode at address 0x4E927D3 ==9735== at 0x4E927D2: ??? (in /opt/lib/libSNPE.so) ==9735== ==9735== HEAP SUMMARY: ==9735== in use at exit: 0 bytes in 0 blocks ==9735== total heap usage: 0 allocs, 0 frees, 0 bytes allocated ==9735== ==9735== All heap blocks were freed -- no leaks are possible ==9735== ==9735== Use --track-origins=yes to see where uninitialised values come from ==9735== For lists of detected and suppressed errors, rerun with: -s ==9735== ERROR SUMMARY: 2 errors from 2 contexts (suppressed: 0 from 0) Illegal instruction EXPECTED RESULT Valgrind should recognize the opcode. Note that when executed directly (without valgrind), the program runs normally, so I don't think there is an actual illegal instruction in the library itself. SOFTWARE/OS VERSIONS I am working on a ARM embedded device, here is the output of uname -a Linux phoenix 3.18.115 #3 SMP PREEMPT Sat Jan 14 13:19:03 KST 2023 armv7l GNU/Linux Note that the hardware supports 64bit, but the installed OS is 32bit. ADDITIONAL INFORMATION I also tried running valgrind with the --smc-check=all option, as suggested here https://valgrind-users.narkive.com/r2fTd4tQ/how-can-ignore-lib-containing-unrecognized-instruction-illegal-opcode However, the output remains the same. -- You are receiving this mail because: You are watching all bug changes.