Bug 1553086 - gdb: warning: Loadable section ".note.gnu.property" outside of ELF segments [NEEDINFO]
Summary: gdb: warning: Loadable section ".note.gnu.property" outside of ELF segments
Status: NEW
Alias: None
Product: Fedora
Classification: Fedora
Component: gdb
Version: 30
Hardware: Unspecified
OS: Linux
unspecified
unspecified
Target Milestone: ---
Assignee: Sergio Durigan Junior
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Keywords: Reopened
Depends On:
Blocks: 1630115
TreeView+ depends on / blocked
 
Reported: 2018-03-08 09:32 UTC by Zbigniew Jędrzejewski-Szmek
Modified: 2019-06-21 13:39 UTC (History)
31 users (show)

(edit)
Clone Of:
: 1630115 (view as bug list)
(edit)
Last Closed: 2019-02-02 03:34:53 UTC
anoopcs: needinfo? (sergiodj)


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
Sourceware 23034 None None None 2019-06-25 13:04 UTC
Sourceware 23035 None None None 2019-06-25 13:04 UTC
Sourceware 24717 None None None 2019-06-26 13:54 UTC

Description Zbigniew Jędrzejewski-Szmek 2018-03-08 09:32:38 UTC
Description of problem:
This is new. On rawhide, I get the following from gdb:

$ sudo gdb --args systemctl kexec
GNU gdb (GDB) Fedora 8.1-11.fc29
...
(gdb) b systemctl_main
Breakpoint 1 at 0x270b5: file ../src/systemctl/systemctl.c, line 8464.
(gdb) r
Starting program: /usr/bin/systemctl kexec
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
warning: Loadable section ".note.gnu.property" outside of ELF segments
warning: Loadable section ".note.gnu.property" outside of ELF segments
warning: Loadable section ".note.gnu.property" outside of ELF segments
warning: Loadable section ".note.gnu.property" outside of ELF segments

Is this related to https://fedoraproject.org/wiki/Changes/Annobin?

Version-Release number of selected component (if applicable):
gcc-8.0.1-0.16.fc29.x86_64
gdb-8.1-11.fc29.x86_64

How reproducible:
100%

Steps to reproduce:
$ git clone https://github.com/systemd/systemd
$ cd systemd
$ meson build -Dman=false && ninja -C build systemctl
$ sudo gdb build/systemctl

Comment 1 Kalev Lember 2018-03-08 09:37:21 UTC
Reassigning to gdb, looks like it was accidentally filed against gdm.

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

Comment 3 Damian Wrobel 2018-09-24 19:53:16 UTC
I'm also observing similar warnings[1] on a slightly newer version of gcc and gdb:
gcc-8.1.1-5.fc28.x86_64
gdb-8.1.1-3.fc28.x86_64

Log excerpt:
warning: Loadable section ".note.gnu.property" outside of ELF segments
error: rpmdbNextIterator: skipping h#     177 blob size(141976): BAD, 8 + 16 * il(73) + dl(140800)
error: rpmdbNextIterator: skipping h#     177 blob size(141976): BAD, 8 + 16 * il(73) + dl(140800)
error: rpmdbNextIterator: skipping h#     177 blob size(141976): BAD, 8 + 16 * il(73) + dl(140800)
error: rpmdbNextIterator: skipping h#     177 blob size(141976): BAD, 8 + 16 * il(73) + dl(140800)
warning: Loadable section ".note.gnu.property" outside of ELF segments
error: rpmdbNextIterator: skipping h#     177 blob size(141976): BAD, 8 + 16 * il(73) + dl(140800)
error: rpmdbNextIterator: skipping h#     177 blob size(141976): BAD, 8 + 16 * il(73) + dl(140800)
warning: Loadable section ".note.gnu.property" outside of ELF segments
error: rpmdbNextIterator: skipping h#     177 blob size(141976): BAD, 8 + 16 * il(73) + dl(140800)
warning: Loadable section ".note.gnu.property" outside of ELF segments
error: rpmdbNextIterator: skipping h#     177 blob size(141976): BAD, 8 + 16 * il(73) + dl(140800)
error: rpmdbNextIterator: skipping h#     177 blob size(141976): BAD, 8 + 16 * il(73) + dl(140800)
error: rpmdbNextIterator: skipping h#     177 blob size(141976): BAD, 8 + 16 * il(73) + dl(140800)
error: rpmdbNextIterator: skipping h#     177 blob size(141976): BAD, 8 + 16 * il(73) + dl(140800)

I'm not sure if the warnings are somehow linked with the errors.

[1] https://travis-ci.org/dwrobel/pxCore/builds/432614968#L1800

Comment 4 Jan Kratochvil 2018-09-24 21:01:29 UTC
(In reply to Damian Wrobel from comment #3)
> warning: Loadable section ".note.gnu.property" outside of ELF segments
> error: rpmdbNextIterator: skipping h#     177 blob size(141976): BAD, 8 + 16
> * il(73) + dl(140800)
...
> I'm not sure if the warnings are somehow linked with the errors.

No, they should not, the rpm messages could be disabled by adding to the beginning of GDB command line: -iex 'set build-id-verbose 0'

Comment 5 Damian Wrobel 2018-09-25 09:05:54 UTC
(In reply to Jan Kratochvil from comment #4)
Thank you for the hint!

Comment 6 Jan Kratochvil 2018-10-02 15:12:44 UTC
FAIL: binutils-2.31.1-13.fc29.x86_64

Tested on:
systemd-239-3.fc29.x86_64
/usr/lib/systemd/libsystemd-shared-239.so
/usr/lib/debug/usr/lib/systemd/libsystemd-shared-239.so-239-3.fc29.x86_64.debug

warning: Loadable section ".note.gnu.property" outside of ELF segments

The warning comes from .gnu_debugdata:
$ rm -f /tmp/debugdata*;objcopy -O binary --set-section-flags .gnu_debugdata=A -j .gnu_debugdata /usr/lib/systemd/libsystemd-shared-239.so /tmp/debugdata.xz;xz -dv /tmp/debugdata.xz;gdb -q /tmp/debugdata
warning: Loadable section ".note.gnu.property" outside of ELF segments

It does not happen with system-debuginfo.rpm installed as then GDB does not
read .gnu_debugdata. Even objcopy already complains:

$ objcopy /usr/lib/debug/usr/lib/systemd/libsystemd-shared-239.so-239-3.fc29.x86_64.debug /tmp/copytest
objcopy: /tmp/copytest: warning: allocated section `.note.gnu.property' not in segment
$ gdb -q /tmp/copytest
warning: Loadable section ".note.gnu.property" outside of ELF segments

I do not understand why objcopy does a copy of .note.gnu.build-id fine but it
fails on .note.gnu.property.

/usr/lib/debug/usr/lib/systemd/libsystemd-shared-239.so-239-3.fc29.x86_64.debug:
Section Headers:
  [Nr] Name              Type            Address          Off    Size   ES Flg Lk Inf Al
  [ 1] .note.gnu.build-id NOTE            00000000000002a8 0002a8 000024 00   A  0   0  4
  [18] .note.gnu.property NOTE            00000000001f1fb0 0002e0 000030 00   A  0   0  8
Program Headers:
  Type           Offset   VirtAddr           PhysAddr           FileSiz  MemSiz   Flg Align
  LOAD           0x001000 0x000000000017a000 0x000000000017a000 0x000000 0x077fb0 R   0x1000
###                               0x1f1fb0 = 0x000000000017a000        + 0x077fb0
  NOTE           0x0002a8 0x00000000000002a8 0x00000000000002a8 0x000024 0x000024 R   0x4
  NOTE           0x1f1fb0 0x00000000001f1fb0 0x00000000001f1fb0 0x000030 0x000030 R   0x8

/tmp/copytest:
Section Headers:
  [Nr] Name              Type            Address          Off    Size   ES Flg Lk Inf Al
  [ 1] .note.gnu.build-id NOTE            00000000000002a8 0002a8 000024 00   A  0   0  4
  [18] .note.gnu.property NOTE            00000000001f1fb0 0002d0 000030 00   A  0   0  8
Program Headers:
  Type           Offset   VirtAddr           PhysAddr           FileSiz  MemSiz   Flg Align
  LOAD           0x001000 0x000000000017a000 0x000000000017a000 0x000000 0x077fb0 R   0x1000
###                               0x1f1fb0 = 0x000000000017a000        + 0x077fb0
  NOTE           0x0002a8 0x00000000000002a8 0x00000000000002a8 0x000024 0x000024 R   0x4
  NOTE           0x000000 0x0000000000000000 0x00000000001f1fb0 0x000000 0x000000 R   0x8
                          ################## - why?             ######## ########

Comment 7 Simon Meaden 2018-11-05 09:49:04 UTC
(In reply to Jan Kurik from comment #2)
> This bug appears to have been reported against 'rawhide' during the Fedora
> 29 development cycle.
> Changing version to '29'.

No I'm still using Fedora 28 and I also get this message.

Comment 8 Loïc Yhuel 2019-01-08 15:46:17 UTC
(In reply to Jan Kratochvil from comment #6)
> /usr/lib/debug/usr/lib/systemd/libsystemd-shared-239.so-239-3.fc29.x86_64.
> ...

Perhaps the issue is in "objcopy --only-keep-debug", which doesn't change the program headers.
Since sections like .text are removed, sections after them (like .note.gnu.property) have their offset modified, but the program headers still have the offset from the original file.

Using "readelf -e", in "Section to Segment mapping" for the *.debug files :
 - no .note.gnu.property => that's why gdb prints its warning
 - sections which shouldn't be loaded, like .comment .symtab .strtab are present (not sure why, but probably due to readelf being confused by the offsets)

Comment 9 Fedora Update System 2019-01-30 12:46:21 UTC
binutils-2.31.1-17.fc29 has been submitted as an update to Fedora 29. https://bodhi.fedoraproject.org/updates/FEDORA-2019-ba3cbcfd20

Comment 10 Fedora Update System 2019-01-31 02:30:14 UTC
binutils-2.31.1-17.fc29 has been pushed to the Fedora 29 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-ba3cbcfd20

Comment 11 Fedora Update System 2019-02-02 03:34:53 UTC
binutils-2.31.1-17.fc29 has been pushed to the Fedora 29 stable repository. If problems still persist, please make note of it in this bug report.

Comment 12 H.J. Lu 2019-02-19 14:01:28 UTC
This is a gdb bug.

Comment 13 Loïc Yhuel 2019-02-19 18:33:12 UTC
(In reply to H.J. Lu from comment #12)
> This is a gdb bug.

So you think the objcopy behavior I noted in Comment 8 is correct ?

Comment 14 H.J. Lu 2019-02-19 18:40:03 UTC
(In reply to Loïc Yhuel from comment #13)
> (In reply to H.J. Lu from comment #12)
> > This is a gdb bug.
> 
> So you think the objcopy behavior I noted in Comment 8 is correct ?

It may be an objcopy bug.   Please open a binutils bug at

https://sourceware.org/bugzilla/

Comment 15 Anoop C S 2019-06-21 08:59:10 UTC
I see that the component has been changed to gdb. Doesn't that mean the bug is yet to be resolved? I am facing this issue on Fedora 30 with GNU gdb (GDB) Fedora 8.3-3.fc30

# rpm -qa | grep binutils
binutils-2.31.1-29.fc30.x86_64

If that is the case shall we re-open this bug report?

Comment 16 Nick Clifton 2019-06-21 11:20:09 UTC
I think that this issue should be reopened.

I have also filed a binutils bug report for the problem:

  https://sourceware.org/bugzilla/show_bug.cgi?id=24717


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