Debian Bug report logs - #839264
mklibs-copy: segfaults under fakeroot on various archs: armel armhf i386 mips mipsel

version graph

Package: mklibs-copy; Maintainer for mklibs-copy is Debian Install System Team <debian-boot@lists.debian.org>; Source for mklibs-copy is src:mklibs (PTS, buildd, popcon).

Reported by: Cyril Brulebois <kibi@debian.org>

Date: Fri, 30 Sep 2016 22:27:01 UTC

Severity: serious

Tags: patch

Found in version mklibs/0.1.41

Fixed in version mklibs/0.1.42

Done: Cyril Brulebois <kibi@debian.org>

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, Debian Install System Team <debian-boot@lists.debian.org>:
Bug#839264; Package mklibs-copy. (Fri, 30 Sep 2016 22:27:04 GMT) (full text, mbox, link).


Acknowledgement sent to Cyril Brulebois <kibi@debian.org>:
New Bug report received and forwarded. Copy sent to Debian Install System Team <debian-boot@lists.debian.org>. (Fri, 30 Sep 2016 22:27:04 GMT) (full text, mbox, link).


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

From: Cyril Brulebois <kibi@debian.org>
To: Debian Bug Tracking System <submit@bugs.debian.org>
Subject: mklibs-copy: segfaults under fakeroot on various archs: armel armhf i386 mips mipsel
Date: Sat, 01 Oct 2016 00:22:13 +0200
Package: mklibs-copy
Version: 0.1.41
Severity: serious
Tags: patch pending
Justification: breaks d-i build

Hi,

We've been seeing a bunch of d-i FTBFS since early september, due to
mklibs-readelf segfaults, on various archs. Looking at d-i build logs,
what changed then (example for i386, see timestamps 20160904-00:46
[success] vs. 20160905-00:41 [failure]) isn't obvious… (but we don't
store host package list, unfortunately)

In a stretch i386 chroot, I've tried downgrading fakeroot to a previous
version, with no effect, and also libc* to 2.24-1 (which is the only
thing that popped up in the diff), with no effect either.

Anyway, looking at the segfault, it is triggered by trying to look at
the dynamic section:
| (gdb) bt full
| #0  0x0805e818 in std::vector<Elf::dynamic*, std::allocator<Elf::dynamic*> >::begin (this=0x6c2f7572) at /usr/include/c++/6/bits/stl_vector.h:558
| No locals.
| #1  0x0805de2e in process_dynamics (file=0x8075a10, tag=15) at ../../../src/mklibs-readelf/main.cpp:62
|         it = <error reading variable it (Cannot access memory at address 0x3336e00)>
|         section = 0x6c2f756e
| #2  0x0805e47f in process (cmd=COMMAND_PRINT_RPATH, filename=0xffffd6b1 "./tmp/cdrom_gtk/tree/sbin/blkid") at ../../../src/mklibs-readelf/main.cpp:149
|         file = 0x8075a10
| #3  0x0805e6cd in main (argc=3, argv=0xffffd544) at ../../../src/mklibs-readelf/main.cpp:242
|         i = 2
|         c = -1
|         cmd = COMMAND_PRINT_RPATH
| (gdb) 

but that doesn't happen without fakeroot: section is 0x0 instead of
pointing to an address gdb can't access.

I've checked how the sections are initialized in file_data's constructor
(src/mklibs-readelf/elf.cpp), it seems the section_type_DYNAMIC::id case
in the switch is never hit. (With or without fakeroot, according to a
debugging statement I've never seen printed.)

Seeing how there's an explicit init for those:
| section_GNU_VERDEF = NULL;
| section_GNU_VERNEED = NULL;
| section_GNU_VERSYM = NULL;

I decided to try my luck and to init the two others explicitly, and it
seems to fix the issue: section_DYNAMIC and section_DYNSYM.

I'll commit this shortly, once I've checked the resulting image seems to
actually work.


KiBi.



Reply sent to Cyril Brulebois <kibi@debian.org>:
You have taken responsibility. (Fri, 30 Sep 2016 23:09:06 GMT) (full text, mbox, link).


Notification sent to Cyril Brulebois <kibi@debian.org>:
Bug acknowledged by developer. (Fri, 30 Sep 2016 23:09:06 GMT) (full text, mbox, link).


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

From: Cyril Brulebois <kibi@debian.org>
To: 839264-close@bugs.debian.org
Subject: Bug#839264: fixed in mklibs 0.1.42
Date: Fri, 30 Sep 2016 23:05:07 +0000
Source: mklibs
Source-Version: 0.1.42

We believe that the bug you reported is fixed in the latest version of
mklibs, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 839264@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Cyril Brulebois <kibi@debian.org> (supplier of updated mklibs package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@ftp-master.debian.org)


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Format: 1.8
Date: Fri, 30 Sep 2016 22:32:13 +0000
Source: mklibs
Binary: mklibs mklibs-copy
Architecture: source
Version: 0.1.42
Distribution: unstable
Urgency: high
Maintainer: Debian Install System Team <debian-boot@lists.debian.org>
Changed-By: Cyril Brulebois <kibi@debian.org>
Description:
 mklibs     - Shared library reduction script
 mklibs-copy - Shared library reduction script
Closes: 839264
Changes:
 mklibs (0.1.42) unstable; urgency=high
 .
   * mklibs-readelf: Initialize section_DYNAMIC and section_DYNSYM to
     NULL to make sure they don't end up with a random address, which
     could lead to a segfault when trying to access them. This was
     seen under fakeroot with the debian-installer FTBFS on armel, armhf,
     i386, mips, and mipsel since early september (Closes: #839264).
Checksums-Sha1:
 718c41f31670efe72692cbbf2a6c594e59aadeb4 1725 mklibs_0.1.42.dsc
 3cee73a88c6323777eb1dabed1658a9c40a892c0 22428 mklibs_0.1.42.tar.xz
Checksums-Sha256:
 e4ba7f69f76e0cbf161ddb9da40d5d61c9b310fffd6f4b41582086d29be20608 1725 mklibs_0.1.42.dsc
 340daf19693efc1c3f9cf2d9d879759d1ffb8d1818727900054ee1e2d6002381 22428 mklibs_0.1.42.tar.xz
Files:
 5451b623c7eaf227777501aad6e72118 1725 devel optional mklibs_0.1.42.dsc
 5242f2c7244c23a51250a20cffeec626 22428 devel optional mklibs_0.1.42.tar.xz

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1

iQIcBAEBAgAGBQJX7u0wAAoJEP+RSvDCs1UgVG4P/jVWY06FKetzmUtZ9Uuk3FrV
FWDSwAFhbOjqnPEWLc86eGVFptexSlcRwAKfvCZ31b8/er3zDTN8plaxp23tSg52
RL9d3yXOFBlj881tdeqK+R1AQ81TR4Wo6AZE0Yjfse8eRAjJD5jWgMTutn+Ul2TI
VOg7oHBh7dsEp6uzN6ca5Dz2Sp0+t2wf7wni6xiuU3Y1HqSXWaBuo2SbeET8cc0j
DKYavCyvJKma8fZRazKF8j/dr5IAvz4AqtxcpvbLSpn+Lk/CIIs+6UkvmRvnnIOV
TajuZOHoCq1fOzUeQIwD7OZO9PkXvgbA992wNRqYgDtv9KpiSsqNm+ut0KQTxUR7
3ZAGbE3HWDB8TXWjI7QeIJdTWlK/hdwOEQ6qexmC79iPoz4+ULdhQjm0iBMUyBM0
p0x4GPGVBc0HquHMbh6ZbUQsyhHMr4EzZB+o9NcS53DPrQ+XM7qIpj1Ygrc2mViy
kxPUo/Imnp60vemPfXhngnUiqYNgBFjkIS3qoV5HfApbP0XMd3xrPOfQxZYzcZfW
7sKTg6e0R31hWhd6YhBFZwpFIq9b/si7QmZp8Pb8BXTT0VivQIlSflH+BbuqzhVw
axRmB4wWJXm0677QuB8h/ieciICE5vVkYv+bzK5unIK5m6aU9d1Y+84VvUDfkRj4
q6wmLtYlGhuyQMhbre1N
=Ggnk
-----END PGP SIGNATURE-----




Bug archived. Request was from Debbugs Internal Request <owner@bugs.debian.org> to internal_control@bugs.debian.org. (Mon, 31 Oct 2016 07:28: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: Sun Jun 4 06:51:40 2023; Machine Name: buxtehude

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.