[tor-bugs] #26207 [Core Tor/Stem]: Stem 1.6.0 incompatible with PyPy 5.6.0

Tor Bug Tracker & Wiki blackhole at torproject.org
Fri May 25 23:03:36 UTC 2018


#26207: Stem 1.6.0 incompatible with PyPy 5.6.0
-------------------------------+--------------------
     Reporter:  mikeperry      |      Owner:  atagar
         Type:  defect         |     Status:  new
     Priority:  Medium         |  Milestone:
    Component:  Core Tor/Stem  |    Version:
     Severity:  Normal         |   Keywords:
Actual Points:                 |  Parent ID:
       Points:                 |   Reviewer:
      Sponsor:                 |
-------------------------------+--------------------
 Steps to reproduce:

 sudo apt-get install pypy
 virtualenv -p pypy stemtest
 source stemtest/bin/activate
 pip install stem==1.6.0
 pypy -c "import stem.util.system"

 This yields:
 {{{
 Traceback (most recent call last):
   File "<module>", line 1, in <module>
   File "/home/user/Source/vanguards.git/stemtest/site-
 packages/stem/util/system.py", line 97, in <module>
     DEFAULT_SIZE = sys.getsizeof(0)  # estimate if object lacks a
 __sizeof__
 TypeError: sys.getsizeof() is not implemented on PyPy.
 }}}

 There is then a whole blob of explanatory text after that error from PyPy:

 {{{
 A memory profiler using this function is most likely to give results
 inconsistent with reality on PyPy.  It would be possible to have
 sys.getsizeof() return a number (with enough work), but that may or
 may not represent how much memory the object uses.  It doesn't even
 make really sense to ask how much *one* object uses, in isolation
 with the rest of the system.  For example, instances have maps,
 which are often shared across many instances; in this case the maps
 would probably be ignored by an implementation of sys.getsizeof(),
 but their overhead is important in some cases if they are many
 instances with unique maps.  Conversely, equal strings may share
 their internal string data even if they are different objects---or
 empty containers may share parts of their internals as long as they
 are empty.  Even stranger, some lists create objects as you read
 them; if you try to estimate the size in memory of range(10**6) as
 the sum of all items' size, that operation will by itself create one
 million integer objects that never existed in the first place.
 }}}

 Stem 1.5.4 does not have this issue.

--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/26207>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online


More information about the tor-bugs mailing list