Bug 1828587 - ar segfaults when liblto_plugin.so.0.0.0 is a symlink in /usr/lib/bfd-plugins
Summary: ar segfaults when liblto_plugin.so.0.0.0 is a symlink in /usr/lib/bfd-plugins
Keywords:
Status: CLOSED EOL
Alias: None
Product: Fedora
Classification: Fedora
Component: binutils
Version: 33
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Nick Clifton
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-04-27 20:51 UTC by Tom Stellard
Modified: 2021-11-30 16:27 UTC (History)
6 users (show)

Fixed In Version: binutils-2.34-4.fc33
Clone Of:
Environment:
Last Closed: 2021-11-30 16:27:02 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Tom Stellard 2020-04-27 20:51:16 UTC
Description of problem:

Copying this over from the upstream bugzilla:
https://sourceware.org/bugzilla/show_bug.cgi?id=25873

It looks like this issue is caused by the Fedora patch: binutils-nm-lto-plugin.patch.  If I rebuild binutils without the patch, then the segfault goes away.

Version-Release number of selected component (if applicable):

binutils-2.34-2.fc33

How reproducible:

Always

Steps to Reproduce:

echo "int foo(){}" | gcc -flto -O2 -c -x c -o foo.o -
echo "int bar(){}" | gcc -flto -O2 -c -x c -o bar.o -
mkdir -p /usr/lib/bfd-plugins/
ln -s /usr/libexec/gcc/x86_64-redhat-linux/10/liblto_plugin.so.0.0.0 /usr/lib/bfd-plugins/
ar crs foo.a foo.o bar.o

I was able to reproduce this in the fedora:rawhide container image.

Actual results:

segfault.

Expected results:

No segfault.

Additional info:

Backtrace:
Program received signal SIGSEGV, Segmentation fault.
0x00007ffff7d31750 in free () from /lib64/libc.so.6
(gdb) bt
#0  0x00007ffff7d31750 in free () from /lib64/libc.so.6
#1  0x00007ffff7c2f2b1 in cleanup_handler.cold () from /usr/bin/../bin/../lib/bfd-plugins/liblto_plugin.so.0.0.0
#2  0x00007ffff7f53513 in try_claim (abfd=0x555555568620) at plugin.c:574
#3  try_load_plugin (pname=<optimized out>, pname@entry=0x0, plugin_list_iter=<optimized out>, plugin_list_iter@entry=0x5555555690e0, abfd=a
    build_list_p=build_list_p@entry=0) at plugin.c:723
#4  0x00007ffff7f53aec in load_plugin (abfd=0x555555568620) at plugin.c:855
#5  bfd_plugin_object_p (abfd=0x555555568620) at plugin.c:868
#6  0x00007ffff7ec10f6 in bfd_check_format_matches (abfd=abfd@entry=0x555555568620, format=format@entry=bfd_object, matching=matching@entry=
#7  0x00007ffff7ec15db in bfd_check_format (abfd=abfd@entry=0x555555568620, format=format@entry=bfd_object) at format.c:94
#8  0x00007ffff7eb9cb5 in _bfd_compute_and_write_armap (arch=<optimized out>, elength=<optimized out>) at archive.c:2283
#9  0x00007ffff7eba5cc in _bfd_write_archive_contents (arch=<optimized out>) at archive.c:2147
#10 0x00007ffff7ec8b3e in bfd_close (abfd=0x5555555689a0) at opncls.c:755
#11 0x0000555555559a60 in write_archive (iarch=0x555555566090) at ar.c:1240
#12 0x00005555555577cb in main (argc=<optimized out>, argv=<optimized out>) at ar.c:887

Comment 1 Nick Clifton 2020-04-28 11:49:28 UTC
Investigating.

It may actually be a problem with the lto plugin itself, but I cannot be sure at the moment.

Comment 2 Nick Clifton 2020-04-28 12:41:27 UTC
Right - this is a binutils bug.  It appears to be the same as:

  https://sourceware.org/bugzilla/show_bug.cgi?id=25355#c54

So I am trying the patch for bug...

Comment 3 Nick Clifton 2020-04-28 15:01:07 UTC
Fixed in binutils-2.34-4.fc33.

Comment 4 Ben Cotton 2020-08-11 13:20:59 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 33 development cycle.
Changing version to 33.

Comment 5 Ben Cotton 2021-11-04 17:29:47 UTC
This message is a reminder that Fedora 33 is nearing its end of life.
Fedora will stop maintaining and issuing updates for Fedora 33 on 2021-11-30.
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 '33'.

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 33 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 6 Ben Cotton 2021-11-30 16:27:02 UTC
Fedora 33 changed to end-of-life (EOL) status on 2021-11-30. Fedora 33 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.


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