Bug 1084404
| Summary: | [ppc64] and [s390x] wrong prologue skip on -O2 -g code | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | Red Hat Enterprise Linux 7 | Reporter: | David Spurek <dspurek> | ||||||
| Component: | gdb | Assignee: | Sergio Durigan Junior <sergiodj> | ||||||
| Status: | CLOSED ERRATA | QA Contact: | Miroslav Franc <mfranc> | ||||||
| Severity: | high | Docs Contact: | |||||||
| Priority: | high | ||||||||
| Version: | 7.1 | CC: | amarecek, fche, gdb-bugs, jan.kratochvil, mattn, mcermak, mfranc, ohudlick, sergiodj | ||||||
| Target Milestone: | rc | ||||||||
| Target Release: | --- | ||||||||
| Hardware: | Unspecified | ||||||||
| OS: | Unspecified | ||||||||
| Whiteboard: | |||||||||
| Fixed In Version: | gdb-7.6.1-76.el7 | Doc Type: | Bug Fix | ||||||
| Doc Text: | Story Points: | --- | |||||||
| Clone Of: | Environment: | ||||||||
| Last Closed: | 2015-11-19 13:01:24 UTC | Type: | Bug | ||||||
| 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: | 1205796 | ||||||||
| Attachments: |
|
||||||||
|
Description
David Spurek
2014-04-04 09:17:27 UTC
Probably extend this commit for DW_AT_producer -grecord-gcc-switches: https://sourceware.org/git/?p=binutils-gdb.git;a=commitdiff;h=8be455d765a7cfb8f2cb045ec80e2b2af1597d15 python-libs-2.7.5-16.bs1_0.ppc64le
gdb /usr/lib64/libpython2.7.so
(gdb) break PyObject_Print
Actual:
Breakpoint 3 at 0x3fffb7dd1798: file /usr/src/debug/Python-2.7.5/Objects/object.c, line 329.
Expected:
Breakpoint 3 at 0x3fffb7dd1790: file /usr/src/debug/Python-2.7.5/Objects/object.c, line 329.
00000000000d1790 <PyObject_Print>:
d1790: 1b 00 4c 3c addis r2,r12,27
d1794: 00 f3 42 38 addi r2,r2,-3328
d1798: a6 02 08 7c mflr r0
producer (GNU_strp_alt) "GNU C 4.8.2 20140409 (Red Hat 4.8.2-17) -Asystem=linux -Asystem=unix -Asystem=posix -msecure-plt -mcpu=power7 -mtune=power7 -m64 -mcpu=power7 -mtune=power7 -g -g -O2 -O3 -O2 -O3 -fno-strict-aliasing -fstack-protector-strong -fexceptions -fstack-protector-strong -fwrapv -fPIC --param ssp-buffer-size=4 --param ssp-buffer-size=4"
Moving to RHEL-7.2. The fix has proven to be more difficult than I was expecting, so it will need to be investigated/discussed more. Created attachment 1015648 [details]
Fix.
It does not have regressions on Fedora and it seems OK to me this way.
(In reply to Jan Kratochvil from comment #7) > Created attachment 1015648 [details] > Fix. > > It does not have regressions on Fedora and it seems OK to me this way. This patch does not fix the issue, at least as far as I have tested. I still see the same behavior described in the initial report, and also doing a very simple test (simple program compiled with -O2 -g). I am starting to investigate this, but the problem seems to be that symtab->locations_valid is never marked as 1 on process_full_comp_unit (this is because cu->language is not asm, and cu->has_loclist is zero), and therefore all the new logic implemented on skip_prologue{,_using}_sal does not kick in. Created attachment 1040379 [details] Test data for the fix in attachment 1015648 [details]. before fix: (gdb) b select Breakpoint 1 at 0x121840: file ../sysdeps/unix/syscall-template.S, line 82. after fix: (gdb) b select Breakpoint 1 at 0x1217b4: file ../sysdeps/unix/syscall-template.S, line 81. 00000000001217b4 <.__select>: __GI_select(): /usr/src/debug////////glibc-2.17-c758a686/misc/../sysdeps/unix/syscall-template.S:81 1217b4: 81 4d 88 d0 lwz r10,-30512(r13) 1217b8: 2c 0a 00 00 cmpwi r10,0 1217bc: 40 c2 00 14 bne- 1217d0 <___newselect_nocancel+0x10> 00000000001217c0 <___newselect_nocancel>: ___newselect_nocancel(): 1217c0: 38 00 00 8e li r0,142 1217c4: 44 00 00 02 sc 1217c8: 4c e3 00 20 bnslr+ 1217cc: 4b f2 2e f4 b 446c0 <.__syscall_error> 1217d0: f8 21 ff 81 stdu r1,-128(r1) [...] 12183c: 38 21 00 80 addi r1,r1,128 /usr/src/debug////////glibc-2.17-c758a686/misc/../sysdeps/unix/syscall-template.S:82 121840: 4c e3 00 20 bnslr+ 121844: 4b f2 2e 7c b 446c0 <.__syscall_error> [...] <0><37b6d5>: Abbrev Number: 1 (DW_TAG_compile_unit) <37b6da> DW_AT_low_pc : 0x1217b4 <37b6e2> DW_AT_high_pc : 0x121864 <37b6ea> DW_AT_name : ../sysdeps/unix/syscall-template.S <37b73c> DW_AT_producer : GNU AS 2.23.52.0.1 <37b74f> DW_AT_language : 32769 (MIPS assembler) This libc-2.17.so is from some ppc64 rpm, I do not remember its NVRA. Sergio, maybe you have a different testcase where this fix does not work. I should have said that I am doing tests on s390x as well. On PPC64, I see that the patch is working correctly indeed (i.e., I cannot break on 'select' without the patch, but can break with it). However, on s390x I cannot break on 'select' even with the patch applied. I'm still investigating this. Comment on attachment 1015648 [details] Fix. New fix for both ppc64 and s390x and with a testcase: [patch] Do not skip prologue for asm (.S) files https://sourceware.org/ml/gdb-patches/2015-06/msg00415.html (In reply to Sergio Durigan Junior from comment #14) > The last patch causes a few regressions on PPC64: Thanks for the test, fixed in: [patchv2] Do not skip prologue for asm (.S) files https://sourceware.org/ml/gdb-patches/2015-06/msg00550.html Re: [patchv2] Do not skip prologue for asm (.S) files https://sourceware.org/ml/gdb-patches/2015-06/msg00561.html Checked in as: 6e22494e5076e4d3c0b2c2785883162f83db499e [testsuite patch] Fix testsuite regression by: Do not skip prologue for asm (.S) files https://sourceware.org/ml/gdb-patches/2015-06/msg00611.html Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://rhn.redhat.com/errata/RHBA-2015-2089.html Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://rhn.redhat.com/errata/RHBA-2015-2089.html |