Bug 1129756

Summary: Unwinding core fails in vDSO frame when elf_begin is called with ELF_C_READ
Product: [Fedora] Fedora Reporter: Martin Milata <mmilata>
Component: elfutilsAssignee: Mark Wielaard <mjw>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: low Docs Contact:
Priority: unspecified    
Version: 22CC: aoliva, fche, jakub, jan.kratochvil, mjw, mjw, mnewsome, roland
Target Milestone: ---Keywords: FutureFeature
Target Release: ---   
Hardware: i686   
OS: Unspecified   
Whiteboard:
Fixed In Version: elfutils-0.163-1.fc21 Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-06-30 20:11:22 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:
Attachments:
Description Flags
Reproducer none

Description Martin Milata 2014-08-13 15:22:35 UTC
Created attachment 926483 [details]
Reproducer

Description of problem:
When unwinding core dump on i386, it appears that dwfl_thread_getframes fails with "Callback returned failure" after it reaches a frame belonging to VDSO and only if the core file had been opened with elf_begin(fd, ELF_C_READ, NULL). Opening it with ELF_C_READ_MMAP solves this issue.

Version-Release number of selected component: elfutils-0.159-8.fc22.i686

How reproducible: Always

Steps to Reproduce:
1. gcc -o simplestack -lelf -ldw simplestack.c
2. ulimit -c unlimited
3. sleep 1d &
4. kill -11 $!
[1]+  Segmentation fault      (core dumped) sleep 1d
5. ./simplestack /usr/bin/sleep core.12345

Actual results:
b7725d7c
dwfl_thread_getframes: -1 (Callback returned failure)
dwfl_getthreads: DWARF_CB_OK

Expected results:
b7725d7c
b75fc120
804bebe
80490a1
b7555e9e
80491fa
dwfl_thread_getframes: -1 (No DWARF information found)
dwfl_getthreads: DWARF_CB_OK

(can be achieved by replacing ELF_C_READ by ELF_C_READ_MMAP in simplestack.c)

Additional info:
Low priority as this can be easily worked around in the library user (ABRT in this case).

Comment 1 Mark Wielaard 2014-08-15 22:18:48 UTC
Replicated with 0.158-4.fc20.i686 but not analysed yet.

Comment 2 Jaroslav Reznik 2015-03-03 16:12:14 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 22 development cycle.
Changing version to '22'.

More information and reason for this action is here:
https://fedoraproject.org/wiki/Fedora_Program_Management/HouseKeeping/Fedora22

Comment 3 Mark Wielaard 2015-03-11 15:17:07 UTC
Still an issue with current elfutils git.

Comment 4 Mark Wielaard 2015-03-16 14:16:04 UTC
The difference is that core_file_read_eagerly () returns false in the ELF_C_READ case, and true in the ELF_C_READ_MMAP case for linux-gate.so.1.

Comment 5 Mark Wielaard 2015-03-16 15:58:51 UTC
Posted a patch upstream:
https://lists.fedorahosted.org/pipermail/elfutils-devel/2015-March/004636.html

Comment 6 Mark Wielaard 2015-06-08 12:38:56 UTC
After discussion upstream a variant of the patch is no in git master. Fixing this bug when elfutils 0.162 will be released later this week.

Comment 7 Fedora Update System 2015-06-11 13:16:13 UTC
elfutils-0.162-1.fc22 has been submitted as an update for Fedora 22.
https://admin.fedoraproject.org/updates/elfutils-0.162-1.fc22

Comment 8 Fedora Update System 2015-06-13 06:35:40 UTC
Package elfutils-0.162-1.fc22:
* should fix your issue,
* was pushed to the Fedora 22 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing elfutils-0.162-1.fc22'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2015-9857/elfutils-0.162-1.fc22
then log in and leave karma (feedback).

Comment 9 Fedora Update System 2015-06-19 14:54:02 UTC
elfutils-0.163-1.fc22 has been submitted as an update for Fedora 22.
https://admin.fedoraproject.org/updates/elfutils-0.163-1.fc22

Comment 10 Fedora Update System 2015-06-30 20:11:22 UTC
elfutils-0.163-1.fc22 has been pushed to the Fedora 22 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 11 Fedora Update System 2015-07-08 15:06:55 UTC
elfutils-0.163-1.fc21 has been submitted as an update for Fedora 21.
https://admin.fedoraproject.org/updates/elfutils-0.163-1.fc21

Comment 12 Fedora Update System 2015-07-29 01:35:40 UTC
elfutils-0.163-1.fc21 has been pushed to the Fedora 21 stable repository.  If problems still persist, please make note of it in this bug report.