Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 599082 - app-misc/pax-utils: lddtree broken by dev-python/pyelftools-0.24 when used with python3
Summary: app-misc/pax-utils: lddtree broken by dev-python/pyelftools-0.24 when used wi...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: SpanKY
URL:
Whiteboard:
Keywords: InVCS
Depends on:
Blocks:
 
Reported: 2016-11-06 21:17 UTC by Mateusz Lenik
Modified: 2017-01-21 23:51 UTC (History)
4 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
lddtree.py: work around pyelftools API change (0001-lddtree.py-work-around-pyelftools-API-change.patch,698 bytes, patch)
2016-11-08 20:42 UTC, Mike Gilbert
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Mateusz Lenik 2016-11-06 21:17:12 UTC
lddtree is used in critical tools like genkernel:

* LVM: Adding support (copying binaries from system)...
Traceback (most recent call last):
  File "/usr/bin/lddtree", line 789, in <module>
    sys.exit(main(sys.argv[1:]))
  File "/usr/bin/lddtree", line 751, in main
    display=p, debug=options.debug)
  File "/usr/bin/lddtree", line 408, in ParseELF
    interp = bstr(segment.get_interp_name())
  File "/usr/bin/lddtree", line 75, in bstr
    return buf.decode('utf-8')
AttributeError: 'str' object has no attribute 'decode'
*         >> Appending luks cpio data...
* Including LUKS support
Traceback (most recent call last):
  File "/usr/bin/lddtree", line 789, in <module>
    sys.exit(main(sys.argv[1:]))
  File "/usr/bin/lddtree", line 751, in main
    display=p, debug=options.debug)
  File "/usr/bin/lddtree", line 408, in ParseELF
    interp = bstr(segment.get_interp_name())
  File "/usr/bin/lddtree", line 75, in bstr
    return buf.decode('utf-8')
AttributeError: 'str' object has no attribute 'decode'
*         >> Appending modules cpio data...

With pyelftools-0.24 this generates unusable ramdisks that render the system unbootable. That bug occurs only when python is python3. Downgrading to -0.23-r1 helps.
Comment 1 Thomas Deutschmann (RETIRED) gentoo-dev 2016-11-07 15:12:34 UTC
CC'ing genkernel project to let them know that initramfs generation with Python 3.4 for example can currently result in problems on ~arch.
Comment 2 Oleh 2016-11-08 19:46:07 UTC
confirmed. i against marking this bug report as medium. broken initramfs is critical problem.
Comment 3 Oleh 2016-11-08 19:47:22 UTC
* busybox: >> Using cache
* initramfs: >> Initializing...
*         >> Appending base_layout cpio data...
*         >> Appending auxilary cpio data...
*         >> Copying keymaps
*         >> Appending busybox cpio data...
*         >> Appending modules cpio data...
*         >> Appending zfs cpio data...
cp: cannot stat ‘/etc/zfs/zdev.conf’: No such file or directory
* Could not copy file /etc/zfs/zdev.conf for ZFS
Traceback (most recent call last):
  File "/usr/bin/lddtree", line 789, in <module>
    sys.exit(main(sys.argv[1:]))
  File "/usr/bin/lddtree", line 751, in main
    display=p, debug=options.debug)
  File "/usr/bin/lddtree", line 408, in ParseELF
    interp = bstr(segment.get_interp_name())
  File "/usr/bin/lddtree", line 75, in bstr
    return buf.decode('utf-8')
AttributeError: 'str' object has no attribute 'decode'
*         >> Appending blkid cpio data...
Traceback (most recent call last):
  File "/usr/bin/lddtree", line 789, in <module>
    sys.exit(main(sys.argv[1:]))
  File "/usr/bin/lddtree", line 751, in main
    display=p, debug=options.debug)
  File "/usr/bin/lddtree", line 408, in ParseELF
    interp = bstr(segment.get_interp_name())
  File "/usr/bin/lddtree", line 75, in bstr
    return buf.decode('utf-8')
AttributeError: 'str' object has no attribute 'decode'
*         >> Appending modprobed cpio data...
*         >> Compressing cpio data (.xz)...

it generates initramfs image still but it's broken (unbootable)
Comment 4 Mike Gilbert gentoo-dev 2016-11-08 20:42:57 UTC
Created attachment 452744 [details, diff]
lddtree.py: work around pyelftools API change

Here's a patch.
Comment 5 Mike Gilbert gentoo-dev 2016-11-08 20:49:27 UTC
Fixed on master. I'll revbump 1.1.6 in a bit.

https://gitweb.gentoo.org/proj/pax-utils.git/commit/?id=6557b1512ebfda508345e032e09ed85789c16c98
Comment 6 Mike Gilbert gentoo-dev 2016-11-08 22:07:48 UTC
commit 19ffdf6414b7215a89a25c6b13cbf9197c86451a
Author: Mike Gilbert <floppym@gentoo.org>
Date:   Tue Nov 8 17:04:10 2016 -0500

    app-misc/pax-utils: fix lddtree with pyelfutils-0.24

    Bug: https://bugs.gentoo.org/599082
    Package-Manager: portage-2.3.2_p5

 ...tree.py-work-around-pyelftools-API-change.patch | 29 ++++++++++
 app-misc/pax-utils/pax-utils-1.1.6-r1.ebuild       | 62 ++++++++++++++++++++++
 2 files changed, 91 insertions(+)
Comment 7 Mateusz Lenik 2016-11-09 06:56:37 UTC
1.1.6-r1 fixes the problem for me, thanks :)
Comment 8 SpanKY gentoo-dev 2016-11-12 07:11:55 UTC
thanks for the fix!
Comment 9 Thibaud CANALE 2017-01-21 19:51:14 UTC
Guys, it would have been nice to stabilize this version when dev-python/pyelftools version 0.24 got stabilized 
https://gitweb.gentoo.org/repo/gentoo.git/commit/dev-python/pyelftools?id=ff881e523b525df9b931f59baeef7804d9b47b9f

Please block bug 606280.