Debian Bug report logs - #718047
ia64, ld segfault on --as-needed

version graph

Package: binutils; Maintainer for binutils is Matthias Klose <[email protected]>; Source for binutils is src:binutils (PTS, buildd, popcon).

Affects: src:ogre-1.9, src:vxl, src:gdcm, src:openscenegraph, paraview

Reported by: Mathieu Malaterre <[email protected]>

Date: Sun, 28 Jul 2013 07:54:07 UTC

Severity: normal

Tags: confirmed, help, moreinfo

Found in versions binutils/2.29.1-13, binutils/2.23.52.20130727-1

Forwarded to http://sourceware.org/bugzilla/show_bug.cgi?id=15891

Reply or subscribe to this bug.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to [email protected], Matthias Klose <[email protected]>:
Bug#718047; Package binutils. (Sun, 28 Jul 2013 07:54:11 GMT) (full text, mbox, link).


Acknowledgement sent to Mathieu Malaterre <[email protected]>:
New Bug report received and forwarded. Copy sent to Matthias Klose <[email protected]>. (Sun, 28 Jul 2013 07:54:11 GMT) (full text, mbox, link).


Message #5 received at [email protected] (full text, mbox, reply):

From: Mathieu Malaterre <[email protected]>
To: Debian Bug Tracking System <[email protected]>
Subject: binutils: assertion fail elf64-ia64.c:2723
Date: Sun, 28 Jul 2013 09:46:05 +0200
Package: binutils
Severity: grave
Justification: renders package unusable

Package gdcm fails to build on ia64. Errors is:

Linking CXX shared library ../../bin/libvtkgdcm.so
cd /build/buildd-gdcm_2.2.4-1-ia64-JJJW9m/gdcm-2.2.4/obj-ia64-linux-gnu/Utilities/VTK && /usr/bin/cmake -E cmake_link_script CMakeFiles/vtkgdcm.dir/link.txt --verbose=1
/usr/bin/c++  -fPIC -g -O2 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2  -DNDEBUG  -Wno-deprecated  -Wl,--as-needed  -shared -Wl,-soname,libvtkgdcm.so.2.2 -o ../../bin/libvtkgdcm.so.2.2.4 CMakeFiles/vtkgdcm.dir/vtkGDCMTesting.cxx.o CMakeFiles/vtkgdcm.dir/vtkGDCMImageReader.cxx.o CMakeFiles/vtkgdcm.dir/vtkGDCMImageWriter.cxx.o CMakeFiles/vtkgdcm.dir/vtkGDCMMedicalImageProperties.cxx.o CMakeFiles/vtkgdcm.dir/vtkImageMapToWindowLevelColors2.cxx.o CMakeFiles/vtkgdcm.dir/vtkImageYBRToRGB.cxx.o CMakeFiles/vtkgdcm.dir/vtkImageRGBToYBR.cxx.o CMakeFiles/vtkgdcm.dir/vtkGDCMPolyDataReader.cxx.o CMakeFiles/vtkgdcm.dir/vtkGDCMPolyDataWriter.cxx.o CMakeFiles/vtkgdcm.dir/vtkRTStructSetProperties.cxx.o CMakeFiles/vtkgdcm.dir/vtkLookupTable16.cxx.o CMakeFiles/vtkgdcm.dir/vtkImageMapToColors16.cxx.o CMakeFiles/vtkgdcm.dir/vtkImageColorViewer.cxx.o CMakeFiles/vtkgdcm.dir/vtkGDCMThreadedImageReader2.cxx.o CMakeFiles/vtkgdcm.dir/vtkgdcmInstantiator.cxx.o ../../bin/libgdcmMSFF.so.2.2.4 /us
 r/lib/li
 bvtkCommon.so.5.8.0 /usr/lib/libvtkIO.so.5.8.0 /usr/lib/libvtkImaging.so.5.8.0 /usr/lib/libvtkRendering.so.5.8.0 -lpthread ../../bin/libgdcmDICT.so.2.2.4 ../../bin/libgdcmIOD.so.2.2.4 ../../bin/libgdcmDSED.so.2.2.4 ../../bin/libgdcmCommon.so.2.2.4 /usr/lib/libvtkIO.so.5.8.0 /usr/lib/libvtkImaging.so.5.8.0 /usr/lib/libvtkGraphics.so.5.8.0 /usr/lib/libvtkFiltering.so.5.8.0 /usr/lib/libvtkCommon.so.5.8.0 /usr/lib/libvtksys.so.5.8.0 -ldl -lm -Wl,-rpath-link,/build/buildd-gdcm_2.2.4-1-ia64-JJJW9m/gdcm-2.2.4/obj-ia64-linux-gnu/bin 
collect2: ld terminated with signal 11 [Segmentation fault]
/usr/bin/ld: BFD (GNU Binutils for Debian) 2.23.52.20130722 assertion fail elf64-ia64.c:2723
make[3]: *** [bin/libvtkgdcm.so.2.2.4] Error 1
make[3]: Leaving directory `/build/buildd-gdcm_2.2.4-1-ia64-JJJW9m/gdcm-2.2.4/obj-ia64-linux-gnu'

ref:
https://buildd.debian.org/status/fetch.php?pkg=gdcm&arch=ia64&ver=2.2.4-1&stamp=1374928496



Added indication that 718047 affects src:gdcm Request was from Mathieu Malaterre <[email protected]> to [email protected]. (Sun, 28 Jul 2013 08:03:08 GMT) (full text, mbox, link).


Added tag(s) sid and jessie. Request was from Holger Levsen <[email protected]> to [email protected]. (Sun, 28 Jul 2013 13:51:34 GMT) (full text, mbox, link).


Information forwarded to [email protected], Matthias Klose <[email protected]>:
Bug#718047; Package binutils. (Sun, 25 Aug 2013 10:21:07 GMT) (full text, mbox, link).


Acknowledgement sent to Stephan Schreiber <[email protected]>:
Extra info received and forwarded to list. Copy sent to Matthias Klose <[email protected]>. (Sun, 25 Aug 2013 10:21:07 GMT) (full text, mbox, link).


Message #14 received at [email protected] (full text, mbox, reply):

From: Stephan Schreiber <[email protected]>
To: [email protected]
Cc: Mathieu Malaterre <[email protected]>
Subject: ia64, ld segfault on --as-needed
Date: Sun, 25 Aug 2013 12:18:05 +0200
retitle 718047 ia64, ld segfault on --as-needed
found 718047 2.23.52.20130727-1
tags 718047 - sid jessie
thanks

ia64.

The gdcm package isn't the only one which is affected by that ld bug.
Another example is the iceweasel 17.0.8esr-1 package; ld crashes on  
the test suite.

The bug is triggered by the --as-needed switch.

The problem is in bfd/elflink.c in the function elf_link_add_object_symbols().
When an input file is linked with the ---as-needed in effect, the  
elf_link_add_object_symbols() function
(1) clones the symbol table;
(2) adds the new information
(3) restores the symbol table if it turns out that the new input is  
*not* needed.

The problem is that on bullet (2) things are modified that aren't  
restored on bullet (3).
The main problem is that elf_link_add_object_symbols() calls the
*bed->elf_backend_copy_indirect_symbol()
function both directly and in a nested way on some calls of  
_bfd_elf_merge_symbol().
elf_backend_copy_indirect_symbol is elfNN_ia64_hash_copy_indirect() on  
ia64 (in /bfd/elfnn-ia64.c).
elfNN_ia64_hash_copy_indirect() moves the info about the usage of  
dynamic symbols from one symbol to another; it is an array of struct  
elfNN_ia64_link_hash_entry in separately allocated memory.
It sets the ->info member of the symbol to NULL and adjusts the ->h  
member of all dynamic symbols to the target symbol.
When elf_link_add_object_symbols() restores the symbol table (3), the  
->info member (which was NULL) is set to the former array of dynamic  
symbols, but the ->h members of the dynmaic symbols point to another  
symbol.
The other symbol is deleted (freed memory); when the implementation  
walks through the symbols in a later stage, the crash occurs. (The  
failed assert is just a side effect.)

There is another thing which is modified on (2) but isn't restored on (3):
The bfd_elf_link_record_dynamic_symbol() function is called, which may  
add a new string to the string table via _bfd_elf_strtab_add().
Since the string table isn't restored by elf_link_add_object_symbols  
(3), the result is a failing assert on writing out the string table on  
a later stage:
bfd/elf-strtab.c:273:
      BFD_ASSERT (tab->array[i]->refcount == 0);


I think we should talk with the upstream about the problem because I  
don't have a good idea how to fix it at the moment.
Comments are appreciated.

Stephan





Changed Bug title to 'ia64, ld segfault on --as-needed' from 'binutils: assertion fail elf64-ia64.c:2723' Request was from Stephan Schreiber <[email protected]> to [email protected]. (Sun, 25 Aug 2013 10:21:13 GMT) (full text, mbox, link).


Marked as found in versions binutils/2.23.52.20130727-1. Request was from Stephan Schreiber <[email protected]> to [email protected]. (Sun, 25 Aug 2013 10:21:14 GMT) (full text, mbox, link).


Removed tag(s) sid and jessie. Request was from Stephan Schreiber <[email protected]> to [email protected]. (Sun, 25 Aug 2013 10:21:15 GMT) (full text, mbox, link).


Set Bug forwarded-to-address to 'http://sourceware.org/bugzilla/show_bug.cgi?id=15891'. Request was from Mathieu Malaterre <[email protected]> to [email protected]. (Mon, 26 Aug 2013 09:18:10 GMT) (full text, mbox, link).


Information forwarded to [email protected], Matthias Klose <[email protected]>:
Bug#718047; Package binutils. (Tue, 03 Sep 2013 06:39:04 GMT) (full text, mbox, link).


Acknowledgement sent to Mathieu Malaterre <[email protected]>:
Extra info received and forwarded to list. Copy sent to Matthias Klose <[email protected]>. (Tue, 03 Sep 2013 06:39:04 GMT) (full text, mbox, link).


Message #27 received at [email protected] (full text, mbox, reply):

From: Mathieu Malaterre <[email protected]>
To: Control bugs server <[email protected]>, [email protected]
Date: Tue, 3 Sep 2013 08:35:18 +0200
affects 718047  + src:vxl
thanks

I think this also affects VXL:

https://buildd.debian.org/status/fetch.php?pkg=vxl&arch=ia64&ver=1.17.0-6&stamp=1378127208

Linking CXX shared library ../../../lib/libvipl.so
cd /«PKGBUILDDIR»/obj-ia64-linux-gnu/contrib/tbl/vipl &&
/usr/bin/cmake -E cmake_link_script CMakeFiles/vipl.dir/link.txt
--verbose=1
/usr/bin/c++  -fPIC -g -O2 -Wformat -Werror=format-security
-D_FORTIFY_SOURCE=2    -Wl,--as-needed  -shared
-Wl,-soname,libvipl.so.1.17 -o ../../../lib/libvipl.so.1.17.0
CMakeFiles/vipl.dir/filter/vipl_filter_abs.o
../../../lib/libvil.so.1.17.0 ../../../lib/libvil1.so.1.17.0
../../../lib/libvnl.so.1.17.0 ../../../lib/libvbl.so.1.17.0 -lgeotiff
../../../lib/libdcmtk.so.1.17.0 ../../../lib/libopenjpeg2.so.2.0.0
-ljpeg -ltiff -lpng -lz ../../../lib/libvcl.so.1.17.0 -lm
-Wl,-rpath,/«PKGBUILDDIR»/obj-ia64-linux-gnu/lib:
collect2: ld terminated with signal 11 [Segmentation fault]
make[3]: *** [lib/libvipl.so.1.17.0] Error 1
make[3]: Leaving directory `/«PKGBUILDDIR»/obj-ia64-linux-gnu'
make[2]: *** [contrib/tbl/vipl/CMakeFiles/vipl.dir/all] Error 2
make[2]: *** Waiting for unfinished jobs....



Added indication that 718047 affects src:vxl Request was from Mathieu Malaterre <[email protected]> to [email protected]. (Tue, 03 Sep 2013 06:39:07 GMT) (full text, mbox, link).


Information forwarded to [email protected]:
Bug#718047; Package binutils. (Tue, 17 Sep 2013 09:00:04 GMT) (full text, mbox, link).


Acknowledgement sent to Matthias Klose <[email protected]>:
Extra info received and forwarded to list. (Tue, 17 Sep 2013 09:00:04 GMT) (full text, mbox, link).


Message #34 received at [email protected] (full text, mbox, reply):

From: Matthias Klose <[email protected]>
To: [email protected]
Cc: Mathieu Malaterre <[email protected]>, [email protected]
Subject: Re: ia64, ld segfault on --as-needed
Date: Tue, 17 Sep 2013 10:56:15 +0200
Control: severity -1 normal
Control: tags -1 + moreinfo help

filing this report with this severity, for a non-working non-default option
seems to be wrong.

not including the object files (including the shared objects) doesn't help,
these are missing in the upstream report as well.



Severity set to 'normal' from 'grave' Request was from Matthias Klose <[email protected]> to [email protected]. (Tue, 17 Sep 2013 09:00:04 GMT) (full text, mbox, link).


Added tag(s) help and moreinfo. Request was from Matthias Klose <[email protected]> to [email protected]. (Tue, 17 Sep 2013 09:00:05 GMT) (full text, mbox, link).


Information forwarded to [email protected], Matthias Klose <[email protected]>:
Bug#718047; Package binutils. (Wed, 18 Sep 2013 08:57:04 GMT) (full text, mbox, link).


Acknowledgement sent to Mathieu Malaterre <[email protected]>:
Extra info received and forwarded to list. Copy sent to Matthias Klose <[email protected]>. (Wed, 18 Sep 2013 08:57:05 GMT) (full text, mbox, link).


Message #43 received at [email protected] (full text, mbox, reply):

From: Mathieu Malaterre <[email protected]>
To: Matthias Klose <[email protected]>, [email protected]
Cc: [email protected], [email protected]
Subject: Re: ia64, ld segfault on --as-needed
Date: Wed, 18 Sep 2013 10:53:53 +0200
On Tue, Sep 17, 2013 at 10:56 AM, Matthias Klose <[email protected]> wrote:

> filing this report with this severity, for a non-working non-default option
> seems to be wrong.

This is a default option at least on one derivative: Ubuntu
https://wiki.debian.org/qa.debian.org/FTBFS

This is also a recommended flag AFAIK:
https://wiki.debian.org/HardeningWalkthrough

> not including the object files (including the shared objects) doesn't help,
> these are missing in the upstream report as well.

I am missing your point here. Ideally what should I report upstream ?

Thanks.



Added indication that bug 718047 blocks 730157 Request was from Stephan Schreiber <[email protected]> to [email protected]. (Sat, 23 Nov 2013 09:27:13 GMT) (full text, mbox, link).


Added tag(s) confirmed. Request was from Mathieu Malaterre <[email protected]> to [email protected]. (Tue, 03 Dec 2013 12:03:07 GMT) (full text, mbox, link).


Added indication that 718047 affects paraview Request was from Julien Cristau <[email protected]> to [email protected]. (Wed, 25 Dec 2013 11:09:04 GMT) (full text, mbox, link).


Information forwarded to [email protected], Matthias Klose <[email protected]>:
Bug#718047; Package binutils. (Fri, 17 Jan 2014 20:24:14 GMT) (full text, mbox, link).


Acknowledgement sent to "Manuel A. Fernandez Montecelo" <[email protected]>:
Extra info received and forwarded to list. Copy sent to Matthias Klose <[email protected]>. (Fri, 17 Jan 2014 20:24:14 GMT) (full text, mbox, link).


Message #54 received at [email protected] (full text, mbox, reply):

From: "Manuel A. Fernandez Montecelo" <[email protected]>
To: [email protected]
Subject: ia64, ld segfault on --as-needed
Date: Fri, 17 Jan 2014 20:21:27 +0000
affects 718047 + src:ogre-1.9 src:openscenegraph
stop

This affects ogre-1.9 (see fix below [1]) and openscenegraph uploaded
recently [2].


[1] http://anonscm.debian.org/gitweb/?p=pkg-games/ogre-1.9.git;a=commitdiff;h=23eb0ca4fac15f5b300c82be130e729deda4cdc9#patch3

[2] https://buildd.debian.org/status/fetch.php?pkg=openscenegraph&arch=ia64&ver=3.2.0%7Erc1-2&stamp=1389850577

-- 
Manuel A. Fernandez Montecelo <[email protected]>



Added indication that 718047 affects src:ogre-1.9 and src:openscenegraph Request was from "Manuel A. Fernandez Montecelo" <[email protected]> to [email protected]. (Fri, 17 Jan 2014 20:24:19 GMT) (full text, mbox, link).


Reply sent to Mathieu Malaterre <[email protected]>:
You have taken responsibility. (Fri, 12 Sep 2014 16:03:15 GMT) (full text, mbox, link).


Notification sent to Mathieu Malaterre <[email protected]>:
Bug acknowledged by developer. (Fri, 12 Sep 2014 16:03:15 GMT) (full text, mbox, link).


Message #61 received at [email protected] (full text, mbox, reply):

From: Mathieu Malaterre <[email protected]>
To: [email protected]
Date: Fri, 12 Sep 2014 17:59:58 +0200
IA64 has been removed from jessie. No way it is coming back. closing.

ref:
https://lists.debian.org/debian-devel-announce/2014/01/msg00009.html



Bug archived. Request was from Debbugs Internal Request <[email protected]> to [email protected]. (Sat, 11 Oct 2014 07:31:06 GMT) (full text, mbox, link).


Bug unarchived. Request was from Mathieu Malaterre <[email protected]> to [email protected]. (Thu, 18 Jan 2018 17:54:06 GMT) (full text, mbox, link).


Bug reopened Request was from Mathieu Malaterre <[email protected]> to [email protected]. (Thu, 18 Jan 2018 18:03:03 GMT) (full text, mbox, link).


Marked as found in versions binutils/2.29.1-13. Request was from Mathieu Malaterre <[email protected]> to [email protected]. (Fri, 19 Jan 2018 08:30:04 GMT) (full text, mbox, link).


Send a report that this bug log contains spam.


Debian bug tracking system administrator <[email protected]>. Last modified: Tue May 13 12:42:37 2025; Machine Name: buxtehude

Debian Bug tracking system

Debbugs is free software and licensed under the terms of the GNU General Public License version 2. The current version can be obtained from https://bugs.debian.org/debbugs-source/.

Copyright © 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson, 2005-2017 Don Armstrong, and many other contributors.