From issues-reply at bitbucket.org Wed Apr 1 13:44:07 2015 From: issues-reply at bitbucket.org (David MacIver) Date: Wed, 01 Apr 2015 11:44:07 -0000 Subject: [pypy-issue] Issue #2015: Mysterious integer overflow bug when performing lots of float operations (pypy/pypy) Message-ID: <20150401114407.22913.51837@app07.ash-private.bitbucket.org> New issue 2015: Mysterious integer overflow bug when performing lots of float operations https://bitbucket.org/pypy/pypy/issue/2015/mysterious-integer-overflow-bug-when David MacIver: I unfortunately don't have a reproducible case for this bug. I have seen it precisely once and not been able to get it to happen again, let alone produce a minimal example. On pypy3-2.4.0 I've seen the following crash: ``` RPython traceback: File "pypy_module_pypyjit_interp_jit.c", line 105, in jump_absolute__AccessDirect_None File "rpython_jit_metainterp_warmstate.c", line 6552, in maybe_compile_and_run__star_5_1 File "rpython_jit_metainterp_warmstate.c", line 14027, in execute_assembler__star_2_2 File "rpython_rlib_rbigint.c", line 43665, in fromfloat_1 ~~~ Crash in JIT! ``` This happened when running the following command: ``` #!bash PYTHONPATH=src python -m pytest tests/test_example_quality.py --capture=no -klist_of_floats_on ``` against git at github.com:DRMacIver/hypothesis.git checked out to the branch repro_for_pypy_1 This command should result in something that looks like the following: ``` ============================================ test session starts ============================================= platform linux2 -- Python 3.2.5[pypy-2.4.0-final] -- py-1.4.26 -- pytest-2.7.0 -- /home/david/.pyenv/versions/pypy3-2.4.0/bin/python rootdir: /home/david/projects/hypothesis, inifile: pytest.ini collected 28 items tests/test_example_quality.py::test_minimize_list_of_floats_on_large_structure Falsifying example: everything_is_terrible(x=[0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 3.0, 3.0, 3.0, 3.0, 3.0, 3.0, 3.0, 3.0, 3.0, 3.0, 3.0, 3.0, 3.0, 3.0, 3.0, 3.0, 3.0, 3.0, 3.0, 3.0, 3.0, 3.0, 3.0, 3.0, 3.0, 3.0, 3.0, 3.0, 3.0, 3.0]) PASSED ``` It is highly likely that this is a case where an OverflowError really should be occuring - there are quite a few of them that will be hit when running this, with the code handling it appropriately. I've tried a bunch of things I thought might trigger this and nothing seems to have, so it's either quite subtle or I'm missing something. This is why you're getting this slightly useless bug report, sorry. From issues-reply at bitbucket.org Thu Apr 2 08:46:14 2015 From: issues-reply at bitbucket.org (Marius Gedminas) Date: Thu, 02 Apr 2015 06:46:14 -0000 Subject: [pypy-issue] Issue #2016: PyPy3: curses.tigetnum() raises ctype TypeError (pypy/pypy) Message-ID: <20150402064614.28140.76152@app11.ash-private.bitbucket.org> New issue 2016: PyPy3: curses.tigetnum() raises ctype TypeError https://bitbucket.org/pypy/pypy/issue/2016/pypy3-cursestigetnum-raises-ctype Marius Gedminas: Very similar to https://bitbucket.org/pypy/pypy/issue/1997/pypy3-cursestigetstr-raises-ctype, but it looks like every function needs to be fixed separately. Example of the failure: https://travis-ci.org/mgedmin/irclog2html/jobs/56838716 From issues-reply at bitbucket.org Sat Apr 4 02:08:49 2015 From: issues-reply at bitbucket.org (nxsofsys) Date: Sat, 04 Apr 2015 00:08:49 -0000 Subject: [pypy-issue] Issue #2017: greenlet.switch() raises MemoryError (pypy/pypy) Message-ID: <20150404000849.24682.14440@app12.ash-private.bitbucket.org> New issue 2017: greenlet.switch() raises MemoryError https://bitbucket.org/pypy/pypy/issue/2017/greenletswitch-raises-memoryerror nxsofsys: Follwing script runned on [PyPy 2.5.1 with MSC v.1500 32 bit] (WIndows 7 x64) ``` #!python import greenlet from time import time N = 1000 * 1000 count = 0 def func(): global count count += 1 main.switch() main = greenlet.getcurrent() try: start = time() for i in xrange(N): greenlet.greenlet(func).switch() except: raise finally: print '%s switches took %.3fs' % (count, time() - start) ``` prints following output: ``` 2793 switches took 0.217s Traceback (most recent call last): File "/app_main.py", line 75, in run_toplevel File "bench.py", line 15, in greenlet.greenlet(func).switch() File "C:\Env\pypy\lib_pypy\greenlet.py", line 53, in switch return self.__switch('switch', (args, kwds)) File "C:\Env\pypy\lib_pypy\greenlet.py", line 69, in __switch _continulet.__init__(target, greenlet_func, *baseargs) MemoryError ``` but on CPython with greenlet runs without errors. From issues-reply at bitbucket.org Wed Apr 8 18:34:18 2015 From: issues-reply at bitbucket.org (Ronan Lamy) Date: Wed, 08 Apr 2015 16:34:18 -0000 Subject: [pypy-issue] Issue #2018: Rtyper failure when using prebuilt dict with function values (pypy/pypy) Message-ID: <20150408163418.26990.89800@app08.ash-private.bitbucket.org> New issue 2018: Rtyper failure when using prebuilt dict with function values https://bitbucket.org/pypy/pypy/issue/2018/rtyper-failure-when-using-prebuilt-dict Ronan Lamy: This: ```python def stub(test): pass table = {'stub': stub} def entry_point(argv): if len(argv) > 1 and argv[1] in table: print 'hello' return 0 def target(*args): return entry_point, None ``` crashes with: ``` ... [translation:info] File "rpython/rtyper/lltypesystem/rordereddict.py", line 386, in rtype_contains [translation:info] v_dict, v_key = hop.inputargs(r_dict, r_dict.key_repr) [translation:info] File "rpython/rtyper/rtyper.py", line 678, in inputargs [translation:info] vars.append(self.inputarg(converted_to[i], i)) [translation:info] File "rpython/rtyper/rtyper.py", line 659, in inputarg [translation:info] return inputconst(converted_to, v.value) [translation:info] File "rpython/rtyper/rmodel.py", line 346, in inputconst [translation:info] value = reqtype.convert_const(value) [translation:info] File "rpython/rtyper/lltypesystem/rordereddict.py", line 263, in convert_const [translation:info] l_dict.keyhash(llkey)) [translation:info] File "rpython/rtyper/lltypesystem/rordereddict.py", line 606, in _ll_dict_insertclean [translation:info] entry.value = value [translation:info] File "rpython/rtyper/lltypesystem/lltype.py", line 1270, in __setattr__ [translation:info] T2 = typeOf(val) [translation:info] File "rpython/rtyper/lltypesystem/lltype.py", line 836, in typeOf [translation:info] raise TypeError("typeOf(%r object)" % (tp.__name__,)) [translation:ERROR] TypeError: typeOf('function' object) ``` From issues-reply at bitbucket.org Fri Apr 10 02:25:39 2015 From: issues-reply at bitbucket.org (Jeong YunWon) Date: Fri, 10 Apr 2015 00:25:39 -0000 Subject: [pypy-issue] Issue #2019: rpython Cannot find attribute 'isspace' on SomeUnicodeCodePoint() (pypy/pypy) Message-ID: <20150410002539.29465.21638@app14.ash-private.bitbucket.org> New issue 2019: rpython Cannot find attribute 'isspace' on SomeUnicodeCodePoint() https://bitbucket.org/pypy/pypy/issue/2019/rpython-cannot-find-attribute-isspace-on Jeong YunWon: ``` [translation:info] Error: [translation:info] File "/Volumes/Userspace/Projects/pypy/rpython/translator/goal/translate.py", line 318, in main [translation:info] drv.proceed(goals) [translation:info] File "/Volumes/Userspace/Projects/pypy/rpython/translator/driver.py", line 539, in proceed [translation:info] return self._execute(goals, task_skip = self._maybe_skip()) [translation:info] File "/Volumes/Userspace/Projects/pypy/rpython/translator/tool/taskengine.py", line 114, in _execute [translation:info] res = self._do(goal, taskcallable, *args, **kwds) [translation:info] File "/Volumes/Userspace/Projects/pypy/rpython/translator/driver.py", line 276, in _do [translation:info] res = func() [translation:info] File "/Volumes/Userspace/Projects/pypy/rpython/translator/driver.py", line 343, in task_rtype_lltype [translation:info] rtyper.specialize(dont_simplify_again=True) [translation:info] File "/Volumes/Userspace/Projects/pypy/rpython/rtyper/rtyper.py", line 176, in specialize [translation:info] self.specialize_more_blocks() [translation:info] File "/Volumes/Userspace/Projects/pypy/rpython/rtyper/rtyper.py", line 216, in specialize_more_blocks [translation:info] self.specialize_block(block) [translation:info] File "/Volumes/Userspace/Projects/pypy/rpython/rtyper/rtyper.py", line 304, in specialize_block [translation:info] self.translate_hl_to_ll(hop, varmapping) [translation:info] File "/Volumes/Userspace/Projects/pypy/rpython/rtyper/rtyper.py", line 430, in translate_hl_to_ll [translation:info] resultvar = hop.dispatch() [translation:info] File "/Volumes/Userspace/Projects/pypy/rpython/rtyper/rtyper.py", line 647, in dispatch [translation:info] return translate_meth(self) [translation:info] File "<160-codegen /Volumes/Userspace/Projects/pypy/rpython/rtyper/rtyper.py:496>", line 4, in translate_op_simple_call [translation:info] return r_arg1.rtype_simple_call(hop) [translation:info] File "/Volumes/Userspace/Projects/pypy/rpython/rtyper/rbuiltin.py", line 140, in rtype_simple_call [translation:info] return bltintyper(hop2) [translation:info] File "/Volumes/Userspace/Projects/pypy/rpython/rtyper/rstr.py", line 168, in rtype_method_strip [translation:info] return hop.gendirectcall(func, *args_v) [translation:info] File "/Volumes/Userspace/Projects/pypy/rpython/rtyper/rtyper.py", line 685, in gendirectcall [translation:info] return self.llops.gendirectcall(ll_function, *args_v) [translation:info] File "/Volumes/Userspace/Projects/pypy/rpython/rtyper/rtyper.py", line 867, in gendirectcall [translation:info] rtyper.lowlevel_ann_policy) [translation:info] File "/Volumes/Userspace/Projects/pypy/rpython/rtyper/annlowlevel.py", line 95, in annotate_lowlevel_helper [translation:info] return annotator.annotate_helper(ll_function, args_s, policy) [translation:info] File "/Volumes/Userspace/Projects/pypy/rpython/annotator/annrpython.py", line 111, in annotate_helper [translation:info] self.complete_helpers(policy) [translation:info] File "/Volumes/Userspace/Projects/pypy/rpython/annotator/annrpython.py", line 119, in complete_helpers [translation:info] self.complete() [translation:info] File "/Volumes/Userspace/Projects/pypy/rpython/annotator/annrpython.py", line 189, in complete [translation:info] self.complete_pending_blocks() [translation:info] File "/Volumes/Userspace/Projects/pypy/rpython/annotator/annrpython.py", line 184, in complete_pending_blocks [translation:info] self.processblock(graph, block) [translation:info] File "/Volumes/Userspace/Projects/pypy/rpython/annotator/annrpython.py", line 336, in processblock [translation:info] self.flowin(graph, block) [translation:info] File "/Volumes/Userspace/Projects/pypy/rpython/annotator/annrpython.py", line 408, in flowin [translation:info] self.consider_op(op) [translation:info] File "/Volumes/Userspace/Projects/pypy/rpython/annotator/annrpython.py", line 582, in consider_op [translation:info] resultcell = op.consider(self) [translation:info] File "/Volumes/Userspace/Projects/pypy/rpython/flowspace/operation.py", line 104, in consider [translation:info] return spec(annotator, *self.args) [translation:info] File "/Volumes/Userspace/Projects/pypy/rpython/flowspace/operation.py", line 204, in specialized [translation:info] return impl(*[annotator.annotation(x) for x in other_args]) [translation:info] File "/Volumes/Userspace/Projects/pypy/rpython/annotator/unaryop.py", line 160, in getattr [translation:info] raise AnnotatorError("Cannot find attribute %r on %r" % (attr, self)) [translation:ERROR] AnnotatorError: [translation:ERROR] [translation:ERROR] Cannot find attribute 'isspace' on SomeUnicodeCodePoint() [translation:ERROR] [translation:ERROR] [translation:ERROR] v234 = getattr(v233, ('isspace')) [translation:ERROR] [translation:ERROR] In : [translation:ERROR] Happened at file /Volumes/Userspace/Projects/pypy/rpython/rtyper/lltypesystem/rstr.py line 435 [translation:ERROR] [translation:ERROR] ==> while lpos < rpos and s.chars[lpos].isspace(): [translation:ERROR] [translation:ERROR] Known variable annotations: [translation:ERROR] v233 = SomeUnicodeCodePoint() [translation:ERROR] [translation:ERROR] Processing block: [translation:ERROR] block at 77 is a [translation:ERROR] in (rpython.rtyper.lltypesystem.rstr:426)ll_strip_default__rpy_unicodePtr_Bool_Bool [translation:ERROR] containing the following operations: [translation:ERROR] v235 = getattr(s_0, ('chars')) [translation:ERROR] v233 = getitem(v235, lpos_0) [translation:ERROR] v234 = getattr(v233, ('isspace')) [translation:ERROR] v236 = simple_call(v234) [translation:ERROR] v237 = bool(v236) [translation:ERROR] --end-- ``` From issues-reply at bitbucket.org Fri Apr 10 11:03:23 2015 From: issues-reply at bitbucket.org (MechanTOurS) Date: Fri, 10 Apr 2015 09:03:23 -0000 Subject: [pypy-issue] Issue #2020: Cpyext PyFile_AsFile segmentation fault with M2Crypto (pypy/pypy) Message-ID: <20150410090323.28902.12803@app03.ash-private.bitbucket.org> New issue 2020: Cpyext PyFile_AsFile segmentation fault with M2Crypto https://bitbucket.org/pypy/pypy/issue/2020/cpyext-pyfile_asfile-segmentation-fault MechanTOurS: Should PyFile_AsFile be working? see: https://gist.github.com/benjaminrigaud/99f46411cf6ab7dee07e - M2Crypto==0.22.3 - Ubuntu 14.04 - Pypy:2.5.1 - Swig: 2.0.11 Thank you. From issues-reply at bitbucket.org Fri Apr 10 15:17:59 2015 From: issues-reply at bitbucket.org (sbehnel) Date: Fri, 10 Apr 2015 13:17:59 -0000 Subject: [pypy-issue] Issue #2021: pypy3: PyType_Ready() crashes for extension types that inherit from PyUnicode_Type (pypy/pypy) Message-ID: <20150410131759.8091.85653@app10.ash-private.bitbucket.org> New issue 2021: pypy3: PyType_Ready() crashes for extension types that inherit from PyUnicode_Type https://bitbucket.org/pypy/pypy/issue/2021/pypy3-pytype_ready-crashes-for-extension sbehnel: lxml contains this code: __pyx_type_4lxml_5etree__ElementUnicodeResult.tp_base = (&PyUnicode_Type); if (PyType_Ready(&__pyx_type_4lxml_5etree__ElementUnicodeResult) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 724; __pyx_clineno = __LINE__; goto __pyx_L1_error;} PyPy3 crashes in the call to (Py)PyType_Ready(). It seems that the release builds do not contain debug symbols, so I can't provide more information. From issues-reply at bitbucket.org Fri Apr 10 15:43:21 2015 From: issues-reply at bitbucket.org (sbehnel) Date: Fri, 10 Apr 2015 13:43:21 -0000 Subject: [pypy-issue] Issue #2022: cpyext: PyBytes_FromFormat() is missing in pypy3 (pypy/pypy) Message-ID: <20150410134321.25364.30721@app10.ash-private.bitbucket.org> New issue 2022: cpyext: PyBytes_FromFormat() is missing in pypy3 https://bitbucket.org/pypy/pypy/issue/2022/cpyext-pybytes_fromformat-is-missing-in sbehnel: `PyBytes_FromFormat()` apparently got removed in pypy3, it used to be there in pypy2. From issues-reply at bitbucket.org Sat Apr 11 08:54:20 2015 From: issues-reply at bitbucket.org (sbehnel) Date: Sat, 11 Apr 2015 06:54:20 -0000 Subject: [pypy-issue] Issue #2023: cpyext: PyDict_Keys/Values/Items() does not call type method but instance method (pypy/pypy) Message-ID: <20150411065420.5429.10117@app05.ash-private.bitbucket.org> New issue 2023: cpyext: PyDict_Keys/Values/Items() does not call type method but instance method https://bitbucket.org/pypy/pypy/issue/2023/cpyext-pydict_keys-values-items-does-not sbehnel: This is a somewhat special test case in Cython. Here is the code: ``` #!cython class DictPySubtype(dict): def keys(self): """ >>> d = DictPySubtype(one=42, two=17, three=0) >>> for v in sorted(d.keys()): ... print(v) three two """ for key in dict.keys(self): if key != 'one': yield key ``` When executed in PyPy 2.5.1, I get an infinite recursion crash with C stack traces like this: ``` #1111 0x00007ffff5887c02 in PyPyIter_Next () from /home/stefan/ablage/software/Python/pypy-2.5.1-linux64/bin/libpypy-c.so #1112 0x00007ffff000f211 in __pyx_gb_27builtin_subtype_methods_cy3_13DictPySubtype_8generator2 (__pyx_generator=0x16653e0, __pyx_sent_value=0x7ffff6b6a0b0 <_PyPy_NoneStruct>) at builtin_subtype_methods_cy3.c:1471 #1113 0x00007ffff0015ec0 in __Pyx_Generator_SendEx (self=0x16653e0, value=0x7ffff6b6a0b0 <_PyPy_NoneStruct>) at builtin_subtype_methods_cy3.c:4768 #1114 0x00007ffff0016078 in __Pyx_Generator_Next (self=0x16653e0) at builtin_subtype_methods_cy3.c:4811 ``` This is because Cython translates "dict.keys(self)" into the CPython 2.x equivalent "PyDict_Keys(self)". However, cpyext does not implement this C-API function as "dict.keys(self)" but as "self.keys()", which then calls the overridden method again and ends up in infinite recursion. This might apply to other cpyext functions as well that delegate to methods of builtin types. From issues-reply at bitbucket.org Sat Apr 11 17:07:14 2015 From: issues-reply at bitbucket.org (sbehnel) Date: Sat, 11 Apr 2015 15:07:14 -0000 Subject: [pypy-issue] Issue #2024: cpyext: support PyByteArray_*() C-API (pypy/pypy) Message-ID: <20150411150714.21158.97855@app04.ash-private.bitbucket.org> New issue 2024: cpyext: support PyByteArray_*() C-API https://bitbucket.org/pypy/pypy/issue/2024/cpyext-support-pybytearray_-c-api sbehnel: Issue #1692 suggests that direct access to the buffer of a bytearray object might not be easy to achieve, but that's not a reason to leave the rest of the `PyByteArray` C-API unsupported as well. https://docs.python.org/3/c-api/bytearray.html From issues-reply at bitbucket.org Sat Apr 11 17:18:32 2015 From: issues-reply at bitbucket.org (sbehnel) Date: Sat, 11 Apr 2015 15:18:32 -0000 Subject: [pypy-issue] Issue #2025: cpyext: finish implementation of PyGILState_Ensure and PyGILState_Release (pypy/pypy) Message-ID: <20150411151832.4257.96147@app08.ash-private.bitbucket.org> New issue 2025: cpyext: finish implementation of PyGILState_Ensure and PyGILState_Release https://bitbucket.org/pypy/pypy/issue/2025/cpyext-finish-implementation-of sbehnel: `PyGILState_Ensure()` currently deadlocks when called with the GIL held. CPython explicitly allows this. From issues-reply at bitbucket.org Sun Apr 12 05:28:19 2015 From: issues-reply at bitbucket.org (ceridwenv) Date: Sun, 12 Apr 2015 03:28:19 -0000 Subject: [pypy-issue] Issue #2026: itertools.accumulate seems to expect the wrong number of arguments (pypy/pypy) Message-ID: <20150412032819.5582.223@app13.ash-private.bitbucket.org> New issue 2026: itertools.accumulate seems to expect the wrong number of arguments https://bitbucket.org/pypy/pypy/issue/2026/itertoolsaccumulate-seems-to-expect-the ceridwenv: In the interpreter: ``` #!python >>>> from itertools import accumulate >>>> import operator >>>> data = [3, 4, 6, 2, 1, 9, 0, 7, 5, 8] >>>> list(accumulate(data, operator.mul)) Traceback (most recent call last): File "", line 1, in TypeError: __new__() takes exactly 2 arguments (3 given) >>>> list(accumulate(data, max)) Traceback (most recent call last): File "", line 1, in TypeError: __new__() takes exactly 2 arguments (3 given) ``` These examples are taken from the documentation for itertools. From issues-reply at bitbucket.org Mon Apr 13 21:52:06 2015 From: issues-reply at bitbucket.org (Buck Evan) Date: Mon, 13 Apr 2015 19:52:06 -0000 Subject: [pypy-issue] Issue #2027: docs: broken pyinteractive example (pypy/pypy) Message-ID: <20150413195206.16515.54288@app13.ash-private.bitbucket.org> New issue 2027: docs: broken pyinteractive example https://bitbucket.org/pypy/pypy/issue/2027/docs-broken-pyinteractive-example Buck Evan: Without `--withmod-time`, the example in the docs crashes: http://pypy.readthedocs.org/en/latest/getting-started-dev.html#pyinteractive-py-options ``` $ python bin/pyinteractive.py --withmod-time -c "from test import pystone; pystone.main(10)" ... Pystone(1.1) time for 10 passes = 0.220043 This machine benchmarks at 45.4457 pystones/second ``` From issues-reply at bitbucket.org Mon Apr 13 22:36:14 2015 From: issues-reply at bitbucket.org (geov) Date: Mon, 13 Apr 2015 20:36:14 -0000 Subject: [pypy-issue] Issue #2028: UnrecognizedOperation: movbe (pypy/pypy) Message-ID: <20150413203614.13800.68866@app11.ash-private.bitbucket.org> New issue 2028: UnrecognizedOperation: movbe https://bitbucket.org/pypy/pypy/issue/2028/unrecognizedoperation-movbe geov: Gentoo build log attached. CFLAGS was ``` #!bash CFLAGS="-march=core-avx2 -mtune=native -O2 -pipe" ``` From issues-reply at bitbucket.org Tue Apr 14 01:54:41 2015 From: issues-reply at bitbucket.org (gjvc) Date: Mon, 13 Apr 2015 23:54:41 -0000 Subject: [pypy-issue] Issue #2029: lambdas not is not JSON serializable (pypy/pypy) Message-ID: <20150413235441.30767.96439@app02.ash-private.bitbucket.org> New issue 2029: lambdas not is not JSON serializable https://bitbucket.org/pypy/pypy/issue/2029/lambdas-not-is-not-json-serializable gjvc: This code runs fine in CPython 2.7, but not in pypy ``` #!python #! /usr/bin/env python import collections import json class objdict( collections.defaultdict ): def __getattr__( self, key ): try: return self.__dict__[ key ] except KeyError: return self.__getitem__( key ) __setattr__ = lambda self, key, value: self.__setitem__( key, value ) def objtree(): return objdict(objtree) obj = objtree() print json.dumps( obj, indent=4 ) obj.x.y.z = 4 print json.dumps( obj, indent=4 ) obj.x.y = 3 print json.dumps( obj, indent=4 ) obj.x = 2 print json.dumps( obj, indent=4 ) del obj[ 'x' ] print json.dumps( obj, indent=4 ) ``` From issues-reply at bitbucket.org Tue Apr 14 20:18:20 2015 From: issues-reply at bitbucket.org (Jason Madden) Date: Tue, 14 Apr 2015 18:18:20 -0000 Subject: [pypy-issue] Issue #2030: Circular weakref callbacks never called (self._x = weakref.ref(self, callback)) (pypy/pypy) Message-ID: <20150414181820.12532.82032@app07.ash-private.bitbucket.org> New issue 2030: Circular weakref callbacks never called (self._x = weakref.ref(self, callback)) https://bitbucket.org/pypy/pypy/issue/2030/circular-weakref-callbacks-never-called Jason Madden: It appears that if an object holds a weak reference to itself, the callback for that reference is never called. It's as if when both the object and the reference to it become garbage at the same time, the callback isn't called. I ran into this testing ZODB under PyPy (it used this pattern in ZODB.blob.Blob). Here's an example of what happens under CPython: ``` $ /opt/local/bin/python2.7 Python 2.7.9 (default, Dec 13 2014, 15:13:49) [GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.56)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import weakref, sys >>> class X(object): ... pass ... >>> x = X() >>> x._ref = weakref.ref(x, lambda r: sys.stderr.write('callback\n')) >>> del x callback >>> ``` Now, under PyPy (both 2.5.1 and a relatively recent nightly), the callback doesn't get called when the reference is deleted (but we expect that): ``` $ pypy Python 2.7.9 (9c4588d731b7, Mar 23 2015, 16:20:40) [PyPy 2.5.1 with GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.57)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>>> import weakref, sys >>>> class X(object): .... pass .... >>>> x = X() >>>> x._ref = weakref.ref(x, lambda r: sys.stderr.write('callback\n')) >>>> del x >>>> ``` No problem, we need to ask GC to do a collection. We've seen this before. ``` >>>> import gc >>>> gc.collect() 0 ``` Hmm, maybe a few collections? ``` >>>> for _ in range(100): _ = gc.collect() >>>> ``` Nothing. If we use a separate reference object with a different lifetime, then it is called immediately after the first GC: ``` >>>> x = X() >>>> ref = weakref.ref(x, lambda r: sys.stderr.write('direct callback\n')) >>>> del x >>>> gc.collect() direct callback 0 >>>> ``` From issues-reply at bitbucket.org Thu Apr 16 17:39:01 2015 From: issues-reply at bitbucket.org (timfel) Date: Thu, 16 Apr 2015 15:39:01 -0000 Subject: [pypy-issue] =?utf-8?q?Issue_=232031=3A_Building_RSqueak_=28n?= =?utf-8?q?=C3=A9e_lang-smalltalk/spyvm=29_JIT_segfaults_in_GC_on_Windows_?= =?utf-8?q?=28pypy/pypy=29?= Message-ID: <20150416153901.9775.24521@app03.ash-private.bitbucket.org> New issue 2031: Building RSqueak (n?e lang-smalltalk/spyvm) JIT segfaults in GC on Windows https://bitbucket.org/pypy/pypy/issue/2031/building-rsqueak-n-e-lang-smalltalk-spyvm timfel: The RSqueak VM builds and runs fine with JIT on OSX and Linux, but crashes at startup on Windows. Windows build without JIT runs fine. The crashes are always somewhere in GC code, so I tried boehm, minimark, incminimark to no avail. The different GCs don't crash in the same spot, e.g. boehm triggers a breakpoint somewhere below BOEHM_MALLOC_0_0 when resizing a dictionary, but incminimark crashes in call_footer_shadowstack after a compile and run once. Below are instructions on how to build RSqueak on Windows to reproduce the problem. ## For building git clone https://github.com/HPI-SWA-Lab/RSqueak Build RSqueak. This can be done, for example, by copying everything in .appveyor/ into the root folder of the repository, editing rsqueak-build.bat to include -Ojit, and then running it from a Visual Studio prompt. Alternatively, build targetrsqueak.py with JIT some other way. ## Binary download http://lively-kernel.org/babelsberg/RSqueak/rsqueak-win32-jit.exe ## To reproduce You need SDL.dll in your PATH or next to the binary (get here: http://www.libsdl.org/release/SDL-1.2.15-win32.zip). Then execute (from the cmdline from within the repo): rsqueak.exe images/Squeak-4.6-vmmaker.bench.image From issues-reply at bitbucket.org Fri Apr 17 17:57:31 2015 From: issues-reply at bitbucket.org (Edd Barrett) Date: Fri, 17 Apr 2015 15:57:31 -0000 Subject: [pypy-issue] Issue #2032: ListChangeUnallowed: Rpython error message could be improved (pypy/pypy) Message-ID: <20150417155731.11694.16770@app06.ash-private.bitbucket.org> New issue 2032: ListChangeUnallowed: Rpython error message could be improved https://bitbucket.org/pypy/pypy/issue/2032/listchangeunallowed-rpython-error-message Edd Barrett: Users are unlikely to understand this error message: ``` [translation:ERROR] ListChangeUnallowed: [translation:ERROR] [translation:ERROR] list merge with a resized [translation:ERROR] [translation:ERROR] [translation:ERROR] Occurred processing the following simple_call: ... ``` Found when developing pypy/hippy bridge. Cheers From issues-reply at bitbucket.org Mon Apr 20 00:06:33 2015 From: issues-reply at bitbucket.org (George Sakkis) Date: Sun, 19 Apr 2015 22:06:33 -0000 Subject: [pypy-issue] Issue #2033: "AttributeError: object attribute is read-only" for descriptor that implements __delete__ (pypy/pypy) Message-ID: <20150419220633.2558.27755@app14.ash-private.bitbucket.org> New issue 2033: "AttributeError: object attribute is read-only" for descriptor that implements __delete__ https://bitbucket.org/pypy/pypy/issue/2033/attributeerror-object-attribute-is-read George Sakkis: Looks like pypy considers a descriptor that defines `__get__` and `__delete__` as read-only, [unlike cPython](https://travis-ci.org/pydanny/cached-property/builds/59162169). Relevant descriptor can be seen [here](https://github.com/gsakkis/cached-property/blob/6dfcdece430112596b7528a311d316b9723abac0/cached_property.py#L52). From issues-reply at bitbucket.org Fri Apr 24 07:41:57 2015 From: issues-reply at bitbucket.org (Pedro Rodriguez) Date: Fri, 24 Apr 2015 05:41:57 -0000 Subject: [pypy-issue] Issue #2034: PyPy Regression with Python on Iterable expansions (pypy/pypy) Message-ID: <20150424054157.18963.90454@app11.ash-private.bitbucket.org> New issue 2034: PyPy Regression with Python on Iterable expansions https://bitbucket.org/pypy/pypy/issue/2034/pypy-regression-with-python-on-iterable Pedro Rodriguez: I am the main developer on github.com/EntilZha/ScalaFunctional and in working on it I found a regression with Python. I don't know if it is an intended regression, but it caused some unexpected behavior which I was able to narrow down. If you want the full explanation, it is on the issue on the project here: https://github.com/EntilZha/ScalaFunctional/issues/25 Below is a minimal code example showing the regression between pypy and python. The primary problem is how `pypy` is doing expansions of iterables (`list()`, `set()`, `dict()`, ...). When those are expanded `pypy` will call `__iter__`, then `__len__`. Python will only call `__iter__`. ``` #!python from collections import Iterable class A(object): def __init__(self, seq): self.l = seq def __getitem__(self, item): print "DEBUG:getitem called" return self.l[item] def __iter__(self): print "DEBUG:iter called" return iter(self.l) def __len__(self): print "DEBUG:len called" if isinstance(self.l, Iterable): self.l = list(self.l) return len(self.l) class B(object): def __init__(self, seq): self.l = seq def __iter__(self): print "DEBUG:iter called" return iter(self.l) # set interchangable with list/dict print "Calling set(A([1, 2]))" a = A([1, 2]) print set(a) print "Calling set(B([1, 2]))" b = B([1, 2]) print set(b) print "Calling union" s = set([1, 2, 3]).union([4, 5]) c = A(iter(s)) print set(c) ``` ``` #!python $ python iterable.py Calling set(A([1, 2])) DEBUG:iter called set([1, 2]) Calling set(B([1, 2])) DEBUG:iter called set([1, 2]) Calling union DEBUG:iter called set([1, 2, 3, 4, 5]) $ pypy iterable.py Calling set(A([1, 2])) DEBUG:len called DEBUG:iter called [1, 2] Calling set(B([1, 2])) DEBUG:iter called set([1, 2]) Calling union DEBUG:iter called DEBUG:len called set([]) ``` In my code, the solution would be fairly easy to do type checking and not rewrap the iterator within another iterator. Regardless, since I am unfamiliar with `pypy` I don't know if the regression is intended or unintended. From issues-reply at bitbucket.org Mon Apr 27 20:58:31 2015 From: issues-reply at bitbucket.org (Tobias Pape) Date: Mon, 27 Apr 2015 18:58:31 -0000 Subject: [pypy-issue] Issue #2035: Loop header in PYPYLOG may miss get_printable_location result in some cases (pypy/pypy) Message-ID: <20150427185831.24021.91300@app07.ash-private.bitbucket.org> New issue 2035: Loop header in PYPYLOG may miss get_printable_location result in some cases https://bitbucket.org/pypy/pypy/issue/2035/loop-header-in-pypylog-may-miss Tobias Pape: In [RSqueak](https://github.com/HPI-SWA-Lab/RSqueak), sometimes traces have the right `get_printable_location` result in a `debug_merge_point` but not in the Loop label: (see [Gist](https://gist.github.com/krono/18131648ba6dd7d7184c)) ``` ? # Loop 0 ((jitdriver: get_printable_location disabled, no debug_print)) : entry bridge with 65 ops ? debug_merge_point(0, 0, '(ByteString class >> #stringHash:initialHash:) [9]: <0x15>pushTemporaryVariableBytecode(5)') ? debug_merge_point(0, 0, '(ByteString class >> #stringHash:initialHash:) [12]: <0xac>longJumpIfFalseBytecode(0)') debug_merge_point(0, 0, '(ByteString class >> #stringHash:initialHash:) [51]: <0x13>pushTemporaryVariableBytecode(3)') debug_merge_point(0, 0, '(ByteString class >> #stringHash:initialHash:) [52]: <0x7c>returnTopFromMethodBytecode') ? ```