Bug 169485
Summary: | bad DWARF info: frame_base wrong | ||
---|---|---|---|
Product: | Red Hat Enterprise Linux 4 | Reporter: | Roland McGrath <roland> |
Component: | gcc | Assignee: | Jakub Jelinek <jakub> |
Status: | CLOSED ERRATA | QA Contact: | |
Severity: | medium | Docs Contact: | |
Priority: | medium | ||
Version: | 4.0 | CC: | aoliva, ezannoni, fche, poelstra |
Target Milestone: | --- | ||
Target Release: | --- | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | |||
Fixed In Version: | RHBA-2006-0125 | Doc Type: | Bug Fix |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2006-03-07 18:46:04 UTC | Type: | --- |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: | |||
Bug Depends On: | |||
Bug Blocks: | 168429, 176182 |
Description
Roland McGrath
2005-09-28 19:20:37 UTC
Self-contained testcase: /* { dg-options "-Os -fno-unit-at-a-time -march=i686 -g -fomit-frame-pointer -fverbose-asm -dA -m32" } */ struct timeval { unsigned long tv_sec; unsigned long tv_usec; }; extern void do_gettimeofday (struct timeval *tv); struct L { unsigned long buf[100]; }; struct T { int pad[6]; unsigned long addr_limit; }; static inline struct T * current_T (void) { struct T *ti; __asm__ ("andl %%esp,%0; ": "=r" (ti) : "0" (~4095)); return ti; } long sys_time (int *tloc) { int i; struct timeval tv; do_gettimeofday (&tv); i = tv.tv_sec; if (tloc) if (({ long __pu_err = -14; __typeof__ (*((tloc))) * __pu_addr = ((tloc)); if ((__builtin_expect (({unsigned long flag, sum; asm ("addl %3,%1 ; sbbl %0,%0; cmpl %1,%4; sbbl $0,%0" : "=&r" (flag), "=r" (sum) : "1" (__pu_addr), "g" ((int) (sizeof (*(tloc)))), "g" (current_T ()->addr_limit)); flag; }) == 0, 1))) { __pu_err = 0; __asm__ __volatile__ ("movl %1,%2" : "=r" (__pu_err) : "ir" (((__typeof__ (*(tloc))) (i))), "m" ((*(struct L *) (__pu_addr))), "i" (-14), "0" (__pu_err)); } __pu_err; })) i = -14; return i; } int main (void) { return 0; } struct timeval tt; void __attribute__ ((noinline)) do_gettimeofday (struct timeval *x) { __builtin_memcpy (x, &tt, sizeof (tt)); } Note that gcc-3.4.4-2 doesn't have Richard's frame base tracking stuff. The 3.4.x need comes from wanting to use systemtap on RHEL4. Much of the new dwarf stuff would be excellent to have backported to 3.4.x, but the effort needs to be estimated. Another possibility is to add yet more heuristics to systemtap/elfutils to detect cases like this. Is there some tell-tale sign that the compiler might have screwed up the frame-base values, so that we might be able to compensate for (or even, just detect) bad data? Best would be a modified RHEL4U3 draft gcc rpm with the changes. With that, I can rebuild the kernel rpms from the original problem reports and test the real-world problems. I have a 2.6.9-22.24.EL kernel rebuilt with this new compiler. How can I test whether this patch is working? The systemtap script produces results that may or may not be correct. I'm looking for a way to get a dump of that frame_base table from the top of the bug report. An advisory has been issued which should help the problem described in this bug report. This report is therefore being closed with a resolution of ERRATA. For more information on the solution and/or where to find the updated files, please follow the link below. You may reopen this bug report if the solution does not work for you. http://rhn.redhat.com/errata/RHBA-2006-0125.html |