From armin.rigo at gmail.com Sun Jul 1 03:03:00 2018 From: armin.rigo at gmail.com (Armin Rigo) Date: Sun, 1 Jul 2018 09:03:00 +0200 Subject: [pypy-dev] Translating of FreeBSD fails for v6.0.0 In-Reply-To: <2473504.SxEM7qku3R@dragon.local> References: <2473504.SxEM7qku3R@dragon.local> Message-ID: Hi David, Issue #2853 was just reported with the same error message. See there: https://bitbucket.org/pypy/pypy/issues/2853/build-fails-on-freebsd-112-x64 Armin From nwpierce at gmail.com Sun Jul 1 09:37:10 2018 From: nwpierce at gmail.com (Nathaniel Pierce) Date: Sun, 1 Jul 2018 09:37:10 -0400 Subject: [pypy-dev] bug in PyPy3 context __exit__ handling Message-ID: Please see attached test. Returning True from __exit__ when type is None can break expected program flow. So far, I've found that each of break/continue/return inside a with block is affected. Both with and without '--jit off' PyPy2 is unaffected. Thanks! -Nate -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: test.py Type: text/x-python-script Size: 2095 bytes Desc: not available URL: From armin.rigo at gmail.com Sun Jul 1 16:52:35 2018 From: armin.rigo at gmail.com (Armin Rigo) Date: Sun, 1 Jul 2018 22:52:35 +0200 Subject: [pypy-dev] bug in PyPy3 context __exit__ handling In-Reply-To: References: Message-ID: Hi Nathaniel, On 1 July 2018 at 15:37, Nathaniel Pierce wrote: > Returning True from __exit__ when type is None can break expected program > flow. So far, I've found that each of break/continue/return inside a with > block is affected. Both with and without '--jit off' > > PyPy2 is unaffected. Thanks! This bug must have given very obscure behaviour. Thanks for identifying the cause. Fixed in 0a4016e8a6bc! A bient?t, Armin. From whalenster at gmail.com Mon Jul 16 16:46:17 2018 From: whalenster at gmail.com (Sean Whalen) Date: Mon, 16 Jul 2018 16:46:17 -0400 Subject: [pypy-dev] Why does elasticsearch raise an exception on pypy but not cpython? Message-ID: I have some code that saves data to Elasticsearch. It runs fine in Python 3.5.2 (cpython), but raises an exception when running on pypy 3 6.0.0 (Python 3.5.3). Any ideas why? File "/opt/venvs/parsedmarc/site-packages/parsedmarc/elastic.py", line 366, in save_forensic_report_to_elasticsearch forensic_doc.save()File "/opt/venvs/parsedmarc/site-packages/elasticsearch_dsl/document.py", line 394, in save index=self._get_index(index),File "/opt/venvs/parsedmarc/site-packages/elasticsearch_dsl/document.py", line 138, in _get_index raise ValidationException('You cannot write to a wildcard index.') elasticsearch_dsl.exceptions.ValidationException: You cannot write to a wildcard index I also asked Stack Overflow. You can answer there for internet points. :) https://stackoverflow.com/questions/51368293/why-does-elasticsearch-raise- elasticsearch-dsl-exceptions-validationexception-y -------------- next part -------------- An HTML attachment was scrubbed... URL: From armin.rigo at gmail.com Tue Jul 17 04:00:04 2018 From: armin.rigo at gmail.com (Armin Rigo) Date: Tue, 17 Jul 2018 10:00:04 +0200 Subject: [pypy-dev] Why does elasticsearch raise an exception on pypy but not cpython? In-Reply-To: References: Message-ID: Hi Sean, On 16 July 2018 at 22:46, Sean Whalen wrote: > I have some code that saves data to Elasticsearch. It runs fine in Python > 3.5.2 (cpython), but raises an exception when running on pypy 3 6.0.0 > (Python 3.5.3). Any ideas why? Not out of the box. If you provide some code that we can run and which gives different results, then we can investigate. A bient?t, Armin. From whalenster at gmail.com Tue Jul 17 14:37:17 2018 From: whalenster at gmail.com (Sean Whalen) Date: Tue, 17 Jul 2018 14:37:17 -0400 Subject: [pypy-dev] Why does elasticsearch raise an exception on pypy but not cpython? In-Reply-To: References: Message-ID: Looking at document.py , that exception is only supposed to be raised when a save attempt is made on an index name that contains *. I set the index name using a Meta class as as you can see here , and there is not any * in the index variable. Here's some basic sample code to reproduce the issue: *Note*: you must have an Elasticsearch instance running to reproduce the issue. from elasticsearch_dsl import DocType, Text, connections class _ForensicReportDoc(DocType): class Meta: index = "sample_index" feedback_type = Text() connections.create_connection(hosts=["127.0.0.1"], timeout=20) doc = _ForensicReportDoc(feedback_type="foo") doc.save() On Tue, Jul 17, 2018 at 4:00 AM, Armin Rigo wrote: > Hi Sean, > > On 16 July 2018 at 22:46, Sean Whalen wrote: > > I have some code that saves data to Elasticsearch. It runs fine in Python > > 3.5.2 (cpython), but raises an exception when running on pypy 3 6.0.0 > > (Python 3.5.3). Any ideas why? > > Not out of the box. If you provide some code that we can run and > which gives different results, then we can investigate. > > > A bient?t, > > Armin. > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ahmed.najamansari at gmail.com Tue Jul 17 15:07:52 2018 From: ahmed.najamansari at gmail.com (Najam Ahmed Ansari) Date: Wed, 18 Jul 2018 00:07:52 +0500 Subject: [pypy-dev] Why does elasticsearch raise an exception on pypy but not cpython? In-Reply-To: References: Message-ID: Looking at the exception, I would say there's something up with how elasticsearch_dsl is creating the request to ElasticSearch. If you look at the code where the exception is being raised ( https://github.com/elastic/elasticsearch-dsl-py/blob/master/elasticsearch_dsl/document.py#L138), its done if an asterisk (*) is found in the index name. Maybe try creating an issue on their Github? On Tue, Jul 17, 2018 at 11:37 PM, Sean Whalen wrote: > Looking at document.py > , > that exception is only supposed to be raised when a save attempt is made on > an index name that contains *. > > I set the index name using a Meta class as as you can see here > , > and there is not any * in the index variable. > > Here's some basic sample code to reproduce the issue: > > *Note*: you must have an Elasticsearch instance running to reproduce the > issue. > > from elasticsearch_dsl import DocType, Text, connections > > class _ForensicReportDoc(DocType): > class Meta: > index = "sample_index" > > feedback_type = Text() > > connections.create_connection(hosts=["127.0.0.1"], timeout=20) > > doc = _ForensicReportDoc(feedback_type="foo") > doc.save() > > > > On Tue, Jul 17, 2018 at 4:00 AM, Armin Rigo wrote: > >> Hi Sean, >> >> On 16 July 2018 at 22:46, Sean Whalen wrote: >> > I have some code that saves data to Elasticsearch. It runs fine in >> Python >> > 3.5.2 (cpython), but raises an exception when running on pypy 3 6.0.0 >> > (Python 3.5.3). Any ideas why? >> >> Not out of the box. If you provide some code that we can run and >> which gives different results, then we can investigate. >> >> >> A bient?t, >> >> Armin. >> > > > _______________________________________________ > pypy-dev mailing list > pypy-dev at python.org > https://mail.python.org/mailman/listinfo/pypy-dev > > -- Regards, Najam Ahmed Ansari -------------- next part -------------- An HTML attachment was scrubbed... URL: From armin.rigo at gmail.com Wed Jul 18 16:51:32 2018 From: armin.rigo at gmail.com (Armin Rigo) Date: Wed, 18 Jul 2018 22:51:32 +0200 Subject: [pypy-dev] [PATCH] FreeBSD build fix In-Reply-To: References: Message-ID: Hi David, On 20 May 2018 at 18:39, David CARLIER wrote: > Here a new version of the patch. Sorry for the delay. Added your patch (minus the Makefile because I don't think it's intended). See also https://bitbucket.org/pypy/pypy/issues/2853/build-fails-on-freebsd-11x-x64 . A bient?t, Armin. From hetaofirst at gmail.com Sat Jul 21 02:19:17 2018 From: hetaofirst at gmail.com (ht) Date: Sat, 21 Jul 2018 14:19:17 +0800 Subject: [pypy-dev] How to ptrace pypy stack Message-ID: <5b52d033.1c69fb81.fb8e9.24b4@mx.google.com> Dear friends: I'm trying to use ptrace to profile pypy program, but i can't get the stack or virtual memory address more than file no. But python has a global variable named _PyThreadState_Current, that can help to extracting the thread state, so i wander if pypy has some method to do this. thanks! -------------- next part -------------- An HTML attachment was scrubbed... URL: From armin.rigo at gmail.com Sat Jul 21 02:50:04 2018 From: armin.rigo at gmail.com (Armin Rigo) Date: Sat, 21 Jul 2018 08:50:04 +0200 Subject: [pypy-dev] How to ptrace pypy stack In-Reply-To: <5b52d033.1c69fb81.fb8e9.24b4@mx.google.com> References: <5b52d033.1c69fb81.fb8e9.24b4@mx.google.com> Message-ID: Hi, On 21 July 2018 at 08:19, ht wrote: > I'm trying to use ptrace to profile pypy program, but i can't get the > stack or virtual memory address more than file no. > > But python has a global variable named _PyThreadState_Current, that > can help to extracting the thread state, so i wander if pypy has some method > to do this. thanks! It's not clear to me what you mean. * How do you use ptrace for profiling? Is it even giving timing information? * Can you give an example of how you would use _PyThreadState_Current inside CPython? * What is the link between _PyThreadState_Current and ptrace? Please describe more precisely what you are doing in CPython and why, and then we'll try to think of a way to achieve the same goals. A bient?t, Armin. From armin.rigo at gmail.com Sat Jul 21 02:52:25 2018 From: armin.rigo at gmail.com (Armin Rigo) Date: Sat, 21 Jul 2018 08:52:25 +0200 Subject: [pypy-dev] How to ptrace pypy stack In-Reply-To: References: <5b52d033.1c69fb81.fb8e9.24b4@mx.google.com> Message-ID: Hi again, Ah, found out https://eng.uber.com/pyflame/ . I guess this is what you mean, is that correct? Armin From armin.rigo at gmail.com Sat Jul 21 14:07:16 2018 From: armin.rigo at gmail.com (Armin Rigo) Date: Sat, 21 Jul 2018 20:07:16 +0200 Subject: [pypy-dev] How to ptrace pypy stack In-Reply-To: References: <5b52d033.1c69fb81.fb8e9.24b4@mx.google.com> Message-ID: Hi, On 21 July 2018 at 17:00, tao he wrote: > Yes, I have just read the code of https://eng.uber.com/pyflame/ . And I > try to do it with pypy, but not work. So I have to ask for help. This is more complicated to do in PyPy than in CPython. PyPy has got a JIT, and the JIT does not actually create the frame objects that are found not to be needed. This has been done, however, in "vmprof". "vmprof" is similar to what you're trying to do, as far as I can tell, but it is using an in-process timer instead of using "ptrace". It seems to me like it is simpler anyway: I don't understand why you would use ptrace at all, honestly. ptrace can be useful for profiling a random external process, but if the goal is the profile exactly the CPython (or PyPy) interpreter, then you may as well add code directly inside instead of messing around with ptrace introspecting debugging symbols to recontruct the state. A bient?t, Armin. From hubo at jiedaibao.com Fri Jul 27 06:18:07 2018 From: hubo at jiedaibao.com (hubo) Date: Fri, 27 Jul 2018 18:18:07 +0800 Subject: [pypy-dev] Bug report: AST stage crash in PyPy3.5 Message-ID: <5B5AF15D.1050309@jiedaibao.com>+0A116AB0CF154FFC In PyPy 3.5, the following small piece of code cannot be imported, and causes a SystemError: def test(*a: lambda x: None): pass Stderr: # pypy3 test.py RPython traceback: File "pypy_interpreter.c", line 33969, in BuiltinCode_funcrun_obj File "pypy_module___builtin__.c", line 2705, in compile File "pypy_interpreter.c", line 50963, in PythonAstCompiler__compile_ast File "pypy_interpreter_astcompiler.c", line 1543, in compile_ast File "pypy_interpreter_astcompiler.c", line 5995, in Module_walkabout File "pypy_interpreter_astcompiler.c", line 13362, in PythonCodeGenerator__handle_body File "pypy_interpreter_astcompiler_2.c", line 20473, in PythonCodeGenerator_visit_FunctionDef File "pypy_interpreter_astcompiler_2.c", line 37632, in _visit_function__FunctionCodeGenerator File "pypy_interpreter_astcompiler_2.c", line 61299, in _visit_annotations__pypy_interpreter_astcompiler_1 File "pypy_interpreter_astcompiler_3.c", line 8128, in PythonCodeGenerator__visit_arg_annotation File "pypy_interpreter_astcompiler_2.c", line 22498, in PythonCodeGenerator_visit_Lambda File "pypy_interpreter_astcompiler_2.c", line 35719, in PythonCodeGenerator_sub_scope File "pypy_interpreter_astcompiler.c", line 11371, in PythonCodeGenerator___init__ SystemError: unexpected internal exception (please report a bug): ; internal traceback was dumped to stderr The crash appears when: A varaible argument of a function has an annotation (like *args or **kwargs, normal arguments are not affected), and A lambda expression is used in the annotation Both criterias must be met. This cannot be reproduced on CPython3.5+. Also, Python document says: Parameters may have annotations of the form ?: expression? following the parameter name. Any parameter may have an annotation even those of the form *identifier or **identifier. Functions may have ?return? annotation of the form ?-> expression? after the parameter list. These annotations can be any valid Python expression. The presence of annotations does not change the semantics of a function. The annotation values are available as values of a dictionary keyed by the parameters? names in the __annotations__ attribute of the function object. Mutiple versions of PyPy 3.5 have this bug, including 5.8, 5.10 and 6.0 2018-07-27 hubo -------------- next part -------------- An HTML attachment was scrubbed... URL: From cfbolz at gmx.de Sat Jul 28 08:08:43 2018 From: cfbolz at gmx.de (Carl Friedrich Bolz-Tereick) Date: Sat, 28 Jul 2018 14:08:43 +0200 Subject: [pypy-dev] Bug report: AST stage crash in PyPy3.5 In-Reply-To: <5B5AF15D.1050309@jiedaibao.com> References: <5B5AF15D.1050309@jiedaibao.com> Message-ID: <12e3a33c-c0b3-db7c-68dd-4006880e0c00@gmx.de> Hi! Thanks for the report! I fixed this in 179c172169f1. Cheers, Carl Friedrich On 27/07/18 12:18, hubo wrote: > In PyPy 3.5, the following small piece of code cannot be imported, and > causes a SystemError: > def test(*a: lambda x: None): > ??? pass > Stderr: > # pypy3 test.py > RPython traceback: > ? File "pypy_interpreter.c", line 33969, in BuiltinCode_funcrun_obj > ? File "pypy_module___builtin__.c", line 2705, in compile > ? File "pypy_interpreter.c", line 50963, in PythonAstCompiler__compile_ast > ? File "pypy_interpreter_astcompiler.c", line 1543, in compile_ast > ? File "pypy_interpreter_astcompiler.c", line 5995, in Module_walkabout > ? File "pypy_interpreter_astcompiler.c", line 13362, in > PythonCodeGenerator__handle_body > ? File "pypy_interpreter_astcompiler_2.c", line 20473, in > PythonCodeGenerator_visit_FunctionDef > ? File "pypy_interpreter_astcompiler_2.c", line 37632, in > _visit_function__FunctionCodeGenerator > ? File "pypy_interpreter_astcompiler_2.c", line 61299, in > _visit_annotations__pypy_interpreter_astcompiler_1 > ? File "pypy_interpreter_astcompiler_3.c", line 8128, in > PythonCodeGenerator__visit_arg_annotation > ? File "pypy_interpreter_astcompiler_2.c", line 22498, in > PythonCodeGenerator_visit_Lambda > ? File "pypy_interpreter_astcompiler_2.c", line 35719, in > PythonCodeGenerator_sub_scope > ? File "pypy_interpreter_astcompiler.c", line 11371, in > PythonCodeGenerator___init__ > SystemError: unexpected internal exception (please report a bug): > ; internal traceback was dumped to stderr > The crash appears when: > > 1. A varaible argument of a function has an annotation (like *args or > **kwargs, normal arguments are not affected), and > 2. A lambda expression is used in the annotation > > Both criterias must be met. > This cannot be reproduced on CPython3.5+. Also, Python document says: > > Parameters may have annotations of the form ?|:expression|? > following the parameter name. Any parameter may have an annotation > even those of the form|*identifier|or|**identifier|. Functions may > have ?return? annotation of the form ?|->expression|? after the > parameter list. These annotations can be any valid Python > expression. The presence of annotations does not change the > semantics of a function. The annotation values are available as > values of a dictionary keyed by the parameters? names in > the|__annotations__|attribute of the function object. > > Mutiple versions of PyPy 3.5 have this bug, ?including 5.8, 5.10 and 6.0 > 2018-07-27 > ------------------------------------------------------------------------ > hubo > > > _______________________________________________ > pypy-dev mailing list > pypy-dev at python.org > https://mail.python.org/mailman/listinfo/pypy-dev >