Bug 1129756 - Unwinding core fails in vDSO frame when elf_begin is called with ELF_C_READ
Summary: Unwinding core fails in vDSO frame when elf_begin is called with ELF_C_READ
Alias: None
Product: Fedora
Classification: Fedora
Component: elfutils
Version: 22
Hardware: i686
OS: Unspecified
Target Milestone: ---
Assignee: Mark Wielaard
QA Contact: Fedora Extras Quality Assurance
Depends On:
TreeView+ depends on / blocked
Reported: 2014-08-13 15:22 UTC by Martin Milata
Modified: 2015-07-29 01:35 UTC (History)
8 users (show)

Fixed In Version: elfutils-0.163-1.fc21
Doc Type: Enhancement
Doc Text:
Clone Of:
Last Closed: 2015-06-30 20:11:22 UTC
Type: Bug

Attachments (Terms of Use)
Reproducer (2.50 KB, text/x-csrc)
2014-08-13 15:22 UTC, Martin Milata
no flags Details

System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 1191586 0 unspecified CLOSED abrt fails to generate core_backtrace from ruby coredumps 2021-02-22 00:41:40 UTC

Internal Links: 1191586

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

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:
dwfl_thread_getframes: -1 (Callback returned failure)
dwfl_getthreads: DWARF_CB_OK

Expected results:
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:

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:

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.

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:
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.

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.

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.

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