Bug 1553086 - gdb: warning: Loadable section ".note.gnu.property" outside of ELF segments
Summary: gdb: warning: Loadable section ".note.gnu.property" outside of ELF segments
Keywords:
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:
Depends On:
Blocks: 1630115
TreeView+ depends on / blocked
 
Reported: 2018-03-08 09:32 UTC by Zbigniew Jędrzejewski-Szmek
Modified: 2019-07-23 14:22 UTC (History)
32 users (show)

Fixed In Version: binutils-2.31.1-32.fc30 gdb-8.3-6.fc30
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 1630115 (view as bug list)
Environment:
Last Closed: 2019-07-05 01:32:23 UTC


Attachments (Terms of Use)


Links
System ID Priority Status Summary Last Updated
Sourceware 23034 None None None 2019-08-05 06:56:30 UTC
Sourceware 23035 None None None 2019-08-05 06:56:30 UTC
Sourceware 24717 None None None 2019-08-05 06:56:30 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

Comment 17 Nick Clifton 2019-07-02 16:40:42 UTC
I have imported the patch to fix this problem from PR 24717, and it is now available in binutils-2.31.1-32.fc30.
However - this fix will not solve the problem for GDB, since gdb has its own copy of the BFD library sources.
Hence the patch also needs to be applied there, and so I am going to leave the component field set to gdb.

Comment 18 Sergio Durigan Junior 2019-07-02 23:34:00 UTC
I'm testing a GDB package with the fix included.  Will build it if there are no regressions.  Thanks.

Comment 19 Fedora Update System 2019-07-03 18:50:25 UTC
FEDORA-2019-4a8ba02caf has been submitted as an update to Fedora 30. https://bodhi.fedoraproject.org/updates/FEDORA-2019-4a8ba02caf

Comment 20 Fedora Update System 2019-07-04 00:58:28 UTC
gdb-8.3-6.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-4a8ba02caf

Comment 21 Fedora Update System 2019-07-05 01:32:23 UTC
gdb-8.3-6.fc30 has been pushed to the Fedora 30 stable repository. If problems still persist, please make note of it in this bug report.

Comment 22 Juan Quintela 2019-07-23 13:21:56 UTC
The problem persist yet to me:

[root@elfo Desktop]# rpm -qa binutils gdb
binutils-2.31.1-29.fc30.x86_64
gdb-8.3-6.fc30.x86_64


[root@elfo Desktop]# gdb /path/to/freshly/complied/qemu/qemu-system-x86_64
GNU gdb (GDB) Fedora 8.3-6.fc30
Copyright (C) 2019 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-redhat-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from /scratch/qemu/check/x64/x86_64-softmmu/qemu-system-x86_64...
(gdb) r
Starting program: /scratch/qemu/check/x64/x86_64-softmmu/qemu-system-x86_64 
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
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
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
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
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
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
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
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
^Cwarning: 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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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

Program received signal SIGINT, Interrupt.
dl_main (phdr=<optimized out>, phnum=<optimized out>, user_entry=<optimized out>, auxv=<optimized out>) at rtld.c:2292
2292	  LIBC_PROBE (init_complete, 2, LM_ID_BASE, r);
(gdb) 

 I tried the -iex 'set build-id-verbose 0' suggestion, but it makes no difference to me.

Thanks, Juan.

Comment 23 Nick Clifton 2019-07-23 14:22:03 UTC
Hi Juan,

(In reply to Juan Quintela from comment #22)
> The problem persist yet to me:

The "fix" for this problem uses a heuristic to detect debuginfo
files and suppress the message about loadable sections.  Since it
is reasonable to assume that /path/to/freshly/complied/qemu/qemu-system-x86_64
is not a debuginfo file, this would explain why the messages are
still appearing.

What is puzzling to me is why this particular file should be
triggering the warning in the first place.  The warning should only
be generated for binary files which are not strictly conformant to
the ELF standard.  Has the qemu-system-x86_64 file been mangled in
some way ?  Or built using a custom linker script ?

Would it be possible for you to upload a copy of the file so that I
can take a look ?

Cheers
  Nick


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