https://bugs.kde.org/show_bug.cgi?id=424034
Bug ID: 424034 Summary: valgrind (memcheck) causes some programs to fail with SIGILL that do not normally fail Product: valgrind Version: unspecified Platform: Other OS: Linux Status: REPORTED Severity: normal Priority: NOR Component: memcheck Assignee: jsew...@acm.org Reporter: joseph.jenn...@gmail.com Target Milestone: --- SUMMARY valgrind causes some commands run under it to fail with SIGILL that normally succeed. STEPS TO REPRODUCE 1. Compile python3.10 from the git repo (heads/master:48289b6096) 2. Run `valgrind python3.10 -m json.tool` with an input JSON file provided from stdin and output to `/dev/null` 3. Run the same command without valgrind and observe that it does not fail OBSERVED RESULT usera@kali ~ % valgrind python3.10 -m json.tool < Documents/dump.json > /dev/null ==712008== Memcheck, a memory error detector ==712008== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al. ==712008== Using Valgrind-3.16.1 and LibVEX; rerun with -h for copyright info ==712008== Command: python3.10 -m json.tool ==712008== vex amd64->IR: unhandled instruction bytes: 0x8F 0xE9 0xF8 0x9B 0x5 0x5B 0x61 0xC 0x0 0xB8 vex amd64->IR: REX=0 REX.W=0 REX.R=0 REX.X=0 REX.B=0 vex amd64->IR: VEX=0 VEX.L=0 VEX.nVVVV=0x0 ESC=NONE vex amd64->IR: PFX.66=0 PFX.F2=0 PFX.F3=0 ==712008== valgrind: Unrecognised instruction at address 0x6316ac. ==712008== at 0x6316AC: UnknownInlinedFun (getpath.c:0) ==712008== by 0x6316AC: UnknownInlinedFun (getpath.c:1522) ==712008== by 0x6316AC: UnknownInlinedFun (getpath.c:1605) ==712008== by 0x6316AC: UnknownInlinedFun (pathconfig.c:318) ==712008== by 0x6316AC: UnknownInlinedFun (pathconfig.c:336) ==712008== by 0x6316AC: UnknownInlinedFun (pathconfig.c:403) ==712008== by 0x6316AC: config_read (initconfig.c:1752) ==712008== by 0x6316AC: PyConfig_Read (initconfig.c:2536) ==712008== by 0x63FE7E: pyinit_core (pylifecycle.c:928) ==712008== by 0x63FE7E: Py_InitializeFromConfig (pylifecycle.c:1144) ==712008== by 0x420F6D: pymain_init (main.c:66) ==712008== by 0x420D20: pymain_main (main.c:694) ==712008== by 0x41F5FB: UnknownInlinedFun (main.c:727) ==712008== by 0x41F5FB: main (python.c:15) ==712008== Your program just tried to execute an instruction that Valgrind ==712008== did not recognise. There are two possible reasons for this. ==712008== 1. Your program has a bug and erroneously jumped to a non-code ==712008== location. If you are running Memcheck and you just saw a ==712008== warning about a bad jump, it's probably your program's fault. ==712008== 2. The instruction is legitimate but Valgrind doesn't handle it, ==712008== i.e. it's Valgrind's fault. If you think this is the case or ==712008== you are not sure, please let us know and we'll try to fix it. ==712008== Either way, Valgrind will now raise a SIGILL signal which will ==712008== probably kill your program. ==712008== ==712008== Process terminating with default action of signal 4 (SIGILL) ==712008== Illegal opcode at address 0x6316AC ==712008== at 0x6316AC: UnknownInlinedFun (getpath.c:0) ==712008== by 0x6316AC: UnknownInlinedFun (getpath.c:1522) ==712008== by 0x6316AC: UnknownInlinedFun (getpath.c:1605) ==712008== by 0x6316AC: UnknownInlinedFun (pathconfig.c:318) ==712008== by 0x6316AC: UnknownInlinedFun (pathconfig.c:336) ==712008== by 0x6316AC: UnknownInlinedFun (pathconfig.c:403) ==712008== by 0x6316AC: config_read (initconfig.c:1752) ==712008== by 0x6316AC: PyConfig_Read (initconfig.c:2536) ==712008== by 0x63FE7E: pyinit_core (pylifecycle.c:928) ==712008== by 0x63FE7E: Py_InitializeFromConfig (pylifecycle.c:1144) ==712008== by 0x420F6D: pymain_init (main.c:66) ==712008== by 0x420D20: pymain_main (main.c:694) ==712008== by 0x41F5FB: UnknownInlinedFun (main.c:727) ==712008== by 0x41F5FB: main (python.c:15) ==712008== ==712008== HEAP SUMMARY: ==712008== in use at exit: 1,548 bytes in 31 blocks ==712008== total heap usage: 109 allocs, 78 frees, 16,207 bytes allocated ==712008== ==712008== LEAK SUMMARY: ==712008== definitely lost: 188 bytes in 2 blocks ==712008== indirectly lost: 0 bytes in 0 blocks ==712008== possibly lost: 0 bytes in 0 blocks ==712008== still reachable: 1,360 bytes in 29 blocks ==712008== suppressed: 0 bytes in 0 blocks ==712008== Rerun with --leak-check=full to see details of leaked memory ==712008== ==712008== For lists of detected and suppressed errors, rerun with: -s ==712008== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0) [1] 712008 illegal hardware instruction valgrind python3.10 -m json.tool < Documents/dump.json > /dev/null 132 usera@kali ~ % python3.10 -m json.tool < Documents/dump.json > /dev/null usera@kali ~ % EXPECTED RESULT SOFTWARE/OS VERSIONS Windows: macOS: Linux/KDE Plasma: 5.6.0 (available in About System) KDE Plasma Version: 5.17.5 KDE Frameworks Version: 5.70.0 Qt Version: 5.12.5 ADDITIONAL INFORMATION valgrind version 3.16.1 Python version info: Python 3.10.0a0 (heads/master:48289b6096, Jun 28 2020, 18:17:13) [Clang 9.0.1 ] on linux -- You are receiving this mail because: You are watching all bug changes.