From: Lars C. <la...@be...> - 2018-03-16 10:16:31
|
When I compile this simple C++ program as a 32-bit executable on a 64-bit linux: #include <iostream> int main() { std::cout << "Hello, World!" << std::endl; return 0; } Using the -m32 option: g++ -m32 out.cpp Valgrind chokes on an supposedly illegal instruction: vex x86->IR: unhandled instruction bytes: 0x67 0xE8 0x7D 0xFF ==18453== valgrind: Unrecognised instruction at address 0x48cc63d. ==18453== at 0x48CC63D: std::locale::locale() (locale_init.cc:250) ==18453== by 0x48C90DD: basic_streambuf (streambuf:466) ==18453== by 0x48C90DD: stdio_sync_filebuf (stdio_sync_filebuf.h:80) ==18453== by 0x48C90DD: std::ios_base::Init::Init() (ios_init.cc:85) ==18453== by 0x108793: __static_initialization_and_destruction_0(int, int) (in /home/lac/a.out) ==18453== by 0x1087DB: _GLOBAL__sub_I_main (in /home/lac/a.out) ==18453== by 0x10883A: __libc_csu_init (in /home/lac/a.out) ==18453== by 0x4ABC724: (below main) (in /usr/lib32/libc-2.26.so) The program works fine on its own though. Same program compiled for amd64 runs fine with valgrind. An equivalent program written in C (using printf) works just fine with valgrind, even when compiled for x86. Bug or user error? $ valgrind --version valgrind-3.13.0 $ uname -a Linux lnx 4.14.12-1-ARCH #1 SMP PREEMPT Fri Jan 5 18:19:34 UTC 2018 x86_64 GNU/Linux |