[issue40413] Py_RunMain() crashes on subsequence call

2021-10-13 Thread Gregory Szorc


Gregory Szorc  added the comment:

I can't remember the circumstances of me reproducing this. The added test 
demonstrating that the interpreter can be initialized/finalized within a single 
process seems like a reasonable solution to ensure this is supported.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40413] Py_RunMain() crashes on subsequence call

2021-09-20 Thread Łukasz Langa

Łukasz Langa  added the comment:


New changeset 29e431419a0c23340099a9cd8cf23ec9c7788879 by Miss Islington (bot) 
in branch '3.9':
bpo-40413: test_embed tests calling Py_RunMain() multiple times (GH-28466) 
(GH-28471)
https://github.com/python/cpython/commit/29e431419a0c23340099a9cd8cf23ec9c7788879


--
nosy: +lukasz.langa

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40413] Py_RunMain() crashes on subsequence call

2021-09-20 Thread miss-islington


miss-islington  added the comment:


New changeset 3d16fc90ce36acaa846ee88bdd124f84d49395b3 by Miss Islington (bot) 
in branch '3.10':
bpo-40413: test_embed tests calling Py_RunMain() multiple times (GH-28466)
https://github.com/python/cpython/commit/3d16fc90ce36acaa846ee88bdd124f84d49395b3


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40413] Py_RunMain() crashes on subsequence call

2021-09-20 Thread miss-islington


Change by miss-islington :


--
pull_requests: +26870
pull_request: https://github.com/python/cpython/pull/28471

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40413] Py_RunMain() crashes on subsequence call

2021-09-20 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 3.0 -> 4.0
pull_requests: +26869
pull_request: https://github.com/python/cpython/pull/28470

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40413] Py_RunMain() crashes on subsequence call

2021-09-20 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 5e2c32e08ed77081cabd9d51f0589f81c1572732 by Victor Stinner in 
branch 'main':
bpo-40413: test_embed tests calling Py_RunMain() multiple times (GH-28466)
https://github.com/python/cpython/commit/5e2c32e08ed77081cabd9d51f0589f81c1572732


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40413] Py_RunMain() crashes on subsequence call

2021-09-20 Thread STINNER Victor


STINNER Victor  added the comment:

> I'm attempting to perform the following actions multiple times in a single 
> process with CPython 3.8.2:

test_embed already has test_repeated_init_and_inittab() test which runs 
Py_InitializeFromConfig() + Py_RunMain() multiple times.

I wrote an even more explicit test in PR 28466. I tested it manually on Python 
3.9, 3.10 and 3.11: it works as expected.

Python 3.8 no longer accepts bugfixes. I close the issue as outdated.

Gregory: if you can still reproduce your issue on a supported Python version, 
please provide a reproducer.
devguide.python.org/#status-of-python-branches

--
resolution:  -> out of date
stage:  -> resolved
status: open -> closed
Added file: https://bugs.python.org/file50288/patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40413] Py_RunMain() crashes on subsequence call

2021-09-20 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +26865
status: pending -> open
pull_request: https://github.com/python/cpython/pull/28466

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40413] Py_RunMain() crashes on subsequence call

2021-09-19 Thread Irit Katriel


Irit Katriel  added the comment:

Is there anything to do on this issue? Gregory, perhaps you could report the 
crashes you see so they can be evaluated?

--
nosy: +iritkatriel
status: open -> pending

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40413] Py_RunMain() crashes on subsequence call

2020-04-28 Thread STINNER Victor


STINNER Victor  added the comment:

I never tried, but I expect that the following pattern is fine:

for (i=0; i<5; i++) {
Py_Initialize(); Py_RunMain()
}

Maybe Py_RunMain() must fail with a fatal error if it's called when Python is 
not initialized.

Since Py_RunMain() finalizes Python, you cannot call it multiple times without 
calling Py_Initialize() between calls.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40413] Py_RunMain() crashes on subsequence call

2020-04-27 Thread Gregory Szorc


Gregory Szorc  added the comment:

Actually, I can reproduce the crash without Py_RunMain(). So I don't think the 
crash is related to the additional cleanup that Py_RunMain() does in addition 
to Py_FinalizeEx().

But I'd like to keep this issue open to track the original question about 
expected behavior.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40413] Py_RunMain() crashes on subsequence call

2020-04-27 Thread Gregory Szorc


New submission from Gregory Szorc :

I'm attempting to perform the following actions multiple times in a single 
process with CPython 3.8.2:

1) Initialize an interpreter using the PEP-587 APIs.
2) Call Py_RunMain() (which finalizes the interpreter).

However, I've encountered at least 2 crashes due to use-after-free or unchecked 
NULL access (due to apparent state getting funky).

Are multiple interpreters / Py_RunMain() calls in a single process supported? 
Should I file bugs for all of the crashes I encounter?

--
components: C API
messages: 367479
nosy: indygreg, vstinner
priority: normal
severity: normal
status: open
title: Py_RunMain() crashes on subsequence call
type: crash
versions: Python 3.8, Python 3.9

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com