| Summary: | Program under valgrind calculates complex exp() wrongly | ||
|---|---|---|---|
| Product: | [Developer tools] valgrind | Reporter: | Kazeev Nikita <kazeevn> |
| Component: | general | Assignee: | Julian Seward <jseward> |
| Status: | REPORTED --- | ||
| Severity: | normal | ||
| Priority: | NOR | ||
| Version First Reported In: | 3.7.0 | ||
| Target Milestone: | --- | ||
| Platform: | Ubuntu | ||
| OS: | Linux | ||
| Latest Commit: | Version Fixed/Implemented In: | ||
| Sentry Crash Report: | |||
| Attachments: |
The example binay compiled by the Inter compiler
Test source code. |
||
Created attachment 86173 [details]
Test source code.
kna@nwo2|~|0% uname -a Linux nwo2 3.2.0-60-generic-pae #91-Ubuntu SMP Wed Feb 19 04:14:56 UTC 2014 i686 i686 i386 GNU/Linux Expected output (no valgrind): kna@nwo2|~/source_tree|1% ./exptest 0.122456 0.122456 Valgrind output: kna@nwo2|~/source_tree|0% valgrind -v ./exptest ==1532== Memcheck, a memory error detector ==1532== Copyright (C) 2002-2011, and GNU GPL'd, by Julian Seward et al. ==1532== Using Valgrind-3.7.0 and LibVEX; rerun with -h for copyright info ==1532== Command: ./exptest ==1532== --1532-- Valgrind options: --1532-- --suppressions=/usr/lib/valgrind/debian-libc6-dbg.supp --1532-- -v --1532-- Contents of /proc/version: --1532-- Linux version 3.2.0-60-generic-pae (buildd@allspice) (gcc version 4.6.3 (Ubuntu/Linaro 4.6.3-1ubuntu5) ) #91-Ubuntu SMP Wed Feb 19 04:14:56 UTC 2014 --1532-- Arch and hwcaps: X86, x86-sse1-sse2 --1532-- Page sizes: currently 4096, max supported 4096 --1532-- Valgrind library directory: /usr/lib/valgrind --1532-- Reading syms from /lib/i386-linux-gnu/ld-2.15.so (0x4000000) --1532-- Considering /lib/i386-linux-gnu/ld-2.15.so .. --1532-- .. CRC mismatch (computed 72502f98 wanted 90076620) --1532-- Considering /usr/lib/debug/lib/i386-linux-gnu/ld-2.15.so .. --1532-- .. CRC is valid --1532-- Reading syms from /home/kna/source_tree/exptest (0x8048000) --1532-- Reading syms from /usr/lib/valgrind/memcheck-x86-linux (0x38000000) --1532-- Considering /usr/lib/valgrind/memcheck-x86-linux .. --1532-- .. CRC mismatch (computed 2a2bce46 wanted 9ac1affc) --1532-- object doesn't have a symbol table --1532-- object doesn't have a dynamic symbol table --1532-- Reading suppressions file: /usr/lib/valgrind/debian-libc6-dbg.supp --1532-- Reading suppressions file: /usr/lib/valgrind/default.supp ==1532== embedded gdbserver: reading from /tmp/vgdb-pipe-from-vgdb-to-1532-by-kna-on-??? ==1532== embedded gdbserver: writing to /tmp/vgdb-pipe-to-vgdb-from-1532-by-kna-on-??? ==1532== embedded gdbserver: shared mem /tmp/vgdb-pipe-shared-mem-vgdb-1532-by-kna-on-??? ==1532== ==1532== TO CONTROL THIS PROCESS USING vgdb (which you probably ==1532== don't want to do, unless you know exactly what you're doing, ==1532== or are doing some strange experiment): ==1532== /usr/lib/valgrind/../../bin/vgdb --pid=1532 ...command... ==1532== ==1532== TO DEBUG THIS PROCESS USING GDB: start GDB like this ==1532== /path/to/gdb ./exptest ==1532== and then give GDB the following command ==1532== target remote | /usr/lib/valgrind/../../bin/vgdb --pid=1532 ==1532== --pid is optional if only one valgrind process is running ==1532== --1532-- REDIR: 0x40182e0 (strlen) redirected to 0x38056b04 (???) --1532-- REDIR: 0x4018060 (index) redirected to 0x38056adf (???) --1532-- Reading syms from /usr/lib/valgrind/vgpreload_core-x86-linux.so (0x4025000) --1532-- Considering /usr/lib/valgrind/vgpreload_core-x86-linux.so .. --1532-- .. CRC mismatch (computed 33f4d79f wanted ac058c14) --1532-- object doesn't have a symbol table --1532-- Reading syms from /usr/lib/valgrind/vgpreload_memcheck-x86-linux.so (0x4028000) --1532-- Considering /usr/lib/valgrind/vgpreload_memcheck-x86-linux.so .. --1532-- .. CRC mismatch (computed 8c6a0645 wanted b38afa17) --1532-- object doesn't have a symbol table --1532-- Reading syms from /lib/i386-linux-gnu/libm-2.15.so (0x404d000) --1532-- Considering /lib/i386-linux-gnu/libm-2.15.so .. --1532-- .. CRC mismatch (computed 6ee9373d wanted 98815fe2) --1532-- Considering /usr/lib/debug/lib/i386-linux-gnu/libm-2.15.so .. --1532-- .. CRC is valid --1532-- Reading syms from /usr/lib/i386-linux-gnu/libstdc++.so.6.0.16 (0x4079000) --1532-- Considering /usr/lib/i386-linux-gnu/libstdc++.so.6.0.16 .. --1532-- .. CRC mismatch (computed 623761b6 wanted 2e01ae44) --1532-- object doesn't have a symbol table --1532-- Reading syms from /lib/i386-linux-gnu/libgcc_s.so.1 (0x415e000) --1532-- Considering /lib/i386-linux-gnu/libgcc_s.so.1 .. --1532-- .. CRC mismatch (computed 679327fe wanted cd8c80b8) --1532-- object doesn't have a symbol table --1532-- Reading syms from /lib/i386-linux-gnu/libc-2.15.so (0x417c000) --1532-- Considering /lib/i386-linux-gnu/libc-2.15.so .. --1532-- .. CRC mismatch (computed 17ac398b wanted 58914b22) --1532-- Considering /usr/lib/debug/lib/i386-linux-gnu/libc-2.15.so .. --1532-- .. CRC is valid --1532-- Reading syms from /lib/i386-linux-gnu/libdl-2.15.so (0x4326000) --1532-- Considering /lib/i386-linux-gnu/libdl-2.15.so .. --1532-- .. CRC mismatch (computed 1b31a2a1 wanted 2c5f1f7d) --1532-- Considering /usr/lib/debug/lib/i386-linux-gnu/libdl-2.15.so .. --1532-- .. CRC is valid --1532-- REDIR: 0x41fa0b0 (strnlen) redirected to 0x40254a0 (_vgnU_ifunc_wrapper) --1532-- REDIR: 0x41fb600 (strncasecmp) redirected to 0x40254a0 (_vgnU_ifunc_wrapper) --1532-- REDIR: 0x41fa250 (__GI_strrchr) redirected to 0x402c1b0 (__GI_strrchr) --1532-- REDIR: 0x41f9ff0 (__GI_strlen) redirected to 0x402c670 (__GI_strlen) --1532-- REDIR: 0x41f9800 (strcmp) redirected to 0x40254a0 (_vgnU_ifunc_wrapper) --1532-- REDIR: 0x42bb970 (__strcmp_ssse3) redirected to 0x402d280 (strcmp) --1532-- REDIR: 0x41fb790 (memcpy) redirected to 0x40254a0 (_vgnU_ifunc_wrapper) --1532-- REDIR: 0x42b2370 (__memcpy_ssse3) redirected to 0x402d930 (memcpy) --1532-- REDIR: 0x41face0 (bcmp) redirected to 0x40254a0 (_vgnU_ifunc_wrapper) --1532-- REDIR: 0x42c3850 (__memcmp_ssse3) redirected to 0x402e460 (bcmp) --1532-- REDIR: 0x41fc920 (strchrnul) redirected to 0x402ebe0 (strchrnul) --1532-- REDIR: 0x41f6260 (free) redirected to 0x402b000 (free) --1532-- REDIR: 0x41faaf0 (memchr) redirected to 0x40254a0 (_vgnU_ifunc_wrapper) --1532-- REDIR: 0x42122f0 (__memchr_sse2_bsf) redirected to 0x402d400 (memchr) 0.122456 0.150615 ==1532== ==1532== HEAP SUMMARY: ==1532== in use at exit: 0 bytes in 0 blocks ==1532== total heap usage: 0 allocs, 0 frees, 0 bytes allocated ==1532== ==1532== All heap blocks were freed -- no leaks are possible ==1532== ==1532== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0) ==1532== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0) |
Created attachment 86172 [details] The example binay compiled by the Inter compiler Program returns wrong value for complex exp() when run under valgrind. The programm is attached. The error occurs only for binary produced by the Intel compiler, the one by g++ works fine. Compilation commmand: icpc -g -O0 -Wall -Werror exptest.cpp -o exptest Enviroment: Ubuntu 12.04, valgrind 3.7.0, icpc (ICC) 14.0.2 20140120, g++ (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3