From issues-reply at bitbucket.org Fri Jul 1 09:53:03 2016 From: issues-reply at bitbucket.org (Mark Williams) Date: Fri, 01 Jul 2016 13:53:03 -0000 Subject: [pypy-issue] Issue #2335: Maximum recursion depth exceeded with coverage (pypy/pypy) Message-ID: <20160701135303.6002.87268@celery-worker-101.ash1.bb-inf.net> New issue 2335: Maximum recursion depth exceeded with coverage https://bitbucket.org/pypy/pypy/issues/2335/maximum-recursion-depth-exceeded-with Mark Williams: Running Twisted's test suite with `coverage` (version 4.1) results in several `RuntimeError`s because the recursion depth's been exceeded. See: https://travis-ci.org/twisted/twisted/jobs/140817070 I've been able to reliably reproduce the last `RuntimeError` (when `coverage` is trying to write out its data) locally on a PyPy built with `lldebug0`. Attached should be a traceback from `stack.c:57`. Having read #2200 I figured this would be helpful - please let me know if there's anything else you'd like. I have similar tracebacks for similar `RuntimeError`s, but not the exact same ones as in the failed Travis CI build. Please let me know if you'd like those as well. Thanks for PyPy! From issues-reply at bitbucket.org Fri Jul 1 11:09:18 2016 From: issues-reply at bitbucket.org (Steven Marks) Date: Fri, 01 Jul 2016 15:09:18 -0000 Subject: [pypy-issue] Issue #2336: memory leak (pypy/pypy) Message-ID: <20160701150918.26805.90983@celery-worker-103.ash1.bb-inf.net> New issue 2336: memory leak https://bitbucket.org/pypy/pypy/issues/2336/memory-leak Steven Marks: I have the following code running in pypy 5.3.1: ``` #!python import random data=[str(random.randint(0,100)) for x in range(1,10000000)] raw_input("Hit enter") ``` This code uses ~540MB of memory. If you remove either the str or random.randint function call from the code and leave the other function the memory usage is only ~150MB From issues-reply at bitbucket.org Fri Jul 1 13:01:51 2016 From: issues-reply at bitbucket.org (Yashwardhan Singh) Date: Fri, 01 Jul 2016 17:01:51 -0000 Subject: [pypy-issue] Issue #2337: segfault in libpypy-c.so (pypy/pypy) Message-ID: <20160701170151.28886.14881@celery-worker-104.ash1.bb-inf.net> New issue 2337: segfault in libpypy-c.so https://bitbucket.org/pypy/pypy/issues/2337/segfault-in-libpypy-cso Yashwardhan Singh: Hi I am running Cloud Storage solution from Openstack suite, swift-proxy using pypy. On running benchmark I am getting following error : kernel: [1361148.216800] traps: swift-proxy-ser[42088] general protection ip:7f09d2863360 sp:7fff21002ce0 error:0 in libpyp y-c.so[7f09d06de000+2a8f000] [1361152.123606] swift-proxy-ser[42099]: segfault at 20 ip 00007f09d2863360 sp 00007fff21002c50 error 4 in libpypy- c.so[7f09d06de000+2a8f000] This issue can be reproduced on PyPy2.7-5.3.1, PyPy-5.1.1,PyPy-4.0.1 but not on PyPy-2.6.1. I looked into /var/log/crash, but couldn't locate the core dump. Please help in identifying and resolving the issue if it is related to pypy. Please let me know what other information might be helpful for you to debug. Regards Yash From issues-reply at bitbucket.org Sun Jul 3 07:19:38 2016 From: issues-reply at bitbucket.org (CTPaHHuK-HEbA) Date: Sun, 03 Jul 2016 11:19:38 -0000 Subject: [pypy-issue] Issue #2338: Windows(Pillow) APPCRASH (pypy/pypy) Message-ID: <20160703111938.14485.45400@celery-worker-103.ash1.bb-inf.net> New issue 2338: Windows(Pillow) APPCRASH https://bitbucket.org/pypy/pypy/issues/2338/windows-pillow-appcrash CTPaHHuK-HEbA: After [C-API Support update](https://morepypy.blogspot.com/2016/02/c-api-support-update.html) pypy crash in Windows 7 x64 if use Pillow ``` #!python from PIL import Image, ImageGrab img = Image.open('1.bmp').convert('L').load() screen = ImageGrab.grab().convert('L') w, h = screen.size screen = screen.load() for y in xrange(0, h): for x in xrange(0, w): print y if screen[x, y] == img[0, 0]: print 'ok' ``` Build Pillow 3.3.0 or early: ``` SET MAX_CONCURRENCY=1 pypy setup.py build_ext --disable-zlib --disable-jpeg install --single-version-externally-managed --root=/ ``` pypy2-v5.3.1-win32.zip (_imaging.pypy-41.pyd) ``` ????????? ????????: ??? ??????? ????????: APPCRASH ??? ??????????: pypy.exe ?????? ??????????: 0.0.0.0 ??????? ??????? ??????????: 56cc6069 ??? ?????? ? ???????: StackHash_0a9e ?????? ?????? ? ???????: 0.0.0.0 ??????? ??????? ?????? ? ???????: 00000000 ??? ??????????: c0000005 ???????? ??????????: 0208a5c1 ?????? ??: 6.1.7601.2.1.0.256.1 ??? ?????: 1049 ?????????????? ???????? 1: 0a9e ?????????????? ???????? 2: 0a9e372d3b4ad19135b953a78882e789 ``` First build crash: pypy-c-jit-82431-0116c45060a7-win32.zip (_imaging.pypy-41.pyd) ``` ????????? ????????: ??? ??????? ????????: APPCRASH ??? ??????????: pypy.exe ?????? ??????????: 0.0.0.0 ??????? ??????? ??????????: 56cc6069 ??? ?????? ? ???????: libpypy-c.dll ?????? ?????? ? ???????: 0.0.0.0 ??????? ??????? ?????? ? ???????: 56cc6055 ??? ??????????: c0000005 ???????? ??????????: 00472fe9 ``` Last build OK: pypy-c-jit-82324-e79f457ab18f-win32.zip (_imaging.pypy-26.pyd) From issues-reply at bitbucket.org Mon Jul 4 04:25:22 2016 From: issues-reply at bitbucket.org (Richard Plangger) Date: Mon, 04 Jul 2016 08:25:22 -0000 Subject: [pypy-issue] Issue #2339: CPyExt tests _FORTIFY_SOURCE!=0 and -O0 (pypy/pypy) Message-ID: <20160704082522.26024.58851@celery-worker-103.ash1.bb-inf.net> New issue 2339: CPyExt tests _FORTIFY_SOURCE!=0 and -O0 https://bitbucket.org/pypy/pypy/issues/2339/cpyext-tests-_fortify_source-0-and-o0 Richard Plangger: On Fedora (24) and redhat linux many cpyext tests fail, because of the setting described in the title. _FORTIFY_SOURCE not equal to zero requires an optimization level greater than zero. For some tests -Werror is provided to the compile flag. This fails the test because the compilation cannot succeed. It seems to be distribution related. The source for not passing the test seems to come from /usr/lib64/python2.7/_sysconfigdata.py where CFLAGS is defined as: ``` #!python 'CFLAGS': '-fno-strict-aliasing -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -DNDEBUG -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv', ``` Later in the test [1] we add ```compile_extra = ["-Werror", "-g", "-O0", "-fPIC"]```. -O0 overwrites -O2, which conflicts with _FORTIFY_SOURCE=2. I have not found an option to remove the effect of -Wp,_FORTIFY_SOURCE=2. What should we do about this issues? [1] pypy/module/cpyext/test/test_cpyext.py::test_buffer Responsible: plan_rich From issues-reply at bitbucket.org Thu Jul 7 00:01:11 2016 From: issues-reply at bitbucket.org (Evan Hubinger) Date: Thu, 07 Jul 2016 04:01:11 -0000 Subject: [pypy-issue] Issue #2340: CPython / PyPy incompatibility issue in itertools.tee (pypy/pypy) Message-ID: <20160707040111.59979.95290@celery-worker-102.ash1.bb-inf.net> New issue 2340: CPython / PyPy incompatibility issue in itertools.tee https://bitbucket.org/pypy/pypy/issues/2340/cpython-pypy-incompatibility-issue-in Evan Hubinger: In CPython 2 and 3, I can do ``` #!python from itertools import tee a, b = tee(iter([1, 2, 3])) c = a.__copy__() assert next(a) == 1 and next(b) == 1 and next(c) == 1 ``` but in PyPy 2 and 3, this fails with ``` AttributeError: 'itertools._tee' object has no attribute '__copy__' ``` and `copy.copy` doesn't work either. From issues-reply at bitbucket.org Sat Jul 9 07:07:10 2016 From: issues-reply at bitbucket.org (Armin Rigo) Date: Sat, 09 Jul 2016 11:07:10 -0000 Subject: [pypy-issue] Issue #2341: multithreading: locks leading to poor CPU usage (pypy/pypy) Message-ID: <20160709110710.30073.65543@celery-worker-104.ash1.bb-inf.net> New issue 2341: multithreading: locks leading to poor CPU usage https://bitbucket.org/pypy/pypy/issues/2341/multithreading-locks-leading-to-poor-cpu Armin Rigo: Lock-heavy multithreaded programs can cause poor CPU usage on PyPy. The attached example will use only a fraction of the available CPU time, sleeping the rest of the time. From issues-reply at bitbucket.org Sun Jul 10 10:39:54 2016 From: issues-reply at bitbucket.org (mattip) Date: Sun, 10 Jul 2016 14:39:54 -0000 Subject: [pypy-issue] Issue #2342: [cpyext] unable to set tp_as_* function if NULL when PyType_Ready called (pypy/pypy) Message-ID: <20160710143954.18698.68187@celery-worker-103.ash1.bb-inf.net> New issue 2342: [cpyext] unable to set tp_as_* function if NULL when PyType_Ready called https://bitbucket.org/pypy/pypy/issues/2342/cpyext-unable-to-set-tp_as_-function-if mattip: numpy sets tp_as_number slots for scalars when importing umath, which happens way after PyType_Ready is called on the scalar types. Since the various tp_as_number.* functions are NULL when PyType_Ready is called, no wrapper function is created in add_operators, and the later pto.tp_as_number assignment has no effect. This is the actual problem underlying issue #. I have created a branch override-tp_as-methods and a test in that branch, but it is not clear to me what the strategy to resolve this should be. Two options, niether good:: - somehow create stub functions for each tp_as_* slot, wrapping the original type's function, beign careful not to create recursive calls - add a PyPy only C_API function like PyType_Refresh(pto) that would re-assign the tp_as_* slots Any other ideas? From amauryfa at gmail.com Mon Jul 11 03:58:02 2016 From: amauryfa at gmail.com (Amaury Forgeot d'Arc) Date: Mon, 11 Jul 2016 09:58:02 +0200 Subject: [pypy-issue] Issue #2342: [cpyext] unable to set tp_as_* function if NULL when PyType_Ready called (pypy/pypy) In-Reply-To: <20160710143954.18698.68187@celery-worker-103.ash1.bb-inf.net> References: <20160710143954.18698.68187@celery-worker-103.ash1.bb-inf.net> Message-ID: 2016-07-10 16:39 GMT+02:00 mattip : > New issue 2342: [cpyext] unable to set tp_as_* function if NULL when > PyType_Ready called > > https://bitbucket.org/pypy/pypy/issues/2342/cpyext-unable-to-set-tp_as_-function-if > > mattip: > > numpy sets tp_as_number slots for scalars when importing umath, which > happens way after PyType_Ready is called on the scalar types. Since the > various tp_as_number.* functions are NULL when PyType_Ready is called, no > wrapper function is created in add_operators, and the later > pto.tp_as_number assignment has no effect. This is the actual problem > underlying issue #. > This looks wrong to me, even from a CPython perspective. Are the __add__ methods and others correctly filled? > > I have created a branch override-tp_as-methods and a test in that branch, > but it is not clear to me what the strategy to resolve this should be. Two > options, niether good:: > > - somehow create stub functions for each tp_as_* slot, wrapping the > original type's function, beign careful not to create recursive calls > > - add a PyPy only C_API function like PyType_Refresh(pto) that would > re-assign the tp_as_* slots > > Any other ideas? > If nneeded, the existing PyType_Modified() seems a perfect fit for this task: def PyType_Modified(space, w_obj): """Invalidate the internal lookup cache for the type and all of its subtypes. This function must be called after any manual modification of the attributes or base classes of the type. """ > > > _______________________________________________ > pypy-issue mailing list > pypy-issue at python.org > https://mail.python.org/mailman/listinfo/pypy-issue > -- Amaury Forgeot d'Arc From issues-reply at bitbucket.org Tue Jul 12 09:56:33 2016 From: issues-reply at bitbucket.org (Michael Amrhein) Date: Tue, 12 Jul 2016 13:56:33 -0000 Subject: [pypy-issue] Issue #2343: PyPy hides TypeError raised by __instancecheck__ (pypy/pypy) Message-ID: <20160712135633.11175.50536@celery-worker-103.ash1.bb-inf.net> New issue 2343: PyPy hides TypeError raised by __instancecheck__ https://bitbucket.org/pypy/pypy/issues/2343/pypy-hides-typeerror-raised-by Michael Amrhein: ``` #!python Python 2.7.10 (7e8df3df96417c16c2d55b41352ec82c9c69c978, Jul 09 2016, 13:13:39) [PyPy 5.3.1 with GCC 4.9.3] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>>> class AnyMeta(type): .... def __instancecheck__(cls, obj): .... raise TypeError("'Any' cannot be used with isinstance().") .... >>>> class Any(object): .... __metaclass__ = AnyMeta .... >>>> Any.__instancecheck__(42) Traceback (most recent call last): File "", line 1, in File "", line 3, in __instancecheck__ TypeError: 'Any' cannot be used with isinstance(). ``` but ``` #!python >>>> isinstance(42, Any) False ``` From issues-reply at bitbucket.org Tue Jul 12 15:00:00 2016 From: issues-reply at bitbucket.org (Peter Wang) Date: Tue, 12 Jul 2016 19:00:00 -0000 Subject: [pypy-issue] Issue #2344: PyPy2-5.3.1-linux64 slower running array element add with numpy, comparing with CPython (pypy/pypy) Message-ID: <20160712190000.28796.4579@celery-worker-103.ash1.bb-inf.net> New issue 2344: PyPy2-5.3.1-linux64 slower running array element add with numpy, comparing with CPython https://bitbucket.org/pypy/pypy/issues/2344/pypy2-531-linux64-slower-running-array Peter Wang: Hi, We are seeing 22x slower running PyPy2-5.3.1-linux64 with the alpha-0 numpy releases for pypy, when performing array element add. See results and code below. This was running on Ubuntu 14.04.1 LTS. Before we spend more effort to investigate, I?d like to know if this is a known issue, and if any details are already available. Thanks, Peter $ /opt/pypy2-v5.3.1-linux64/bin/pypy ./vectoradd.py N = 3200000 NumPy initialization took 0.003146 seconds C[:5] = [ 2. 2. 2. 2. 2.] C[-5:] = [ 2. 2. 2. 2. 2.] VectorAdd took 24.797032 seconds $ /usr/bin/python2.7 ./vectoradd.py N = 3200000 NumPy initialization took 0.004292 seconds C[:5] = [ 2. 2. 2. 2. 2.] C[-5:] = [ 2. 2. 2. 2. 2.] VectorAdd took 1.085233 seconds $ cat vectoradd.py import numpy as np from timeit import default_timer as timer def VectorAdd(a, b, c): for i in xrange(a.size): c[i] = a[i] + b[i] def main(): N = 320000000 # number of elements per Array N = 3200000 start = timer() A = np.ones(N, dtype=np.float32) B = np.ones(N, dtype=np.float32) C = np.zeros(N, dtype=np.float32) print("N = %d" % N) print("NumPy initialization took %f seconds" % (timer() - start)) start = timer() VectorAdd(A, B, C) vectoradd_time = timer() - start print("C[:5] = " + str(C[:5])) print("C[-5:] = " + str(C[-5:])) print("VectorAdd took %f seconds" % vectoradd_time) if __name__ == '__main__': main() From issues-reply at bitbucket.org Thu Jul 14 09:59:37 2016 From: issues-reply at bitbucket.org (bra) Date: Thu, 14 Jul 2016 13:59:37 -0000 Subject: [pypy-issue] Issue #2345: pypy json.loads fails on a string, on which CPython doesn't (Unpaired high surrogate) (pypy/pypy) Message-ID: <20160714135937.6648.78054@celery-worker-104.ash1.bb-inf.net> New issue 2345: pypy json.loads fails on a string, on which CPython doesn't (Unpaired high surrogate) https://bitbucket.org/pypy/pypy/issues/2345/pypy-jsonloads-fails-on-a-string-on-which bra: Hi, I have this funny looking JSON: js='{"subject":"\xc3\x9aj tev\xc3\xa9kenys\xc3\xa9g a vide\xc3\xb3ddal kapcsolatban: UGORJ M\xc3\x81R!!! / Yellow : The Yellow Artifact","snippet":"\xc3\x9aj tev\xc3\xa9kenys\xc3\xa9g a vide\xc3\xb3ddal kapcsolatban: Videos DB megjegyz\xc3\xa9st \xc3\xadrt ehhez: \\r\\nUGORJ M\xc3\x81R!!! / Yellow : The Yellow Artifact nem t\xc3\xb6lt le a szaros Evolve \\r\\nStage\\uD83D\\uDE24\\uD83D\\uDE26\\uD83D"}' I can json.loads this from CPython, and can't from pypy: Python 2.7.11 (default, Jun 18 2016, 01:18:18) [GCC 4.2.1 Compatible FreeBSD Clang 3.4.1 (tags/RELEASE_34/dot1-final 208032)] on freebsd10 Type "help", "copyright", "credits" or "license" for more information. >>> json.loads(js) {u'snippet': u'\xdaj tev\xe9kenys\xe9g a vide\xf3ddal kapcsolatban: Videos DB megjegyz\xe9st \xedrt ehhez: \r\nUGORJ M\xc1R!!! / Yellow : The Yellow Artifact nem t\xf6lt le a szaros Evolve \r\nStage\U0001f624\U0001f626\ud83d', u'subject': u'\xdaj tev\xe9kenys\xe9g a vide\xf3ddal kapcsolatban: UGORJ M\xc1R!!! / Yellow : The Yellow Artifact'} Python 2.7.10 (b0a649e90b6642251fb4a765fe5b27a97b1319a9, May 12 2016, 01:17:56) [PyPy 5.1.1 with GCC 4.2.1 Compatible FreeBSD Clang 3.4.1 (tags/RELEASE_34/dot1-final 208032)] on freebsd10 Type "help", "copyright", "credits" or "license" for more information. >>>> json.loads(js) Traceback (most recent call last): File "", line 1, in File "/usr/local/pypy-5.1/lib-python/2.7/json/__init__.py", line 344, in loads return _pypyjson.loads(s) ValueError: Unpaired high surrogate at char 311 From issues-reply at bitbucket.org Tue Jul 19 22:29:04 2016 From: issues-reply at bitbucket.org (oscardssmith) Date: Wed, 20 Jul 2016 02:29:04 -0000 Subject: [pypy-issue] Issue #2346: Hashing yields inconsistent results. (pypy/pypy) Message-ID: <20160720022904.28563.76015@celery-worker-102.ash1.bb-inf.net> New issue 2346: Hashing yields inconsistent results. https://bitbucket.org/pypy/pypy/issues/2346/hashing-yields-inconsistent-results oscardssmith: As you probably no, CPython hashes ints such that hash(i) = i for almost all ints. The only exception to this is that hash(-1) = -2 as a hash value of -1 is used to indicate problems in the hash table. Currently hash(-1) = -1 on pypy2, (on pypy3 the expected behavior is observed). This would not be a problem, except that hash(np.int8(-1)) = -2 as CPython expects (note this is also true for np.int16, and np.int32 but **not** np.int64/np.int. This yields unexpected behavior when comparing keys of different integer types. Either hash(-1) should return -1 for all types (likely faster) or hash(-1) returns -2 (more fully compatible with CPython, saves users who assume hash(-1) == -2 (stupid, but you never know). From issues-reply at bitbucket.org Wed Jul 20 01:16:43 2016 From: issues-reply at bitbucket.org (Simen) Date: Wed, 20 Jul 2016 05:16:43 -0000 Subject: [pypy-issue] Issue #2347: RPython "hello world" fails to compile with Visual C++ 2015 as the C compiler. (pypy/pypy) Message-ID: <20160720051643.35053.81578@celery-worker-101.ash1.bb-inf.net> New issue 2347: RPython "hello world" fails to compile with Visual C++ 2015 as the C compiler. https://bitbucket.org/pypy/pypy/issues/2347/rpython-hello-world-fails-to-compile-with Simen: Compiling a simple "Hello, world" program written in RPython fails during the C->executable stage with an error related to a missing symbol, __pioinfo. Apparently, as of Visual Studio 2014 this symbol is now longer exported by the compiler, because it exposes internals in a way they don't like. From some googling around, it seems the same problem exists or has existed in Ruby and Perl implementations too. The program compiles on my machine using Visual C++ 2008 as expected. From issues-reply at bitbucket.org Wed Jul 20 02:34:14 2016 From: issues-reply at bitbucket.org (David Naylor) Date: Wed, 20 Jul 2016 06:34:14 -0000 Subject: [pypy-issue] Issue #2348: pypy3-5.2.0-alpha1 fails to translate on FreeBSD (pypy/pypy) Message-ID: <20160720063414.2931.85866@celery-worker-104.ash1.bb-inf.net> New issue 2348: pypy3-5.2.0-alpha1 fails to translate on FreeBSD https://bitbucket.org/pypy/pypy/issues/2348/pypy3-520-alpha1-fails-to-translate-on David Naylor: When translating with PyPy-5.1.1 on FreeBSD 10.3 I get: ``` > /usr/bin/env PYPY_LOCALBASE=/usr/local XDG_DATA_HOME=/usr/local/home/dbn/ports/ports/lang/pypy3/work XDG_CONFIG_HOME=/usr/local/home/dbn/ports/ports/lang/pypy3/work HOME=/usr/local/home/dbn/ports/ports/lang/pypy3/work NO_PIE=yes WITHOUT_DEBUG_FILES=yes WITHOUT_KERNEL_SYMBOLS=yes SHELL=/bin/sh NO_LINT=YES PREFIX=/usr/local LOCALBASE=/usr/local LIBDIR="/usr/lib" CC="cc" CFLAGS="-O2 -pipe -fstack-protector -fno-strict-aliasing" CPP="cpp" CPPFLAGS="" LDFLAGS=" -fstack-protector" LIBS="" CXX="c++" CXXFLAGS="-O2 -pipe -fstack-protector -fno-strict-aliasing " MANPREFIX="/usr/local" BSD_INSTALL_PROGRAM="install -s -m 555" BSD_INSTALL_LIB="install -s -m 444" BSD_INSTALL_SCRIPT="install -m 555" BSD_INSTALL_DATA="install -m 0644" BSD_INSTALL_MAN="install -m 444" TMPDIR=/usr/local/home/dbn/ports/ports/lang/pypy3/work/build /usr/local/bin/pypy ../../rpython/bin/rpython --source -Ojit targetpypystandalone.py [7271] translation-task} [Timer] Timings: [Timer] annotate --- 268.9 s [Timer] ========================================== [Timer] Total: --- 268.9 s [translation:info] Error: File "/usr/local/home/dbn/ports/ports/lang/pypy3/work/pypy3.3-v5.2.0-alpha1-src/rpython/translator/goal/translate.py", line 317, in main drv.proceed(goals) File "/usr/local/home/dbn/ports/ports/lang/pypy3/work/pypy3.3-v5.2.0-alpha1-src/rpython/translator/driver.py", line 551, in proceed result = self._execute(goals, task_skip = self._maybe_skip()) File "/usr/local/home/dbn/ports/ports/lang/pypy3/work/pypy3.3-v5.2.0-alpha1-src/rpython/translator/tool/taskengine.py", line 114, in _execute res = self._do(goal, taskcallable, *args, **kwds) File "/usr/local/home/dbn/ports/ports/lang/pypy3/work/pypy3.3-v5.2.0-alpha1-src/rpython/translator/driver.py", line 278, in _do res = func() File "/usr/local/home/dbn/ports/ports/lang/pypy3/work/pypy3.3-v5.2.0-alpha1-src/rpython/translator/driver.py", line 315, in task_annotate s = annotator.build_types(self.entry_point, self.inputtypes) File "/usr/local/home/dbn/ports/ports/lang/pypy3/work/pypy3.3-v5.2.0-alpha1-src/rpython/annotator/annrpython.py", line 86, in build_types return self.build_graph_types(flowgraph, inputs_s, complete_now=complete_now) File "/usr/local/home/dbn/ports/ports/lang/pypy3/work/pypy3.3-v5.2.0-alpha1-src/rpython/annotator/annrpython.py", line 132, in build_graph_types self.complete() File "/usr/local/home/dbn/ports/ports/lang/pypy3/work/pypy3.3-v5.2.0-alpha1-src/rpython/annotator/annrpython.py", line 186, in complete self.complete_pending_blocks() File "/usr/local/home/dbn/ports/ports/lang/pypy3/work/pypy3.3-v5.2.0-alpha1-src/rpython/annotator/annrpython.py", line 181, in complete_pending_blocks self.processblock(graph, block) File "/usr/local/home/dbn/ports/ports/lang/pypy3/work/pypy3.3-v5.2.0-alpha1-src/rpython/annotator/annrpython.py", line 347, in processblock self.flowin(graph, block) File "/usr/local/home/dbn/ports/ports/lang/pypy3/work/pypy3.3-v5.2.0-alpha1-src/rpython/annotator/annrpython.py", line 446, in flowin self.consider_op(op) File "/usr/local/home/dbn/ports/ports/lang/pypy3/work/pypy3.3-v5.2.0-alpha1-src/rpython/annotator/annrpython.py", line 598, in consider_op resultcell = op.consider(self) File "/usr/local/home/dbn/ports/ports/lang/pypy3/work/pypy3.3-v5.2.0-alpha1-src/rpython/flowspace/operation.py", line 104, in consider return spec(annotator, *self.args) File "/usr/local/home/dbn/ports/ports/lang/pypy3/work/pypy3.3-v5.2.0-alpha1-src/rpython/annotator/unaryop.py", line 118, in simple_call_SomeObject return s_func.call(argspec) File "/usr/local/home/dbn/ports/ports/lang/pypy3/work/pypy3.3-v5.2.0-alpha1-src/rpython/rtyper/lltypesystem/lltype.py", line 1579, in call v = self.ll_ptrtype._example()(*llargs) File "/usr/local/home/dbn/ports/ports/lang/pypy3/work/pypy3.3-v5.2.0-alpha1-src/rpython/rtyper/lltypesystem/lltype.py", line 1374, in __call__ "types: %r" % (self._T, args_repr)) [translation:ERROR] TypeError: calling INT> with wrong argument types: [, <* Array of Char >, <* Struct stat { c_st_dev, c_st_ino, c_st_mode, c_st_nlink, c_st_uid, c_st_gid, c_st_rdev, c_st_atime, c__pad0, c__pad1, c__pad2, c__pad3, c__pad4, c__pad5, c__pad6, c__pad7, c_st_mtime, c__pad8, c__pad9 , c__pad 10, c__pad11, c__pad12, c__pad13, c__pad14, c__pad15, c_st_ctime, c__pad16, c__pad17, c__pad18, c__pad19, c__pad20, c__pad21, c__pad22, c__pad23, c_st_size, c_st_blocks, c_st_blksize, c_st_flags, c__pad24, c__pad25, c__pad26, c__pad27, c__pad28, c__pad29, c__pad30, c__pad31, c__pad32, c__pad33, c__pad34, c__pad35, c__pad36, c__pad37, c__pad38, c__pad39, c__pad40, c__pad41, c__pad42, c__pad43, c__pad44, c__pad45, c__pad46, c__pad47 }>, ] Processing block: block at 6 is a in (rpython.rtyper.lltypesystem.rffi:3)ccall_fstatat__INT_arrayPtr_statPtr_NoneConst containing the following operations: v741 = simple_call((function release)) v740 = simple_call((function _errno_before), (1)) res_0 = simple_call((<* fn fstatat>), a0_0, a1_0, a2_0, a3_0) v742 = simple_call((function _errno_after), (1)) v743 = simple_call((function acquire)) --end-- [translation] start debugger... > /usr/local/home/dbn/ports/ports/lang/pypy3/work/pypy3.3-v5.2.0-alpha1-src/rpython/rtyper/lltypesystem/lltype.py(1374)__call__() -> "types: %r" % (self._T, args_repr)) (Pdb+) ``` when translating with Python-2.7.11 I get a different error: ``` > /usr/bin/env PYPY_LOCALBASE=/usr/local XDG_DATA_HOME=/usr/local/home/dbn/ports/ports/lang/pypy3/work XDG_CONFIG_HOME=/usr/local/home/dbn/ports/ports/lang/pypy3/work HOME=/usr/local/home/dbn/ports/ports/lang/pypy3/work NO_PIE=yes WITHOUT_DEBUG_FILES=yes WITHOUT_KERNEL_SYMBOLS=yes SHELL=/bin/sh NO_LINT=YES PREFIX=/usr/local LOCALBASE=/usr/local LIBDIR="/usr/lib" CC="cc" CFLAGS="-O2 -pipe -fstack-protector -fno-strict-aliasing" CPP="cpp" CPPFLAGS="" LDFLAGS=" -fstack-protector" LIBS="" CXX="c++" CXXFLAGS="-O2 -pipe -fstack-protector -fno-strict-aliasing " MANPREFIX="/usr/local" BSD_INSTALL_PROGRAM="install -s -m 555" BSD_INSTALL_LIB="install -s -m 444" BSD_INSTALL_SCRIPT="install -m 555" BSD_INSTALL_DATA="install -m 0644" BSD_INSTALL_MAN="install -m 444" TMPDIR=/usr/local/home/dbn/ports/ports/lang/pypy3/work/build /usr/local/bin/python2.7 ../../rpython/bin/rpython --source -Ojit targetpypystandalone.py [Timer] Timings: [Timer] annotate --- 144.9 s [Timer] ========================================== [Timer] Total: --- 144.9 s [translation:info] Error: File "/usr/local/home/dbn/ports/ports/lang/pypy3/work/pypy3.3-v5.2.0-alpha1-src/rpython/translator/goal/translate.py", line 317, in main drv.proceed(goals) File "/usr/local/home/dbn/ports/ports/lang/pypy3/work/pypy3.3-v5.2.0-alpha1-src/rpython/translator/driver.py", line 551, in proceed result = self._execute(goals, task_skip = self._maybe_skip()) File "/usr/local/home/dbn/ports/ports/lang/pypy3/work/pypy3.3-v5.2.0-alpha1-src/rpython/translator/tool/taskengine.py", line 114, in _execute res = self._do(goal, taskcallable, *args, **kwds) File "/usr/local/home/dbn/ports/ports/lang/pypy3/work/pypy3.3-v5.2.0-alpha1-src/rpython/translator/driver.py", line 278, in _do res = func() File "/usr/local/home/dbn/ports/ports/lang/pypy3/work/pypy3.3-v5.2.0-alpha1-src/rpython/translator/driver.py", line 315, in task_annotate s = annotator.build_types(self.entry_point, self.inputtypes) File "/usr/local/home/dbn/ports/ports/lang/pypy3/work/pypy3.3-v5.2.0-alpha1-src/rpython/annotator/annrpython.py", line 86, in build_types return self.build_graph_types(flowgraph, inputs_s, complete_now=complete_now) File "/usr/local/home/dbn/ports/ports/lang/pypy3/work/pypy3.3-v5.2.0-alpha1-src/rpython/annotator/annrpython.py", line 132, in build_graph_types self.complete() File "/usr/local/home/dbn/ports/ports/lang/pypy3/work/pypy3.3-v5.2.0-alpha1-src/rpython/annotator/annrpython.py", line 186, in complete self.complete_pending_blocks() File "/usr/local/home/dbn/ports/ports/lang/pypy3/work/pypy3.3-v5.2.0-alpha1-src/rpython/annotator/annrpython.py", line 181, in complete_pending_blocks self.processblock(graph, block) File "/usr/local/home/dbn/ports/ports/lang/pypy3/work/pypy3.3-v5.2.0-alpha1-src/rpython/annotator/annrpython.py", line 347, in processblock self.flowin(graph, block) File "/usr/local/home/dbn/ports/ports/lang/pypy3/work/pypy3.3-v5.2.0-alpha1-src/rpython/annotator/annrpython.py", line 513, in flowin self.follow_link(graph, link, constraints) File "/usr/local/home/dbn/ports/ports/lang/pypy3/work/pypy3.3-v5.2.0-alpha1-src/rpython/annotator/annrpython.py", line 548, in follow_link self.addpendingblock(graph, link.target, inputs_s) File "/usr/local/home/dbn/ports/ports/lang/pypy3/work/pypy3.3-v5.2.0-alpha1-src/rpython/annotator/annrpython.py", line 174, in addpendingblock self.mergeinputargs(graph, block, cells) File "/usr/local/home/dbn/ports/ports/lang/pypy3/work/pypy3.3-v5.2.0-alpha1-src/rpython/annotator/annrpython.py", line 384, in mergeinputargs unions = [annmodel.unionof(c1,c2) for c1, c2 in zip(oldcells,inputcells)] File "/usr/local/home/dbn/ports/ports/lang/pypy3/work/pypy3.3-v5.2.0-alpha1-src/rpython/annotator/model.py", line 753, in unionof s1 = pair(s1, s2).union() File "/usr/local/home/dbn/ports/ports/lang/pypy3/work/pypy3.3-v5.2.0-alpha1-src/rpython/annotator/binaryop.py", line 774, in union return obj.noneify() File "/usr/local/home/dbn/ports/ports/lang/pypy3/work/pypy3.3-v5.2.0-alpha1-src/rpython/annotator/model.py", line 127, in noneify raise UnionError(self, s_None) [translation:ERROR] UnionError: Offending annotations: SomeInteger(const=0, knowntype=int, nonneg=True, unsigned=False) SomeNone() In : Happened at file /usr/local/home/dbn/ports/ports/lang/pypy3/work/pypy3.3-v5.2.0-alpha1-src/rpython/rlib/rposix.py line 1972 error = c_unlinkat(dir_fd, pathname, flag) handle_posix_error('unlinkat', error) Processing block: block at 3 is a in (rpython.rlib.rposix:1970)unlinkat containing the following operations: v512 = bool(removedir_0) --end-- [translation] start debugger... > /usr/local/home/dbn/ports/ports/lang/pypy3/work/pypy3.3-v5.2.0-alpha1-src/rpython/annotator/model.py(127)noneify() -> raise UnionError(self, s_None) ``` From issues-reply at bitbucket.org Thu Jul 21 02:10:20 2016 From: issues-reply at bitbucket.org (David Naylor) Date: Thu, 21 Jul 2016 06:10:20 -0000 Subject: [pypy-issue] Issue #2349: [patch] fix build on DragonFly (pypy/pypy) Message-ID: <20160721061020.25447.21623@celery-worker-104.ash1.bb-inf.net> New issue 2349: [patch] fix build on DragonFly https://bitbucket.org/pypy/pypy/issues/2349/patch-fix-build-on-dragonfly David Naylor: DragonFly needs the same fix for vmprof as FreeBSD. The attached patch fixes vmprof_config.h. From issues-reply at bitbucket.org Thu Jul 21 10:54:51 2016 From: issues-reply at bitbucket.org (John Vandenberg) Date: Thu, 21 Jul 2016 14:54:51 -0000 Subject: [pypy-issue] Issue #2350: Windows PyPy2 sys.stderr emitting \r\r\n line separators (pypy/pypy) Message-ID: <20160721145451.23785.88853@celery-worker-101.ash1.bb-inf.net> New issue 2350: Windows PyPy2 sys.stderr emitting \r\r\n line separators https://bitbucket.org/pypy/pypy/issues/2350/windows-pypy2-sysstderr-emitting-r-r-n John Vandenberg: If a process prints a line to stderr, pypy replaces the newline with `\r\r\n`. This happens with any of these approaches: ``` from __future__ import print_function print('foo', file=sys.stderr) sys.stderr.write('foo\n') sys.stderr.writelines(['foo\n']) ``` This doesnt occur for stdout, which emits a normal windows line ending of `\r\n`. From issues-reply at bitbucket.org Fri Jul 22 01:51:01 2016 From: issues-reply at bitbucket.org (Eric Astor) Date: Fri, 22 Jul 2016 05:51:01 -0000 Subject: [pypy-issue] Issue #2351: Creating and overwriting tuples 4x slower on PyPy (pypy/pypy) Message-ID: <20160722055101.22378.31017@celery-worker-104.ash1.bb-inf.net> New issue 2351: Creating and overwriting tuples 4x slower on PyPy https://bitbucket.org/pypy/pypy/issues/2351/creating-and-overwriting-tuples-4x-slower Eric Astor: Using PyPy 5.3.1 (on Windows): ``` #!bash pypy -m timeit -n 10000 -s "a = range(10000)" "tuple(a)" ``` takes (on my system) ~67 usec per loop, while ``` #!bash python27 -m timeit -n 10000 -s "a = range(10000)" "tuple(a)" ``` takes only ~25.5 usec per loop. Furthermore, assigning the tuple to a variable ``` #!bash pypy -m timeit -n 10000 -s "a = range(10000)" "x = tuple(a)" ``` now takes ~109 usec per loop, but does not impact CPython's performance at all. However, if we clear the variable after each assignment, performance recovers: ``` #!bash pypy -m timeit -n 10000 -s "a = range(10000)" "x = tuple(a); del x" ``` returns to taking ~67 usec per loop. From issues-reply at bitbucket.org Sat Jul 23 07:37:06 2016 From: issues-reply at bitbucket.org (Vasiliy Faronov) Date: Sat, 23 Jul 2016 11:37:06 -0000 Subject: [pypy-issue] Issue #2352: list.__contains__ compares objects in wrong order (pypy/pypy) Message-ID: <20160723113706.30743.41393@celery-worker-104.ash1.bb-inf.net> New issue 2352: list.__contains__ compares objects in wrong order https://bitbucket.org/pypy/pypy/issues/2352/list__contains__-compares-objects-in-wrong Vasiliy Faronov: Consider the following program: ``` #!python class Foo(object): def __init__(self, bar): self.bar = bar def __repr__(self): return 'Foo(%r)' % (self.bar,) def __eq__(self, other): print('Foo.__eq__(%r, %r)' % (self, other)) return self.bar == other foo1 = Foo('A') foo2 = Foo('B') assert foo1 not in [foo2] ``` Under CPython 2.7.11 and 3.5.1, it prints: ``` #!python Foo.__eq__(Foo('A'), Foo('B')) Foo.__eq__(Foo('B'), 'A') ``` But under PyPy 5.3.1 (2.7), it prints: ``` #!python Foo.__eq__(Foo('B'), Foo('A')) Foo.__eq__(Foo('A'), 'B') ``` PyPy?s behavior contradicts the [Python 2 language reference](https://docs.python.org/2/reference/expressions.html#membership-test-details): > For the list and tuple types, `x in y` is true if and only if there exists an index *i* such that either `x is y[i]` or `x == y[i]` is true. According to the [Python?3 language reference](https://docs.python.org/3/reference/expressions.html#value-comparisons) (can?t find anything about this in Python?2), equality does not have to be symmetric (emphasis mine): > User-defined classes that customize their comparison behavior should follow some consistency rules, **if possible**: > > .?.?. > > * Comparison should be symmetric > > .?.?. > > Python does not enforce these consistency rules. In fact, the not-a-number values are an example for not following these rules. In my case, `x` and `y` are instances of different classes with completely different, magical `__eq__`, so this becomes important. From issues-reply at bitbucket.org Mon Jul 25 15:55:27 2016 From: issues-reply at bitbucket.org (Sarah Mount) Date: Mon, 25 Jul 2016 19:55:27 -0000 Subject: [pypy-issue] Issue #2353: Confusing type error: AttributeError: RangeIteratorRepr instance has no attribute ll_getnextindex (pypy/pypy) Message-ID: <20160725195527.511.86105@celery-worker-103.ash1.bb-inf.net> New issue 2353: Confusing type error: AttributeError: RangeIteratorRepr instance has no attribute ll_getnextindex https://bitbucket.org/pypy/pypy/issues/2353/confusing-type-error-attributeerror Sarah Mount: The call to **enumerate** in the example interpreter below produces the confusing error message also shown. ``` #!python $ cat example.py def entry_point(argv): for x, y in enumerate(xrange(10)): print x, y return 0 def target(driver, args): return entry_point, None $ .../pypy/rpython/bin/rpython -Ojit example.py ... [translation:info] Error: File "/home/snim2/Desktop/working/pypy/rpython/translator/goal/translate.py", line 317, in main drv.proceed(goals) File "/home/snim2/Desktop/working/pypy/rpython/translator/driver.py", line 551, in proceed result = self._execute(goals, task_skip = self._maybe_skip()) File "/home/snim2/Desktop/working/pypy/rpython/translator/tool/taskengine.py", line 114, in _execute res = self._do(goal, taskcallable, *args, **kwds) File "/home/snim2/Desktop/working/pypy/rpython/translator/driver.py", line 278, in _do res = func() File "/home/snim2/Desktop/working/pypy/rpython/translator/driver.py", line 345, in task_rtype_lltype rtyper.specialize(dont_simplify_again=True) File "/home/snim2/Desktop/working/pypy/rpython/rtyper/rtyper.py", line 188, in specialize self.specialize_more_blocks() File "/home/snim2/Desktop/working/pypy/rpython/rtyper/rtyper.py", line 231, in specialize_more_blocks self.specialize_block(block) File "/home/snim2/Desktop/working/pypy/rpython/rtyper/rtyper.py", line 316, in specialize_block hop.setup() # this is called from here to catch TyperErrors... File "/home/snim2/Desktop/working/pypy/rpython/rtyper/rtyper.py", line 639, in setup self.r_result = rtyper.getrepr(self.s_result) File "/home/snim2/Desktop/working/pypy/rpython/rtyper/rtyper.py", line 158, in getrepr result = s_obj.rtyper_makerepr(self) File "/home/snim2/Desktop/working/pypy/rpython/rtyper/rmodel.py", line 282, in rtyper_makerepr return EnumerateIteratorRepr(r_baseiter) File "/home/snim2/Desktop/working/pypy/rpython/rtyper/rrange.py", line 204, in __init__ self.ll_getnextindex = r_baseiter.ll_getnextindex File "/home/snim2/Desktop/working/pypy/rpython/rtyper/rmodel.py", line 107, in __getattr__ self.__class__.__name__, name)) [translation:ERROR] AttributeError: RangeIteratorRepr instance has no attribute ll_getnextindex [translation] start debugger... > /home/snim2/Desktop/working/pypy/rpython/rtyper/rmodel.py(107)__getattr__() -> self.__class__.__name__, name)) ``` From issues-reply at bitbucket.org Mon Jul 25 16:17:24 2016 From: issues-reply at bitbucket.org (Sarah Mount) Date: Mon, 25 Jul 2016 20:17:24 -0000 Subject: [pypy-issue] Issue #2354: Confusing type message: do_stringformat()-> assert s_str.is_constant() (pypy/pypy) Message-ID: <20160725201724.14702.57437@celery-worker-104.ash1.bb-inf.net> New issue 2354: Confusing type message: do_stringformat()-> assert s_str.is_constant() https://bitbucket.org/pypy/pypy/issues/2354/confusing-type-message-do_stringformat Sarah Mount: In the example interpreter below, there is some confusion between class attributes and object attributes. The "bug" here is that the error message that the RPython annotator gives is confusing. ``` #!python $ cat example2.py class Interpreter(object): help_message = 'usage: %s' def __init__(self, name): self.name = name def get_entry_point(self): def entry_point(argv): print self.help_message % self.name return 0 return entry_point class MyInterpreter(Interpreter): help_message = 'I WANT MY OWN HELP MESSAGE!!! usage: %s' def __init__(self): Interpreter.__init__(self, 'myinterp') # Fix type error by removing MyInterpreter.help_message # and writing: # # Interpreter.help_message = 'I WANT MY OWN HELP MESSAGE!!! usage: %s' # # in this constructor instead. def get_entry_point(self): def entry_point(argv): print self.help_message % self.name return 0 return entry_point def target(driver, args): return MyInterpreter().get_entry_point(), None $ ../pypy/rpython/bin/rpython -Ojit example2.py [translation:info] Error: File "/home/snim2/Desktop/working/pypy/rpython/translator/goal/translate.py", line 317, in main drv.proceed(goals) File "/home/snim2/Desktop/working/pypy/rpython/translator/driver.py", line 551, in proceed result = self._execute(goals, task_skip = self._maybe_skip()) File "/home/snim2/Desktop/working/pypy/rpython/translator/tool/taskengine.py", line 114, in _execute res = self._do(goal, taskcallable, *args, **kwds) File "/home/snim2/Desktop/working/pypy/rpython/translator/driver.py", line 278, in _do res = func() File "/home/snim2/Desktop/working/pypy/rpython/translator/driver.py", line 345, in task_rtype_lltype rtyper.specialize(dont_simplify_again=True) File "/home/snim2/Desktop/working/pypy/rpython/rtyper/rtyper.py", line 188, in specialize self.specialize_more_blocks() File "/home/snim2/Desktop/working/pypy/rpython/rtyper/rtyper.py", line 231, in specialize_more_blocks self.specialize_block(block) File "/home/snim2/Desktop/working/pypy/rpython/rtyper/rtyper.py", line 317, in specialize_block self.translate_hl_to_ll(hop, varmapping) File "/home/snim2/Desktop/working/pypy/rpython/rtyper/rtyper.py", line 443, in translate_hl_to_ll resultvar = hop.dispatch() File "/home/snim2/Desktop/working/pypy/rpython/rtyper/rtyper.py", line 660, in dispatch return translate_meth(self) File "<259-codegen /home/snim2/Desktop/working/pypy/rpython/rtyper/rtyper.py:523>", line 5, in translate_op_mod return pair(r_arg1, r_arg2).rtype_mod(hop) File "/home/snim2/Desktop/working/pypy/rpython/rtyper/rstr.py", line 554, in rtype_mod return r_str.ll.do_stringformat(hop, [(hop.args_v[1], hop.args_r[1])]) File "/home/snim2/Desktop/working/pypy/rpython/rtyper/lltypesystem/rstr.py", line 1151, in do_stringformat assert s_str.is_constant() [translation:ERROR] AssertionError [translation] start debugger... > /home/snim2/Desktop/working/pypy/rpython/rtyper/lltypesystem/rstr.py(1151)do_stringformat() -> assert s_str.is_constant() ``` From issues-reply at bitbucket.org Sat Jul 30 15:44:06 2016 From: issues-reply at bitbucket.org (Philip Jenvey) Date: Sat, 30 Jul 2016 19:44:06 -0000 Subject: [pypy-issue] Issue #2355: py3k: kill ctypes.pythonapi (pypy/pypy) Message-ID: <20160730194406.10379.65898@celery-worker-103.ash1.bb-inf.net> New issue 2355: py3k: kill ctypes.pythonapi https://bitbucket.org/pypy/pypy/issues/2355/py3k-kill-ctypespythonapi Philip Jenvey: This was killed in pypy2 in f65f69804dfc. This needs to be merged into py3k (probably just the lib-python/2.7 bits into lib-python/3) and could likely require further adjustments to tests. From issues-reply at bitbucket.org Sat Jul 30 18:41:18 2016 From: issues-reply at bitbucket.org (David Terry) Date: Sat, 30 Jul 2016 22:41:18 -0000 Subject: [pypy-issue] Issue #2356: Error when translating py3k on OSX 10.11.5 (pypy/pypy) Message-ID: <20160730224118.44773.93735@celery-worker-102.ash1.bb-inf.net> New issue 2356: Error when translating py3k on OSX 10.11.5 https://bitbucket.org/pypy/pypy/issues/2356/error-when-translating-py3k-on-osx-10115 David Terry: `cd pypy/goal && pypy ../../rpython/bin/rpython --opt=jit` on OSX 10.11.5 gives the following error: ``` [rtyper] specializing: 41500 / 138243 blocks (30%) ++++++++++++++++++++++++******************%%%%%%%[f67e] translation-task} [Timer] Timings: [Timer] annotate --- 432.4 s [Timer] rtype_lltype --- 191.6 s [Timer] ========================================== [Timer] Total: --- 623.9 s [translation:info] Error: File "/Users/david/Projects/pypy/rpython/translator/goal/translate.py", line 317, in main drv.proceed(goals) File "/Users/david/Projects/pypy/rpython/translator/driver.py", line 551, in proceed result = self._execute(goals, task_skip = self._maybe_skip()) File "/Users/david/Projects/pypy/rpython/translator/tool/taskengine.py", line 114, in _execute res = self._do(goal, taskcallable, *args, **kwds) File "/Users/david/Projects/pypy/rpython/translator/driver.py", line 278, in _do res = func() File "/Users/david/Projects/pypy/rpython/translator/driver.py", line 345, in task_rtype_lltype rtyper.specialize(dont_simplify_again=True) File "/Users/david/Projects/pypy/rpython/rtyper/rtyper.py", line 188, in specialize self.specialize_more_blocks() File "/Users/david/Projects/pypy/rpython/rtyper/rtyper.py", line 231, in specialize_more_blocks self.specialize_block(block) File "/Users/david/Projects/pypy/rpython/rtyper/rtyper.py", line 317, in specialize_block self.translate_hl_to_ll(hop, varmapping) File "/Users/david/Projects/pypy/rpython/rtyper/rtyper.py", line 443, in translate_hl_to_ll resultvar = hop.dispatch() File "/Users/david/Projects/pypy/rpython/rtyper/rtyper.py", line 660, in dispatch return translate_meth(self) File "<33181-codegen /Users/david/Projects/pypy/rpython/rtyper/rtyper.py:523>", line 5, in translate_op_mul return pair(r_arg1, r_arg2).rtype_mul(hop) File "/Users/david/Projects/pypy/rpython/rtyper/rfloat.py", line 87, in rtype_mul return _rtype_template(hop, 'mul') File "/Users/david/Projects/pypy/rpython/rtyper/rfloat.py", line 127, in _rtype_template vlist = hop.inputargs(Float, Float) File "/Users/david/Projects/pypy/rpython/rtyper/rtyper.py", line 691, in inputargs vars.append(self.inputarg(converted_to[i], i)) File "/Users/david/Projects/pypy/rpython/rtyper/rtyper.py", line 680, in inputarg return self.llops.convertvar(v, r_binding, converted_to) File "/Users/david/Projects/pypy/rpython/rtyper/rtyper.py", line 823, in convertvar (r_from, r_to)) [translation:ERROR] TyperError: don't know how to convert from to .. (pypy.module.time.interp_time:284)gettimeofday .. block at 151 with 2 exits(last_exception) .. v2513 = mul(v2512, (1e-06)) [translation] start debugger... > /Users/david/Projects/pypy/rpython/rtyper/rtyper.py(823)convertvar() -> (r_from, r_to)) ``` From issues-reply at bitbucket.org Sun Jul 31 15:29:45 2016 From: issues-reply at bitbucket.org (oscardssmith) Date: Sun, 31 Jul 2016 19:29:45 -0000 Subject: [pypy-issue] Issue #2357: pypy code ~50x slower than python (pypy/pypy) Message-ID: <20160731192945.31791.91119@celery-worker-101.ash1.bb-inf.net> New issue 2357: pypy code ~50x slower than python https://bitbucket.org/pypy/pypy/issues/2357/pypy-code-50x-slower-than-python oscardssmith: I was making a sudoku solver using numpy (code below). When I run it on python2, it takes 160ms. On PyPy, it is 7.8s. Any ideas why it is so much slower using pypy? from time import time from itertools import product import numpy as np class board: def __init__(self, state): self.board = np.asarray(state,np.int) self.size = len(state) self.vals = set(range(self.size+1)) def square_vals(self, coord): x, y = coord[0]//3*3, coord[1]//3*3 return self.board[x:x+3, y:y+3] def empty(self): return list(map(tuple, np.transpose(np.nonzero((self.board == 0))))) def valid_move(self, coord, value): return value not in self.board[coord[0]] and value not in self.board[:, coord[1]] and value not in self.square_vals(coord) def valid_moves(self, coord): return self.vals.difference(np.concatenate((self.board[coord[0]], self.board[:, coord[1]], self.square_vals(coord).flatten()))) def valid_board(self): for row, col in product(range(self.size), range(self.size)): value = self.board[(row, col)] self.board[(row, col)] = 0 if not (value not in self.board[row]] and value not in self.board[:, col] and value not in self.square_vals((row,col)): return False self.board[(row, col)] = value return True def __repr__(self): return "".join(''.join(str(row)[1:-1]) + '\n' for row in self.board) def solve(board): change_num = 0 empty, possible = board.empty(), dict() while i < len(empty): possible[empty[i]] = board.valid_moves(empty[i]) if len(possible[empty[i]]): board.board[empty[i]] = min(possible[empty[i]]) change_num += 1 else: while len(possible[empty[i - 1]]) == 1: i -= 1 board.board[empty[i]] = 0 i -= 1 change_num += 1 possible[empty[i]].remove(min(possible[empty[i]])) board.board[empty[i]] = min(possible[empty[i]]) i+=1 print(board) print(change_num) t1 = time() trial = board([ [3, 0, 0, 0, 0, 7, 0, 0, 9], [0, 0, 8, 0, 0, 0, 5, 0, 7], [2, 7, 4, 0, 8, 0, 0, 0, 0], [0, 0, 0, 0, 2, 0, 0, 0, 4], [0, 0, 7, 4, 0, 3, 1, 0, 0], [5, 0, 0, 0, 7, 0, 0, 0, 0], [0, 0, 0, 0, 6, 0, 4, 9, 8], [4, 0, 9, 0, 0, 0, 3, 0, 0], [1, 0, 0, 8, 0, 0, 0, 0, 0], ]) print(trial) solve(trial) print(1000*(time() - t1)) print(trial.valid_board()) From issues-reply at bitbucket.org Sun Jul 31 16:54:40 2016 From: issues-reply at bitbucket.org (Josiah Walker) Date: Sun, 31 Jul 2016 20:54:40 -0000 Subject: [pypy-issue] Issue #2358: pip install matplotlib fails on PyPy 5.3 on OS X (pypy/pypy) Message-ID: <20160731205440.2709.27975@celery-worker-103.ash1.bb-inf.net> New issue 2358: pip install matplotlib fails on PyPy 5.3 on OS X https://bitbucket.org/pypy/pypy/issues/2358/pip-install-matplotlib-fails-on-pypy-53-on Josiah Walker: Numpy is installed from the main numpy repository (the fix for pypy has already been added to it). Scipy has installed successfully. Installing matplotlib gives the following error: UPDATING build/lib.macosx-10.11-x86_64-2.7/matplotlib/_version.py set build/lib.macosx-10.11-x86_64-2.7/matplotlib/_version.py to '1.5.1' running build_ext building 'matplotlib.ft2font' extension Traceback (most recent call last): File "", line 1, in File "/private/var/folders/fx/1bjz7pr54fj20zcwdkmhbl480000gn/T/pip-build-e5DbXy/matplotlib/setup.py", line 277, in **extra_args File "/usr/local/Cellar/pypy/5.3.0/libexec/lib-python/2.7/distutils/core.py", line 151, in setup dist.run_commands() File "/usr/local/Cellar/pypy/5.3.0/libexec/lib-python/2.7/distutils/dist.py", line 953, in run_commands self.run_command(cmd) File "/usr/local/Cellar/pypy/5.3.0/libexec/lib-python/2.7/distutils/dist.py", line 972, in run_command cmd_obj.run() File "/usr/local/Cellar/pypy/5.3.0/libexec/site-packages/setuptools/command/install.py", line 61, in run return orig.install.run(self) File "/usr/local/Cellar/pypy/5.3.0/libexec/lib-python/2.7/distutils/command/install.py", line 573, in run self.run_command('build') File "/usr/local/Cellar/pypy/5.3.0/libexec/lib-python/2.7/distutils/cmd.py", line 334, in run_command self.distribution.run_command(command) File "/usr/local/Cellar/pypy/5.3.0/libexec/lib-python/2.7/distutils/dist.py", line 972, in run_command cmd_obj.run() File "/usr/local/Cellar/pypy/5.3.0/libexec/lib-python/2.7/distutils/command/build.py", line 127, in run self.run_command(cmd_name) File "/usr/local/Cellar/pypy/5.3.0/libexec/lib-python/2.7/distutils/cmd.py", line 334, in run_command self.distribution.run_command(command) File "/usr/local/Cellar/pypy/5.3.0/libexec/lib-python/2.7/distutils/dist.py", line 972, in run_command cmd_obj.run() File "/usr/local/Cellar/pypy/5.3.0/libexec/site-packages/setuptools/command/build_ext.py", line 68, in run _build_ext.run(self) File "/usr/local/Cellar/pypy/5.3.0/libexec/lib-python/2.7/distutils/command/build_ext.py", line 347, in run self.build_extensions() File "/usr/local/Cellar/pypy/5.3.0/libexec/lib-python/2.7/distutils/command/build_ext.py", line 456, in build_extensions self.build_extension(ext) File "/usr/local/Cellar/pypy/5.3.0/libexec/site-packages/setuptools/command/build_ext.py", line 180, in build_extension _build_ext.build_extension(self, ext) File "/usr/local/Cellar/pypy/5.3.0/libexec/lib-python/2.7/distutils/command/build_ext.py", line 503, in build_extension include_dirs=ext.include_dirs, File "setupext.py", line 785, in __get__ result = obj._hooks[self._name]() + result File "setupext.py", line 812, in include_dirs_hook reload(numpy) File "/usr/local/Cellar/pypy/5.3.0/libexec/site-packages/numpy/__init__.py", line 117, in raise RuntimeError('Reloading numpy is not supported') RuntimeError: Reloading numpy is not supported ---------------------------------------- Command "/usr/local/Cellar/pypy/5.3.0/bin/pypy -u -c "import setuptools, tokenize;__file__='/private/var/folders/fx/1bjz7pr54fj20zcwdkmhbl480000gn/T/pip-build-e5DbXy/matplotlib/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /var/folders/fx/1bjz7pr54fj20zcwdkmhbl480000gn/T/pip-p_3Kp6-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/var/folders/fx/1bjz7pr54fj20zcwdkmhbl480000gn/T/pip-build-e5DbXy/matplotlib/