Summary: | C++ program outputs floats to stdout as 11.111 through valgrind | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | corto <turner25> |
Component: | [OLD] Development | Assignee: | Anthony Basile <blueness> |
Status: | RESOLVED CANTFIX | ||
Severity: | normal | CC: | turner25 |
Priority: | Normal | ||
Version: | unspecified | ||
Hardware: | AMD64 | ||
OS: | Linux | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Attachments: |
valgrind_float_test.cpp
emerge --info (on affected computer) emerge --info (on *unaffected* 32 bit computer) emerge --info on a similar system cpuinfo from affected system (running as vbox guest) kernel .config (gentoo-sources 3.14.14) |
Description
corto
2015-06-18 13:34:49 UTC
Created attachment 405326 [details]
valgrind_float_test.cpp
Simple C++ program that shows the bug in action.
Created attachment 405328 [details]
emerge --info (on affected computer)
Ouput from `emerge --info` on the computer where the bug is present.
Created attachment 405332 [details]
emerge --info (on *unaffected* 32 bit computer)
Output from `emerge --info` on the 32bit computer referred from the description. The bug is not present on that computer.
An even simpler test case program is this one: #include <iostream> int main(int argc, char* argv[]){ std::cout << 3.14159 << std::endl << 314.159 << std::endl; return 0; } ---------------- When run normally, this program outputs: 3.14159 314.159 When run through valgrind, it outputs: 3.14159 111.111 So is this a toolchain issue, or a valgrind issue? Who do I assign this bug to? I can't decide myself given that I'm not sure where the problem comes from. I only witnessed problems when using valgrind and I only use it to diagnose my own programs. Created attachment 405472 [details]
emerge --info on a similar system
I'm not able to reproduce this on a similar, so I'm not sure what's going on here. Here's what I'm getting:
amd64-hardened-gdb ~ # valgrind -q ./valgrind_float_test.elf
0 4.7 9.4 14.1 18.8 23.5 28.2 32.9 37.6 42.3 47 51.7 56.4 61.1 65.8 70.5 75.2 79.9 84.6 89.3 94 98.7
valgrind is very fragile. There are difference between our systems but I'm reluctant to start guessing. The one big difference is that my system is hardened, but a hardened toolchains usually causes, not "fixes", issues like this
(In reply to Anthony Basile from comment #7) > > valgrind is very fragile. There are difference between our systems but I'm > reluctant to start guessing. The one big difference is that my system is > hardened, but a hardened toolchains usually causes, not "fixes", issues like > this I just noticed that you are using the hardened profile, but not a hardened kernel but something else. Can you explain how your system is different that a typical hardened system (whatever that might mean). Also can you give me your cpu flags `cat /proc/cpuinfo` I wasn't aware the kernel had any influence in this matter. There sure are many difference here. I'll describe them and try to reduce the differences later. Firstly, this machine runs within VirtualBox. The additions (kernel modules) have been compiled from those shipped with the executable. The host runs windows 8.1. I'll try to run it natively, this will take a lot of time. Secondly, the kernel I use is gentoo-sources 3.14.14. I haven't updated or recompiled it in a while for no special reason. I'll try to update it to something stable and more recent. I'll start by removing vbox from the equation, but this may take a day or two, so let me know if you have different priorities in mind. Created attachment 405476 [details]
cpuinfo from affected system (running as vbox guest)
Created attachment 405478 [details]
kernel .config (gentoo-sources 3.14.14)
valgrind works as expected when running with this system natively (without vbox). It is not practical to use this system without vbox, so I'd be interested to hear suggestions. Thanks! (In reply to corto from comment #12) > valgrind works as expected when running with this system natively (without > vbox). > > It is not practical to use this system without vbox, so I'd be interested to > hear suggestions. > > Thanks! Sorry no ideas here and I can't reproduce. Can you push this upstream. This is a corner case bug which I can't really fix. If you want, push it upstream. I'm closing this bug report as cantfix. |