Debian Bug report logs - #808205
libc6: Unrecognized relocation when compiling

version graph

Package: libc6-dev; Maintainer for libc6-dev is GNU Libc Maintainers <debian-glibc@lists.debian.org>; Source for libc6-dev is src:glibc (PTS, buildd, popcon).

Reported by: John Aston <johnastonsr@gmail.com>

Date: Thu, 17 Dec 2015 09:33:05 UTC

Severity: serious

Tags: stretch

Merged with 808181, 808206

Found in version glibc/2.21-4

Done: Aurelien Jarno <aurelien@aurel32.net>

Bug is archived. No further changes may be made.

Toggle useless messages

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


Report forwarded to debian-bugs-dist@lists.debian.org, johnastonsr@gmail.com, GNU Libc Maintainers <debian-glibc@lists.debian.org>:
Bug#808205; Package libc6. (Thu, 17 Dec 2015 09:33:09 GMT) (full text, mbox, link).


Acknowledgement sent to John Aston <johnastonsr@gmail.com>:
New Bug report received and forwarded. Copy sent to johnastonsr@gmail.com, GNU Libc Maintainers <debian-glibc@lists.debian.org>. (Thu, 17 Dec 2015 09:33:09 GMT) (full text, mbox, link).


Message #5 received at submit@bugs.debian.org (full text, mbox, reply):

From: John Aston <johnastonsr@gmail.com>
To: Debian Bug Tracking System <submit@bugs.debian.org>
Subject: libc6: Unrecognized relocation when compiling
Date: Thu, 17 Dec 2015 04:31:40 -0500
Package: libc6
Version: 2.21-4
Severity: important

Dear Maintainer,

When attempting to compile a simple C program, the link stage fails with an unrecognized relocation error.

This problem seems to have appeared in the latest version, 2.21-4 (and is also present in 2.22-0experimental which I tested before submitting); it was not present in 2.19-22 which I was using prior to tonight.  When using 2.19-22 (pinned to that version after installing the package from a CD), it works normally.  When upgraded, it fails as per below.

The problem manifested in a much more complicated build process, but I can duplicate it with a program as simple as this:

#include <stdio.h>
int main() {
    fprintf(stdout, "Hello, world.\n");
    return(0);
}

When compiling, the following error happens: 

$ gcc hello.c -o hello
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/crti.o: unrecognized relocation (0x2a) in section `.init'
/usr/bin/ld: final link failed: Bad value
collect2: error: ld returned 1 exit status

The expected behavior is for the program to compile normally without error.


-- System Information:
Debian Release: stretch/sid
  APT prefers testing
  APT policy: (500, 'testing'), (1, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 4.2.0-1-amd64 (SMP w/8 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages libc6 depends on:
ii  libgcc1  1:5.2.1-23

libc6 recommends no packages.

Versions of packages libc6 suggests:
ii  debconf [debconf-2.0]  1.5.58
pn  glibc-doc              <none>
ii  libc-l10n              2.22-0experimental1
ii  locales                2.21-4

-- debconf information:
  glibc/disable-screensaver:
  glibc/restart-services:
  glibc/kernel-not-supported:
* libraries/restart-without-asking: true
  glibc/restart-failed:
  glibc/upgrade: true
  glibc/kernel-too-old:



Information forwarded to debian-bugs-dist@lists.debian.org, GNU Libc Maintainers <debian-glibc@lists.debian.org>:
Bug#808205; Package libc6. (Thu, 17 Dec 2015 10:15:06 GMT) (full text, mbox, link).


Acknowledgement sent to Aurelien Jarno <aurelien@aurel32.net>:
Extra info received and forwarded to list. Copy sent to GNU Libc Maintainers <debian-glibc@lists.debian.org>. (Thu, 17 Dec 2015 10:15:06 GMT) (full text, mbox, link).


Message #10 received at 808205@bugs.debian.org (full text, mbox, reply):

From: Aurelien Jarno <aurelien@aurel32.net>
To: Dima Kogan <dima@secretsauce.net>, Christophe <christophe.fish@gmail.com>, Emmanuel Charpentier <emm.charpentier@free.fr>, Vlad Orlov <monsta@inbox.ru>, John Aston <johnastonsr@gmail.com>, Max Kellermann <max@duempel.org>
Cc: 808181@bugs.debian.org, 808205@bugs.debian.org, 808206@bugs.debian.org
Subject: Re: Bug#808181: libc6: Upgrade can make the linker unusable
Date: Thu, 17 Dec 2015 11:10:43 +0100
reassign 808181 libc6-dev
reassign 808205 libc6-dev
forcemerge 808181 808205
forcemerge 808181 808206
severity 808181 serious
thanks

On 2015-12-16 23:36, Aurelien Jarno wrote:
> On 2015-12-16 13:15, Dima Kogan wrote:
> > Package: libc6
> > Severity: normal
> > 
> > Hi. I had
> > 
> >   libc6    = 2.19-22
> >   binutils = 2.25-4
> > 
> > and all was well. Then I upgraded to libc6 = 2.21-4 (currently latest in
> > sid). As a result, even the most basic build-time linking would fail.
> > For instance, with a trivial hello-world program:
> > 
> >   $ gcc-5 -o tst tst.c                                            
> > 
> >   /usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/crti.o: unrecognized relocation (0x2a) in section `.init'
> >   /usr/bin/ld: final link failed: Bad value
> >   collect2: error: ld returned 1 exit status
> > 
> > This would happen with gcc-5 and with gcc-4.9. Downgrading libc6 would
> > fix it. After some fiddling I realized that upgrading to binutils =
> > 2.25.90.20151209-1 (currently latest in sid) fixes it. I.e. with the
> > latest libc6 and the latest binutils packages things work.
> 
> The problem is not introduced by the glibc, but just by the fact that
> it has been built with a recent binutils version which adds new
> relocation types on i386 and amd64. This means that ALL static libraries
> are affected by this problem.
> 
> > Can the broken combination be prevented with some Conflicts: tags?
> > Currently this is a trap for the unwary.
> 
> I therefore don't think we need to fix that at the glibc level. Either
> we just ignore the problem saying we don't support partial upgrades or
> we try to find a global way to fix the dependencies for all libraries.

We are working to migrate binutils version 2.25.90.20151209-1 into
testing asap. If everything goes well it should be the case after the
13:52 UTC dinstall run, so a few hours after that on the mirrors.

In the meantime fetching and installing this version from sid, should
solve the issue.

Aurelien

-- 
Aurelien Jarno                          GPG: 4096R/1DDD8C9B
aurelien@aurel32.net                 http://www.aurel32.net



Bug reassigned from package 'libc6' to 'libc6-dev'. Request was from Aurelien Jarno <aurelien@aurel32.net> to control@bugs.debian.org. (Thu, 17 Dec 2015 10:15:13 GMT) (full text, mbox, link).


No longer marked as found in versions glibc/2.21-4. Request was from Aurelien Jarno <aurelien@aurel32.net> to control@bugs.debian.org. (Thu, 17 Dec 2015 10:15:14 GMT) (full text, mbox, link).


Added tag(s) stretch. Request was from Aurelien Jarno <aurelien@aurel32.net> to control@bugs.debian.org. (Thu, 17 Dec 2015 10:15:15 GMT) (full text, mbox, link).


Merged 808181 808205 Request was from Aurelien Jarno <aurelien@aurel32.net> to control@bugs.debian.org. (Thu, 17 Dec 2015 10:15:16 GMT) (full text, mbox, link).


Marked as found in versions glibc/2.21-4. Request was from Aurelien Jarno <aurelien@aurel32.net> to control@bugs.debian.org. (Thu, 17 Dec 2015 10:15:17 GMT) (full text, mbox, link).


Merged 808181 808205 808206 Request was from Aurelien Jarno <aurelien@aurel32.net> to control@bugs.debian.org. (Thu, 17 Dec 2015 10:15:23 GMT) (full text, mbox, link).


Severity set to 'serious' from 'important' Request was from Aurelien Jarno <aurelien@aurel32.net> to control@bugs.debian.org. (Thu, 17 Dec 2015 10:15:25 GMT) (full text, mbox, link).


Message #25 received at 808181-done@bugs.debian.org (full text, mbox, reply):

From: Aurelien Jarno <aurelien@aurel32.net>
To: 808181-done@bugs.debian.org, 808205-done@bugs.debian.org, 808206-done@bugs.debian.org
Subject: Re: Bug#808181: libc6: Upgrade can make the linker unusable
Date: Fri, 18 Dec 2015 14:46:18 +0100
On 2015-12-17 11:10, Aurelien Jarno wrote:
> reassign 808181 libc6-dev
> reassign 808205 libc6-dev
> forcemerge 808181 808205
> forcemerge 808181 808206
> severity 808181 serious
> thanks
> 
> On 2015-12-16 23:36, Aurelien Jarno wrote:
> > On 2015-12-16 13:15, Dima Kogan wrote:
> > > Package: libc6
> > > Severity: normal
> > > 
> > > Hi. I had
> > > 
> > >   libc6    = 2.19-22
> > >   binutils = 2.25-4
> > > 
> > > and all was well. Then I upgraded to libc6 = 2.21-4 (currently latest in
> > > sid). As a result, even the most basic build-time linking would fail.
> > > For instance, with a trivial hello-world program:
> > > 
> > >   $ gcc-5 -o tst tst.c                                            
> > > 
> > >   /usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/crti.o: unrecognized relocation (0x2a) in section `.init'
> > >   /usr/bin/ld: final link failed: Bad value
> > >   collect2: error: ld returned 1 exit status
> > > 
> > > This would happen with gcc-5 and with gcc-4.9. Downgrading libc6 would
> > > fix it. After some fiddling I realized that upgrading to binutils =
> > > 2.25.90.20151209-1 (currently latest in sid) fixes it. I.e. with the
> > > latest libc6 and the latest binutils packages things work.
> > 
> > The problem is not introduced by the glibc, but just by the fact that
> > it has been built with a recent binutils version which adds new
> > relocation types on i386 and amd64. This means that ALL static libraries
> > are affected by this problem.
> > 
> > > Can the broken combination be prevented with some Conflicts: tags?
> > > Currently this is a trap for the unwary.
> > 
> > I therefore don't think we need to fix that at the glibc level. Either
> > we just ignore the problem saying we don't support partial upgrades or
> > we try to find a global way to fix the dependencies for all libraries.
> 
> We are working to migrate binutils version 2.25.90.20151209-1 into
> testing asap. If everything goes well it should be the case after the
> 13:52 UTC dinstall run, so a few hours after that on the mirrors.

binutils version 2.25.90.20151209-1 is now in testing, I am therefore
closing the bug.

-- 
Aurelien Jarno                          GPG: 4096R/1DDD8C9B
aurelien@aurel32.net                 http://www.aurel32.net



Information forwarded to debian-bugs-dist@lists.debian.org, GNU Libc Maintainers <debian-glibc@lists.debian.org>:
Bug#808205; Package libc6-dev. (Mon, 04 Jan 2016 16:57:03 GMT) (full text, mbox, link).


Acknowledgement sent to Mahesh Kronecker <mahesh.kronecker@gmail.com>:
Extra info received and forwarded to list. Copy sent to GNU Libc Maintainers <debian-glibc@lists.debian.org>. (Mon, 04 Jan 2016 16:57:03 GMT) (full text, mbox, link).


Message #31 received at 808205@bugs.debian.org (full text, mbox, reply):

From: Mahesh Kronecker <mahesh.kronecker@gmail.com>
To: 808205@bugs.debian.org
Subject: Re: libc6: Unrecognized relocation when compiling
Date: Tue, 5 Jan 2016 00:55:25 +0800
Dear all,
I am on Debian/Jessie, not sid nor Stretch, but I can reproduce the hello.c bug as done by John Aston:

$ gcc hello.c -o hello
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/4.9/../../../x86_64-linux-gnu/crti.o: réadressage inconnu (0x2a) dans la section « .init »
/usr/bin/ld: édition de lien finale en échec: Mauvaise valeur
collect2: error: ld returned 1 exit status

Packages:
--------------------------------------
sudo apt-cache show binutils
Package: binutils
Version: 2.25-5

Package: libc6-dev
Source: glibc
Version: 2.19-18+deb8u1

sudo apt-cache show libgcc1
Package: libgcc1
Source: gcc-4.9 (4.9.2-10)
Version: 1:4.9.2-10

sudo apt-cache show libc6
Package: libc6
Status: install ok installed
[…]
Source: glibc
Version: 2.21-1
[…]
-------------------------------------

Is there something wrong in my settings or is this related to the bug you are describing in the testing versions of Debian?
I do not know what to do to fix the issue on my system.



On Thu, 17 Dec 2015 04:31:40 -0500 John Aston <johnastonsr@gmail.com> wrote:
> Package: libc6
> Version: 2.21-4
> Severity: important
> 
> Dear Maintainer,
> 
> When attempting to compile a simple C program, the link stage fails with an unrecognized relocation error.
> 
> This problem seems to have appeared in the latest version, 2.21-4 (and is also present in 2.22-0experimental which I tested before submitting); it was not present in 2.19-22 which I was using prior to tonight.  When using 2.19-22 (pinned to that version after installing the package from a CD), it works normally.  When upgraded, it fails as per below.
> 
> The problem manifested in a much more complicated build process, but I can duplicate it with a program as simple as this:
> 
> #include <stdio.h>
> int main() {
>    fprintf(stdout, "Hello, world.\n");
>    return(0);
> }
> 
> When compiling, the following error happens: 
> 
> $ gcc hello.c -o hello
> /usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/crti.o: unrecognized relocation (0x2a) in section `.init'
> /usr/bin/ld: final link failed: Bad value
> collect2: error: ld returned 1 exit status
> 
> The expected behavior is for the program to compile normally without error.
> 
> 
> -- System Information:
> Debian Release: stretch/sid
>  APT prefers testing
>  APT policy: (500, 'testing'), (1, 'experimental')
> Architecture: amd64 (x86_64)
> 
> Kernel: Linux 4.2.0-1-amd64 (SMP w/8 CPU cores)
> Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
> Shell: /bin/sh linked to /bin/dash
> Init: systemd (via /run/systemd/system)
> 
> Versions of packages libc6 depends on:
> ii  libgcc1  1:5.2.1-23
> 
> libc6 recommends no packages.
> 
> Versions of packages libc6 suggests:
> ii  debconf [debconf-2.0]  1.5.58
> pn  glibc-doc              <none>
> ii  libc-l10n              2.22-0experimental1
> ii  locales                2.21-4
> 
> -- debconf information:
>  glibc/disable-screensaver:
>  glibc/restart-services:
>  glibc/kernel-not-supported:
> * libraries/restart-without-asking: true
>  glibc/restart-failed:
>  glibc/upgrade: true
>  glibc/kernel-too-old:
> 
> 



Information forwarded to debian-bugs-dist@lists.debian.org, GNU Libc Maintainers <debian-glibc@lists.debian.org>:
Bug#808205; Package libc6-dev. (Mon, 04 Jan 2016 17:42:03 GMT) (full text, mbox, link).


Acknowledgement sent to Aurelien Jarno <aurelien@aurel32.net>:
Extra info received and forwarded to list. Copy sent to GNU Libc Maintainers <debian-glibc@lists.debian.org>. (Mon, 04 Jan 2016 17:42:03 GMT) (full text, mbox, link).


Message #36 received at 808205@bugs.debian.org (full text, mbox, reply):

From: Aurelien Jarno <aurelien@aurel32.net>
To: Mahesh Kronecker <mahesh.kronecker@gmail.com>, 808205@bugs.debian.org
Subject: Re: Bug#808205: libc6: Unrecognized relocation when compiling
Date: Mon, 4 Jan 2016 18:39:53 +0100
On 2016-01-05 00:55, Mahesh Kronecker wrote:
> Dear all,
> I am on Debian/Jessie, not sid nor Stretch, but I can reproduce the hello.c bug as done by John Aston:
> 
> $ gcc hello.c -o hello
> /usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/4.9/../../../x86_64-linux-gnu/crti.o: réadressage inconnu (0x2a) dans la section « .init »
> /usr/bin/ld: édition de lien finale en échec: Mauvaise valeur
> collect2: error: ld returned 1 exit status
> 
> Packages:
> --------------------------------------
> sudo apt-cache show binutils
> Package: binutils
> Version: 2.25-5
> 
> Package: libc6-dev
> Source: glibc
> Version: 2.19-18+deb8u1
> 
> sudo apt-cache show libgcc1
> Package: libgcc1
> Source: gcc-4.9 (4.9.2-10)
> Version: 1:4.9.2-10
> 
> sudo apt-cache show libc6
> Package: libc6
> Status: install ok installed
> […]
> Source: glibc
> Version: 2.21-1

glibc version 2.21-1 has never been available in jessie...

> […]
> -------------------------------------
> 
> Is there something wrong in my settings or is this related to the bug you are describing in the testing versions of Debian?
> I do not know what to do to fix the issue on my system.

It really looks like your system have a mix of jessie and stretch or
sid. Can you please try to run the following commands and send me the
output:

  dpkg -l libc6:amd64

  md5sum /usr/lib/x86_64-linux-gnu/crti.o

-- 
Aurelien Jarno                          GPG: 4096R/1DDD8C9B
aurelien@aurel32.net                 http://www.aurel32.net



Information forwarded to debian-bugs-dist@lists.debian.org, GNU Libc Maintainers <debian-glibc@lists.debian.org>:
Bug#808205; Package libc6-dev. (Tue, 05 Jan 2016 02:09:04 GMT) (full text, mbox, link).


Acknowledgement sent to Mahesh Kronecker <mahesh.kronecker@gmail.com>:
Extra info received and forwarded to list. Copy sent to GNU Libc Maintainers <debian-glibc@lists.debian.org>. (Tue, 05 Jan 2016 02:09:04 GMT) (full text, mbox, link).


Message #41 received at 808205@bugs.debian.org (full text, mbox, reply):

From: Mahesh Kronecker <mahesh.kronecker@gmail.com>
To: Aurelien Jarno <aurelien@aurel32.net>
Cc: Mahesh Kronecker <mahesh.kronecker@gmail.com>, 808205@bugs.debian.org
Subject: Re: Bug#808205: libc6: Unrecognized relocation when compiling
Date: Tue, 5 Jan 2016 10:03:40 +0800
You are right. I apologize, I so much did not expect testing packages on the system I am working on that I was in denial of libc6 not being the stable version!  I don’t remember why I have sid/stretch packages (I really should not have).

$ dpkg -l libc6:amd64
[…]
ii  libc6:amd64           2.21-1          amd64           GNU C Library: Shared libraries

$ md5sum /usr/lib/x86_64-linux-gnu/crti.o
4ca8dc3c02f848753e5a5317fe78fb14  /usr/lib/x86_64-linux-gnu/crti.o

I have downgraded everything to stable and the issue has of course disappeared. Sorry for the noise and thanks for your help.




> On Jan 5, 2016, at 1:39 AM, Aurelien Jarno <aurelien@aurel32.net> wrote:
> 
> On 2016-01-05 00:55, Mahesh Kronecker wrote:
>> Dear all,
>> I am on Debian/Jessie, not sid nor Stretch, but I can reproduce the hello.c bug as done by John Aston:
>> 
>> $ gcc hello.c -o hello
>> /usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/4.9/../../../x86_64-linux-gnu/crti.o: réadressage inconnu (0x2a) dans la section « .init »
>> /usr/bin/ld: édition de lien finale en échec: Mauvaise valeur
>> collect2: error: ld returned 1 exit status
>> 
>> Packages:
>> --------------------------------------
>> sudo apt-cache show binutils
>> Package: binutils
>> Version: 2.25-5
>> 
>> Package: libc6-dev
>> Source: glibc
>> Version: 2.19-18+deb8u1
>> 
>> sudo apt-cache show libgcc1
>> Package: libgcc1
>> Source: gcc-4.9 (4.9.2-10)
>> Version: 1:4.9.2-10
>> 
>> sudo apt-cache show libc6
>> Package: libc6
>> Status: install ok installed
>> […]
>> Source: glibc
>> Version: 2.21-1
> 
> glibc version 2.21-1 has never been available in jessie...
> 
>> […]
>> -------------------------------------
>> 
>> Is there something wrong in my settings or is this related to the bug you are describing in the testing versions of Debian?
>> I do not know what to do to fix the issue on my system.
> 
> It really looks like your system have a mix of jessie and stretch or
> sid. Can you please try to run the following commands and send me the
> output:
> 
>  dpkg -l libc6:amd64
> 
>  md5sum /usr/lib/x86_64-linux-gnu/crti.o
> 
> -- 
> Aurelien Jarno                          GPG: 4096R/1DDD8C9B
> aurelien@aurel32.net                 http://www.aurel32.net




Bug archived. Request was from Debbugs Internal Request <owner@bugs.debian.org> to internal_control@bugs.debian.org. (Tue, 02 Feb 2016 07:25:42 GMT) (full text, mbox, link).


Send a report that this bug log contains spam.


Debian bug tracking system administrator <owner@bugs.debian.org>. Last modified: Sat Jan 6 11:08:02 2018; Machine Name: beach

Debian Bug tracking system

Debbugs is free software and licensed under the terms of the GNU 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.