Note: This is a public test instance of Red Hat Bugzilla. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback at bugzilla.redhat.com.
Bug 1371380 - gcore does not support COREFILTER_ELF_HEADERS
Summary: gcore does not support COREFILTER_ELF_HEADERS
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: gdb
Version: rawhide
Hardware: x86_64
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Sergio Durigan Junior
QA Contact: Fedora Extras Quality Assurance
URL: https://retrace.fedoraproject.org/faf...
Whiteboard: abrt_hash:d5718852e850010617546bd78ad...
Depends On: 1365812 1371517
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-08-30 06:15 UTC by Jakub Filak
Modified: 2019-05-15 01:35 UTC (History)
14 users (show)

Fixed In Version: gdb-8.3.50.20190501-11.fc31 gdb-8.3-1.fc30
Doc Type: If docs needed, set a value
Doc Text:
Clone Of: 1365812
Environment:
Last Closed: 2019-05-09 17:59:29 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Jakub Filak 2016-08-30 06:15:59 UTC
+++ This bug was initially created as a clone of Bug #1365812 +++

Description of problem:
I ran eu-stack with a core dump file generated by gcore.

$ sleep 1000 &
$ SLEEP_PID=$!
$ gcore $SLEEP_PID
$ eu-stack --executable=/usr/bin/sleep --core=core.$SLEEP_PID
eu-stack: link_map.c:846: dwfl_link_map_report: Assertion `in.d_size == phnum * phent' failed.
Aborted (core dumped)

Version-Release number of selected component:
elfutils-0.166-2.fc25

Truncated backtrace:
Thread no. 1 (7 frames)
 #25 ??
 #26 dwfl_link_map_report at link_map.c:846
 #27 dwfl_core_file_report at core-file.c:531
 #28 parse_opt at stack.c:595
 #29 parser_parse_arg at argp-parse.c:716
 #30 parser_parse_next at argp-parse.c:865
 #31 __argp_parse at argp-parse.c:921

--- Additional comment from Matej Habrnal on 2016-08-10 11:30:56 CEST ---

It is possible to generate backtrace from such a coredump using gdb:

$ gdb -batch -ex 'file /usr/bin/sleep' -ex "core-file core.$SLEEP_PID" -ex "bt"
[New LWP 22760]
Core was generated by `sleep'.
#0  0x00007fe59479c810 in __nanosleep_nocancel () at ../sysdeps/unix/syscall-template.S:84
84	T_PSEUDO (SYSCALL_SYMBOL, SYSCALL_NAME, SYSCALL_NARGS)
#0  0x00007fe59479c810 in __nanosleep_nocancel () at ../sysdeps/unix/syscall-template.S:84
#1  0x000055d61b75845f in rpl_nanosleep ()
#2  0x000055d61b7582c0 in xnanosleep ()
#3  0x000055d61b75587d in main ()

--- Additional comment from Jan Kratochvil on 2016-08-10 13:55:09 CEST ---

The core file generated by gcore is bogus so it is rather a GDB bug:
3    AT_PHDR              Program headers for program    0x55848c2b5040
9    AT_ENTRY             Entry point of program         0x55848c2b6940
^^^ it points to nowhere:
  Type           Offset             VirtAddr           PhysAddr
                 FileSiz            MemSiz              Flags  Align
  LOAD           0x0000000000000df8 0x000055848c4bb000 0x0000000000000000
                 0x0000000000001000 0x0000000000001000  R      1
  LOAD           0x0000000000001df8 0x000055848c4bc000 0x0000000000000000
                 0x0000000000001000 0x0000000000001000  RW     1
  LOAD           0x0000000000002df8 0x000055848e3b7000 0x0000000000000000
                 0x0000000000021000 0x0000000000021000  RW     1

--- Additional comment from Jan Kratochvil on 2016-08-10 21:50:35 CEST ---

A workaround is:
(gdb) shell cat /proc/20477/coredump_filter
00000033
(gdb) shell echo 0x37 >/proc/20477/coredump_filter
(gdb) shell cat /proc/20477/coredump_filter
00000037
(gdb) gcore /tmp/sleep.core
(gdb) shell echo 0x33 >/proc/20477/coredump_filter

This is not a regression, before 'set use-coredump-filter' (gdb >=7.10) GDB also never dumped pages of binary code.

Comment 1 Sergio Durigan Junior 2016-08-31 16:34:53 UTC
FWIW, I am currently implementing the support for setting the coredump filter flags from inside GDB, i.e., without having to resort to invoking a shell.  This feature should solve or at least help in this issue.

Comment 3 Fedora End Of Life 2017-02-28 10:10:42 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 26 development cycle.
Changing version to '26'.

Comment 4 Fedora End Of Life 2018-05-03 08:32:38 UTC
This message is a reminder that Fedora 26 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 26. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as EOL if it remains open with a Fedora  'version'
of '26'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version'
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not
able to fix it before Fedora 26 is end of life. If you would still like
to see this bug fixed and are able to reproduce it against a later version
of Fedora, you are encouraged  change the 'version' to a later Fedora
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's
lifetime, sometimes those efforts are overtaken by events. Often a
more recent Fedora release includes newer upstream software that fixes
bugs or makes them obsolete.

Comment 5 Fedora End Of Life 2018-05-29 11:46:57 UTC
Fedora 26 changed to end-of-life (EOL) status on 2018-05-29. Fedora 26
is no longer maintained, which means that it will not receive any
further security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.

Comment 6 Jan Kurik 2018-05-31 09:12:28 UTC
This bug is currently reported against a Fedora version which is already unsuported.
I am changing the version to '27', the latest supported release.

Please check whether this bug is still an issue on the '27' release.
If you find this bug not being applicable on this release, please close it.

Comment 7 Jan Kurik 2018-08-14 10:22:19 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 29 development cycle.
Changing version to '29'.

Comment 8 Sergio Durigan Junior 2019-04-25 18:36:14 UTC
Fixed upstream by https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=57e5e645010430b3d73f8c6a757d09f48dc8f8d5

commit 57e5e645010430b3d73f8c6a757d09f48dc8f8d5
Author: Sergio Durigan Junior <sergiodj>
Date:   Tue Apr 23 18:17:57 2019 -0400

    Implement dump of mappings with ELF headers by gcore

I'll prepare a Fedora GDB release with it tomorrow.

Comment 9 Sergio Durigan Junior 2019-05-02 03:10:03 UTC
Building gdb-8.3.50.20190501-11.fc31 right now, so I'm closing this.  Please reopen if needed.  Thanks.

Comment 10 Sergio Durigan Junior 2019-05-02 17:07:32 UTC
Sorry, as it turns out the package failed to build and there are a bunch of new regressions (unrelated to this bug).  I'm reopening this bug temporarily just to keep things in sync.

Comment 11 Sergio Durigan Junior 2019-05-09 17:59:29 UTC
Fixed.

Comment 12 Fedora Update System 2019-05-13 14:43:16 UTC
gdb-8.3-1.fc30 has been submitted as an update to Fedora 30. https://bodhi.fedoraproject.org/updates/FEDORA-2019-2bfea97c1a

Comment 13 Fedora Update System 2019-05-14 01:53:52 UTC
gdb-8.3-1.fc30 has been pushed to the Fedora 30 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2019-2bfea97c1a

Comment 14 Fedora Update System 2019-05-15 01:35:24 UTC
gdb-8.3-1.fc30 has been pushed to the Fedora 30 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.