[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-bugs-dist
Subject:    [valgrind] [Bug 386397] New: valgrind truncates powerpc timebase to 32-bits
From:       Carl Love <bugzilla_noreply () kde ! org>
Date:       2017-10-31 18:38:04
Message-ID: bug-386397-17878 () http ! bugs ! kde ! org/
[Download RAW message or body]

https://bugs.kde.org/show_bug.cgi?id=386397

            Bug ID: 386397
           Summary: valgrind truncates powerpc timebase to 32-bits
           Product: valgrind
           Version: 3.14 SVN
          Platform: Other
                OS: Linux
            Status: UNCONFIRMED
          Severity: normal
          Priority: NOR
         Component: vex
          Assignee: jseward@acm.org
          Reporter: cel@us.ibm.com
  Target Milestone: ---

---Problem Description---
Valgrind is incorrectly modeling the PowerPC timebase register as 32-bit. 
Should be 64-bit.  

---uname output---
Linux c650f07p23 4.11.0-42.el7a.ppc64le #1 SMP Mon Oct 9 12:00:22 EDT 2017
ppc64le ppc64le ppc64le GNU/Linux

Machine Type = 8335-GTC 

---Debugger---
A debugger is not configured

---Steps to Reproduce---
 Compile the following example using "gcc -o tb tb.c" and execute.  Without
Valgrind, program will display timebase as 64-bit values.  With Valgrind,
timebase will be limited to 32-bit values and the 2nd timebase printf may
appear to be lesser than the first timebase printf.

#include <stdio.h>
#include <sys/platform/ppc.h>

int main(int argc, char** argv)
{
    uint64_t tb = __ppc_get_timebase();
    printf("timebase = %lx\n", tb);
    sleep(15);
    tb = __ppc_get_timebase();
    printf("timebase = %lx\n", tb);

    return 0;
}


Contact Information = Tom Gooding / tgooding@us.ibm.com 

Userspace tool common name: valgrind 

The userspace tool has the following bit modes: 64-bit 

Userspace rpm: valgrind-3.12.0-9.el7_4.ppc64le 

Userspace tool obtained from project website:  na 

*Additional Instructions for Tom Gooding / tgooding@us.ibm.com:
-Attach ltrace and strace of userspace application.

[reply] [-]
Internal Only
Comment 1 Thomas M. Gooding 2017-10-30 22:48:33 CDT

output:

bash-4.2$ ./tb
timebase = 3be626e90262
timebase = 3be7f0ad4167




bash-4.2$ valgrind ./tb
==89099== Memcheck, a memory error detector
==89099== Copyright (C) 2002-2015, and GNU GPL'd, by Julian Seward et al.
==89099== Using Valgrind-3.12.0 and LibVEX; rerun with -h for copyright info
==89099== Command: ./tb
==89099== 
timebase = 8ab00ec0
timebase = 552cacc9
==89099== 
==89099== HEAP SUMMARY:
==89099==     in use at exit: 0 bytes in 0 blocks
==89099==   total heap usage: 0 allocs, 0 frees, 0 bytes allocated
==89099== 
==89099== All heap blocks were freed -- no leaks are possible
==89099== 
==89099== For counts of detected and suppressed errors, rerun with: -v
==89099== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)


Issue reported by  Thomas M. Gooding

-- 
You are receiving this mail because:
You are watching all bug changes.=
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic