Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 465310 - dev-python/pyelftools-0.20: DynamicTag() fails w/python-3.2
Summary: dev-python/pyelftools-0.20: DynamicTag() fails w/python-3.2
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: SpanKY
URL:
Whiteboard:
Keywords:
: 465362 (view as bug list)
Depends on:
Blocks:
 
Reported: 2013-04-09 22:21 UTC by Samuli Suominen (RETIRED)
Modified: 2013-08-15 17:09 UTC (History)
2 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Samuli Suominen (RETIRED) gentoo-dev 2013-04-09 22:21:25 UTC
$ python --version
Python 3.2.3

$ locale
LANG=en_US.UTF-8
LC_CTYPE=fi_FI.UTF-8
LC_NUMERIC="en_US.UTF-8"
LC_TIME=en_GB.UTF-8
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=

$ LC_ALL=C lddtree /bin/bash
Traceback (most recent call last):
  File "/usr/bin/lddtree", line 647, in <module>
    sys.exit(main(sys.argv[1:]))
  File "/usr/bin/lddtree", line 616, in main
    elf = ParseELF(p, options.root, ldpaths)
  File "/usr/bin/lddtree", line 328, in ParseELF
    for t in segment.iter_tags():
  File "/usr/lib64/python3.2/site-packages/elftools/elf/dynamic.py", line 63, in iter_tags
    tag = self.get_tag(n)
  File "/usr/lib64/python3.2/site-packages/elftools/elf/dynamic.py", line 77, in get_tag
    return DynamicTag(entry, self._elffile)
  File "/usr/lib64/python3.2/site-packages/elftools/elf/dynamic.py", line 32, in __init__
    setattr(self, entry.d_tag[3:].lower(), dynstr.get_string(self.entry.d_val))
AttributeError: 'NoneType' object has no attribute 'get_string'

$ lddtree /bin/bash
Traceback (most recent call last):
  File "/usr/bin/lddtree", line 647, in <module>
    sys.exit(main(sys.argv[1:]))
  File "/usr/bin/lddtree", line 616, in main
    elf = ParseELF(p, options.root, ldpaths)
  File "/usr/bin/lddtree", line 328, in ParseELF
    for t in segment.iter_tags():
  File "/usr/lib64/python3.2/site-packages/elftools/elf/dynamic.py", line 63, in iter_tags
    tag = self.get_tag(n)
  File "/usr/lib64/python3.2/site-packages/elftools/elf/dynamic.py", line 77, in get_tag
    return DynamicTag(entry, self._elffile)
  File "/usr/lib64/python3.2/site-packages/elftools/elf/dynamic.py", line 32, in __init__
    setattr(self, entry.d_tag[3:].lower(), dynstr.get_string(self.entry.d_val))
AttributeError: 'NoneType' object has no attribute 'get_string'
Comment 1 SpanKY gentoo-dev 2013-04-10 02:12:43 UTC
i don't think it's a bug in lddtree
Comment 2 Samuli Suominen (RETIRED) gentoo-dev 2013-04-10 03:12:13 UTC
works with python 2.7, but not with python 3.2:

[ebuild   R    ] app-misc/pax-utils-0.7  USE="python -caps" 0 kB
[ebuild   R    ]  dev-python/pyelftools-0.20-r2  PYTHON_TARGETS="python2_7 python3_2" 0 kB
Comment 3 SpanKY gentoo-dev 2013-04-10 03:33:15 UTC
(In reply to comment #2)

yes, you can guess which version of python i develop with ;)
Comment 4 Arfrever Frehtes Taifersar Arahesis 2013-04-10 03:47:12 UTC
This bug is caused by Vapier's patch for pyelftools.
- dynstr = elffile.get_section_by_name('.dynstr')
+ dynstr = elffile.get_section_by_name(b'.dynstr')
Comment 5 SpanKY gentoo-dev 2013-04-10 03:56:53 UTC
(In reply to comment #4)

i think you mean "fixed".  the pyelftools in the tree doesn't do b'.dynstr', it does just '.dynstr'.  that's because the version in the tree is using an old version of my work while the stuff i got merged upstream went through some changes (including adding a "b" prefix to that string).
Comment 6 Arfrever Frehtes Taifersar Arahesis 2013-04-10 04:08:04 UTC
(In reply to comment #5)
> (In reply to comment #4)
> 
> i think you mean "fixed".

I have not checked changes in upstream repository. I meant that gentoo-x86/dev-python/pyelftools/files/pyelftools-0.20-dyntags-1.patch has this line:
+            dynstr = elffile.get_section_by_name('.dynstr')
Comment 7 SpanKY gentoo-dev 2013-04-10 04:34:15 UTC
(In reply to comment #6)

yes, that is what my *old* code did (and that's the version that's in the Gentoo tree right now).  i already fixed upstream before getting it merged into the pyelftools repo.  i'm waiting for the maintainer to tag a new version before updating Gentoo.
Comment 8 Samuli Suominen (RETIRED) gentoo-dev 2013-04-10 07:41:58 UTC
*** Bug 465362 has been marked as a duplicate of this bug. ***
Comment 9 SpanKY gentoo-dev 2013-08-15 17:09:01 UTC
should be resolved with pyelftools-0.21-r2