[issue46110] compile("-"*3000000 + "4", '', mode) causes hard crash

2022-01-10 Thread STINNER Victor
Change by STINNER Victor : -- nosy: -vstinner ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue46110] compile("-"*3000000 + "4", '', mode) causes hard crash

2022-01-08 Thread Guido van Rossum
Guido van Rossum added the comment: Yup. All better: https://speed.python.org/timeline/#/?exe=12=python_startup=1=50=off=on=on -- ___ Python tracker ___

[issue46110] compile("-"*3000000 + "4", '', mode) causes hard crash

2022-01-08 Thread Guido van Rossum
Guido van Rossum added the comment: To close the loop, setuptools 60.4.0 should fix this, see https://github.com/pypa/setuptools/pull/3009. -- ___ Python tracker ___

[issue46110] compile("-"*3000000 + "4", '', mode) causes hard crash

2022-01-05 Thread STINNER Victor
STINNER Victor added the comment: If the issue is about how pyperformance creates its virtual environment (how setuptools is installed), I suggest to continue discussion the issue in pyperformance: https://github.com/python/pyperformance/issues/ ;-) --

[issue46110] compile("-"*3000000 + "4", '', mode) causes hard crash

2022-01-04 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: I did a run of pyperformance manually forcing setuptools<60.0 and another with setuptools>=60.0 I can reproduce the timing difference. I assume we can therefore close this issue and maybe open another one thinking about how to deal with the

[issue46110] compile("-"*3000000 + "4", '', mode) causes hard crash

2022-01-04 Thread Guido van Rossum
Guido van Rossum added the comment: More data. On my Mac, with SETUPTOOLS_USE_DISTUTILS=stdlib, using -X importtime I see the following extra modules being imported: import time: 278 |278 | types import time: 112 |112 | _operator import time:

[issue46110] compile("-"*3000000 + "4", '', mode) causes hard crash

2022-01-04 Thread Guido van Rossum
Guido van Rossum added the comment: I'm still wondering why speed.python.org showed such a slowdown, and how we can revert that. Here's a new theory. Thanks to an investigation I did together with Eric, I now suspect that the release of setuptools 60.0.0 on Dec 19 is a smoking gun.

[issue46110] compile("-"*3000000 + "4", '', mode) causes hard crash

2022-01-03 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: > I presume you mean > "it is very very *likely* that there is no actual regression" Yes, sorry, that's what I meant :) > This shouldn't hold up releases Cool, we will proceed with 3.9.10 and 3.11.0a3 tomorrow. --

[issue46110] compile("-"*3000000 + "4", '', mode) causes hard crash

2022-01-03 Thread Guido van Rossum
Guido van Rossum added the comment: "is very very unlike that there is no actual regression" I presume you meant "it is very very *likely* that there is no actual regression" This shouldn't hold up releases, but (having spent months trying to improve startup speed) I would still like to

[issue46110] compile("-"*3000000 + "4", '', mode) causes hard crash

2022-01-03 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: At thing at this point we can confidently say that is very very unlike that there is no actual regression. What's going on with the performance servers is something I still cannot explain. I at least can confirm the servers system packages were not

[issue46110] compile("-"*3000000 + "4", '', mode) causes hard crash

2022-01-03 Thread Łukasz Langa
Łukasz Langa added the comment: (that's on M1 Macbook Pro on macOS Monterey) -- ___ Python tracker ___ ___ Python-bugs-list mailing

[issue46110] compile("-"*3000000 + "4", '', mode) causes hard crash

2022-01-03 Thread Łukasz Langa
Łukasz Langa added the comment: I ran all benchmarks on installed optimized framework builds of 3.9 with the change (-a) and with the revert (-revert). It shows no change: ❯ ./python3.9 -m pyperf compare_to /Volumes/RAMDisk/py39* 2to3: Mean +- std dev: [py39-a] 724 ms +- 6 ms -> [py39-revert]

[issue46110] compile("-"*3000000 + "4", '', mode) causes hard crash

2022-01-03 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: New changeset dd6c35761a4cd417e126a2d51dd0b89c8a30e5de by Pablo Galindo Salgado in branch 'main': bpo-46110: Restore commit e9898bf153d26059261ffef11f7643ae991e2a4c https://github.com/python/cpython/commit/dd6c35761a4cd417e126a2d51dd0b89c8a30e5de

[issue46110] compile("-"*3000000 + "4", '', mode) causes hard crash

2022-01-03 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: https://speed.python.org/timeline/#/?exe=12=python_startup=4=50=off=on=on also doesn't show any difference with the revert -- ___ Python tracker

[issue46110] compile("-"*3000000 + "4", '', mode) causes hard crash

2022-01-03 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: I ran the benchmarks machines with the revert and seems that it doesn't go back to the previous timing: https://speed.python.org/timeline/#/?exe=12=python_startup=1=50=off=on=on (check last data point for

[issue46110] compile("-"*3000000 + "4", '', mode) causes hard crash

2022-01-03 Thread Guido van Rossum
Guido van Rossum added the comment: I wrote a tiny script that calls compile() on raw bytes read from some source file, does this 100 times, and reports the total time. I tested the script with Lib/pydoc_data/topics.py (which happens to be the largest source file in the CPython repo, but

[issue46110] compile("-"*3000000 + "4", '', mode) causes hard crash

2022-01-03 Thread Pablo Galindo Salgado
Change by Pablo Galindo Salgado : -- pull_requests: +28579 pull_request: https://github.com/python/cpython/pull/30366 ___ Python tracker ___

[issue46110] compile("-"*3000000 + "4", '', mode) causes hard crash

2022-01-03 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: New changeset 9d35dedc5e7e940b639230fba93c763bd9f19c09 by Pablo Galindo Salgado in branch 'main': Revert "bpo-46110: Add a recursion check to avoid stack overflow in the PEG parser (GH-30177)" (GH-30363)

[issue46110] compile("-"*3000000 + "4", '', mode) causes hard crash

2022-01-03 Thread Pablo Galindo Salgado
Change by Pablo Galindo Salgado : -- pull_requests: +28577 stage: resolved -> patch review pull_request: https://github.com/python/cpython/pull/30363 ___ Python tracker ___

[issue46110] compile("-"*3000000 + "4", '', mode) causes hard crash

2022-01-03 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: > I propose a test: revert the PR and see if speed.Python.org shows a speedup back to the previous number.-- Ok, let's do that and see what happens -- ___ Python tracker

[issue46110] compile("-"*3000000 + "4", '', mode) causes hard crash

2022-01-03 Thread Guido van Rossum
Guido van Rossum added the comment: I propose a test: revert the PR and see if speed.Python.org shows a speedup back to the previous number.-- --Guido (mobile) -- ___ Python tracker

[issue46110] compile("-"*3000000 + "4", '', mode) causes hard crash

2022-01-02 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: > Maybe something unrelated changed on the benchmark machines? Very unlikely, it happened on two separate machines with different distributions and nothing was updated in the machines that I can see. Both use a configuration file for pyperformance

[issue46110] compile("-"*3000000 + "4", '', mode) causes hard crash

2022-01-02 Thread Guido van Rossum
Guido van Rossum added the comment: Maybe something unrelated changed on the benchmark machines? (Like installing a new version of pyperformance???) Though it happened across both benchmark machines. What configuration and flags are being used to run the benchmark suite on that machine?

[issue46110] compile("-"*3000000 + "4", '', mode) causes hard crash

2022-01-02 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: Ran pyperformance with PGO/LTO CPU-isol on my Linux box and I cannot reproduce either: ❯ pyperf compare_to json/* --table --table-format=md -G | Benchmark | 2021-12-20_10-23-master-6ca78affc802 | 2021-12-20_15-43-master-e9898bf153d2 |

[issue46110] compile("-"*3000000 + "4", '', mode) causes hard crash

2022-01-02 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: > Does python_startup benchmark start with all modules parsed and __pycache__d, > or with no cache, so it includes the normally one-time parse time? I don't know what pyperf does with the cache (adding Victor as maybe he knowns). -- nosy:

[issue46110] compile("-"*3000000 + "4", '', mode) causes hard crash

2022-01-02 Thread Terry J. Reedy
Terry J. Reedy added the comment: Does python_startup benchmark start with all modules parsed and __pycache__d, or with no cache, so it includes the normally one-time parse time? -- ___ Python tracker

[issue46110] compile("-"*3000000 + "4", '', mode) causes hard crash

2022-01-02 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: I am not able to reproduce on Linux either, with pyperformance or manual testing in the CLI. Interestingle, this shows up in both machines: https://speed.python.org/timeline/#/?exe=12=python_startup=1=50=off=on=on

[issue46110] compile("-"*3000000 + "4", '', mode) causes hard crash

2022-01-02 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: This are my results running directly the pyperformance run script (https://github.com/python/pyperformance/blob/main/pyperformance/data-files/benchmarks/bm_python_startup/run_benchmark.py) with and without the fix (both PGO/LTO):

[issue46110] compile("-"*3000000 + "4", '', mode) causes hard crash

2022-01-02 Thread Guido van Rossum
Guido van Rossum added the comment: Maybe it's Linux specific? I managed to run pyperformance and got this: ### python_startup ### Mean +- std dev: 23.2 ms +- 0.8 ms -> 23.4 ms +- 1.2 ms: 1.01x slower Not significant Note, I am not dismissing the report -- in fact it looks quite bad. But I

[issue46110] compile("-"*3000000 + "4", '', mode) causes hard crash

2022-01-02 Thread Guido van Rossum
Guido van Rossum added the comment: So if I understand the speed.python.org results correctly, the time to run `python -c pass` went way up, but the time for `python -S -c pass` did not go up significantly. Unfortunately the only machine I have access to is a Mac, and I cannot repro this

[issue46110] compile("-"*3000000 + "4", '', mode) causes hard crash

2022-01-02 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: > Let me have a look. May take a day, okay?-- Absolutely! There is no rush as the only close release IIRC is another alpha of 3.11. -- ___ Python tracker

[issue46110] compile("-"*3000000 + "4", '', mode) causes hard crash

2022-01-02 Thread Guido van Rossum
Guido van Rossum added the comment: Let me have a look. May take a day, okay?-- --Guido (mobile) -- ___ Python tracker ___ ___

[issue46110] compile("-"*3000000 + "4", '', mode) causes hard crash

2022-01-02 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: Guido, Eric, what are your thoughts here? The fix that I merged works by limiting the maximum recursion but seems that incrementing the recursion counter on every parser call makes quite a lot of impact on startup. Unfortunately if we revert the

[issue46110] compile("-"*3000000 + "4", '', mode) causes hard crash

2022-01-02 Thread Pablo Galindo Salgado
Change by Pablo Galindo Salgado : -- nosy: +lukasz.langa versions: +Python 3.11, Python 3.9 ___ Python tracker ___ ___

[issue46110] compile("-"*3000000 + "4", '', mode) causes hard crash

2022-01-02 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: >It seems that the PR was merged without discussion about 85% regression in >python_startup benchmark Ugh, that's quite bad. We measured performance impact in general and that was quite acceptable but seems that for startup this is quite sensitive

[issue46110] compile("-"*3000000 + "4", '', mode) causes hard crash

2022-01-02 Thread Nikita Kniazev
Nikita Kniazev added the comment: > I made a draft PR here: > > https://github.com/python/cpython/pull/30177 > > to fix the issue. But we should benchmark and evaluate it before deciding > anything. It seems that the PR was merged without discussion about 85% regression in python_startup

[issue46110] compile("-"*3000000 + "4", '', mode) causes hard crash

2021-12-20 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: New changeset e5cf31d3c2b30d12f238c6ab26d15855eefb2a8a by Pablo Galindo Salgado in branch '3.9': [3.9] bpo-46110: Add a recursion check to avoid stack overflow in the PEG parser (GH-30177) (#30215)

[issue46110] compile("-"*3000000 + "4", '', mode) causes hard crash

2021-12-20 Thread Pablo Galindo Salgado
Change by Pablo Galindo Salgado : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___

[issue46110] compile("-"*3000000 + "4", '', mode) causes hard crash

2021-12-20 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: New changeset dc73199a212a44553578eb4952631e5ba9e5f292 by Pablo Galindo Salgado in branch '3.10': [3.10] bpo-46110: Add a recursion check to avoid stack overflow in the PEG parser (GH-30177) (GH-30214)

[issue46110] compile("-"*3000000 + "4", '', mode) causes hard crash

2021-12-20 Thread Pablo Galindo Salgado
Change by Pablo Galindo Salgado : -- pull_requests: +28436 pull_request: https://github.com/python/cpython/pull/30215 ___ Python tracker ___

[issue46110] compile("-"*3000000 + "4", '', mode) causes hard crash

2021-12-20 Thread Pablo Galindo Salgado
Change by Pablo Galindo Salgado : -- pull_requests: +28435 pull_request: https://github.com/python/cpython/pull/30214 ___ Python tracker ___

[issue46110] compile("-"*3000000 + "4", '', mode) causes hard crash

2021-12-20 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: New changeset e9898bf153d26059261ffef11f7643ae991e2a4c by Pablo Galindo Salgado in branch 'main': bpo-46110: Add a recursion check to avoid stack overflow in the PEG parser (GH-30177)

[issue46110] compile("-"*3000000 + "4", '', mode) causes hard crash

2021-12-17 Thread Pablo Galindo Salgado
Change by Pablo Galindo Salgado : -- keywords: +patch pull_requests: +28395 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30177 ___ Python tracker

[issue46110] compile("-"*3000000 + "4", '', mode) causes hard crash

2021-12-17 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: I made a draft PR here: https://github.com/python/cpython/pull/30177 to fix the issue. But we should benchmark and evaluate it before deciding anything. -- ___ Python tracker

[issue46110] compile("-"*3000000 + "4", '', mode) causes hard crash

2021-12-17 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: I worked in the past in a refactor of the math based rules (https://github.com/python/cpython/pull/20696/files) that could prevent **this** particular example, but others could still make the parser crash by stack overflow --

[issue46110] compile("-"*3000000 + "4", '', mode) causes hard crash

2021-12-17 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: This is a known issue for recursive descendent parsers. The only thing we can do here is somehow limit the maximum stack depth of the C stack, but that can: * Slow down the parser. * Limit valid expressions that otherwise won't segfault. * Still don't

[issue46110] compile("-"*3000000 + "4", '', mode) causes hard crash

2021-12-17 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: This is a stack overflow in the parser, unfortunately, which unfortunately is very difficult to defend against. -- ___ Python tracker

[issue46110] compile("-"*3000000 + "4", '', mode) causes hard crash

2021-12-17 Thread Terry J. Reedy
Terry J. Reedy added the comment: Windows, IDLE, 3.10.1: compile("-"*300 + "4", '', mode) crashes execution process for any of 'exec', 'eval', 'single'. #42609 is also about 'too high' string multiplication with new compilet, though the exact breaking point in crash dumps seems