Bug 593771 - valgrind issues error on ppc64 sysconf (_SC_PHYS_PAGES)
Summary: valgrind issues error on ppc64 sysconf (_SC_PHYS_PAGES)
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: glibc
Version: 6.0
Hardware: All
OS: Linux
Target Milestone: rc
: ---
Assignee: Andreas Schwab
QA Contact: Petr Muller
Depends On:
TreeView+ depends on / blocked
Reported: 2010-05-19 16:46 UTC by Jakub Jelinek
Modified: 2016-11-24 12:03 UTC (History)
3 users (show)

Fixed In Version: glibc-2.12-1.3.el6
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2010-11-10 20:29:18 UTC
Target Upstream Version:

Attachments (Terms of Use)

System ID Priority Status Summary Last Updated
GNU Compiler Collection 44199 None None None Never

Description Jakub Jelinek 2010-05-19 16:46:18 UTC
valgrind /bin/sh
or just valgrind on a simple:
#include <stdio.h>
#include <unistd.h>

main (void)
  printf ("%ld\n", sysconf (_SC_PHYS_PAGES));
  return 0;
results in errors like:
==13654== Invalid read of size 8
==13654==    at 0x802A9BB824: _IO_vfscanf@@GLIBC_2.4 (in /lib64/libc-2.12.so)
==13654==    by 0x802A9C696B: sscanf@@GLIBC_2.4 (in /lib64/libc-2.12.so)
==13654==    by 0x802AA57B4B: phys_pages_info (in /lib64/libc-2.12.so)
==13654==    by 0x802AA17E1B: sysconf (in /lib64/libc-2.12.so)
==13654==    by 0x100005C3: main (in /tmp/z)
==13654==  Address 0x7ff00cb20 is just below the stack ptr.  To suppress, use: --workaround-gcc296-bugs=yes

Could be a valgrind bug or glibc bug or gcc bug.
In any case, valgrind should be tested on several common programs on each of the RHEL6 arches where valgrind is included to make sure there aren't similar problems in RHEL6 GA.

Comment 2 Jakub Jelinek 2010-05-19 18:28:50 UTC
Seems this isn't a bug in valgrind.

   0x802a9bb81c <._IO_vfscanf+732>:	std     r10,592(r31)
   0x802a9bb820 <._IO_vfscanf+736>:	addi    r1,r31,960
=> 0x802a9bb824 <._IO_vfscanf+740>:	ld      r3,592(r31)

As can be clearly seen, the stack pointer is first incremented and $r31+592 is below the 288 bytes long red zone.  So, very likely a gcc bug, going to build glibc now and see if I can reproduce it.

Comment 3 Jakub Jelinek 2010-05-19 18:30:45 UTC
Ok, it is really a gcc bug, tracking it in http://gcc.gnu.org/PR44199.
Once gcc is fixed, glibc will need to be rebuilt.

Comment 5 Jakub Jelinek 2010-05-31 12:31:53 UTC
Note the fixed gcc is already in SNapshot 5, so all that is needed to fix this bug is rebuild glibc.

Comment 7 Petr Muller 2010-08-18 15:24:40 UTC
Reproduced on ppc with old glibc, disappeared with new glibc. Moving to VERIFIED.

Comment 8 releng-rhel@redhat.com 2010-11-10 20:29:18 UTC
Red Hat Enterprise Linux 6.0 is now available and should resolve
the problem described in this bug report. This report is therefore being closed
with a resolution of CURRENTRELEASE. You may reopen this bug report if the
solution does not work for you.

Note You need to log in before you can comment on or make changes to this bug.