[issue27736] repeated Py_Initialize/PyRun_SimpleString/Py_Finalize segfaults

2016-08-15 Thread Ned Deily
Ned Deily added the comment: Excellent! Thanks for digging into that. Increasing the iterations seems to work fine within the (understandable) limitations of the existing embedded tests, e.g. only work from a source tree build (not an installed build nor from a separate build directory)

[issue27736] repeated Py_Initialize/PyRun_SimpleString/Py_Finalize segfaults

2016-08-15 Thread Roundup Robot
Roundup Robot added the comment: New changeset 4f69626fd923 by Ned Deily in branch 'default': Issue #27736: Improve the existing embedded interpreter init/fini test https://hg.python.org/cpython/rev/4f69626fd923 -- ___ Python tracker

[issue27736] repeated Py_Initialize/PyRun_SimpleString/Py_Finalize segfaults

2016-08-15 Thread Xiang Zhang
Xiang Zhang added the comment: We don't have to change Lib/test/test_capi.py. It has already got a repeated init and fini test[1]. All we need to do is increase the loop number[2]. I have tried with 15, the test case fails reliably. And with the previous patch applied, it won't fail. [1]

[issue27736] repeated Py_Initialize/PyRun_SimpleString/Py_Finalize segfaults

2016-08-15 Thread Ned Deily
Ned Deily added the comment: I've applied the patch for 3.6.0a4 so the immediate issue is fixed. I wonder if it would be worthwhile adapting Simon's test case to add to the embedding test cases in Lib/test/test_capi.py. I'm going to leave the issue open for a while in case someone is

[issue27736] repeated Py_Initialize/PyRun_SimpleString/Py_Finalize segfaults

2016-08-15 Thread Roundup Robot
Roundup Robot added the comment: New changeset a95d98086621 by Ned Deily in branch 'default': Issue #27736: Prevent segfault after interpreter re-initialization due https://hg.python.org/cpython/rev/a95d98086621 -- nosy: +python-dev ___ Python

[issue27736] repeated Py_Initialize/PyRun_SimpleString/Py_Finalize segfaults

2016-08-15 Thread Brett Cannon
Brett Cannon added the comment: Patch LGTM. -- assignee: brett.cannon -> ned.deily stage: patch review -> commit review ___ Python tracker ___

[issue27736] repeated Py_Initialize/PyRun_SimpleString/Py_Finalize segfaults

2016-08-13 Thread Ned Deily
Ned Deily added the comment: Thanks for the patch. FWIW, that does seem to solve the crash. Brett, look good to you? If so, I can push the fix. -- stage: needs patch -> patch review ___ Python tracker

[issue27736] repeated Py_Initialize/PyRun_SimpleString/Py_Finalize segfaults

2016-08-13 Thread Xiang Zhang
Xiang Zhang added the comment: Try Simon's snippet I think I am right. With the current code, the result is: 1..1 Segmentation fault (core dumped) With Py_INCREF: 1..1 ok 1 - was able to loop 100 times I upload the working patch. -- keywords: +patch Added file:

[issue27736] repeated Py_Initialize/PyRun_SimpleString/Py_Finalize segfaults

2016-08-13 Thread Xiang Zhang
Xiang Zhang added the comment: It looks to me from the traceback Simon given that DirEntryType's dealloc function is called. From the code, shouldn't we Py_INCREF DirEntryType before PyModule_AddObject? -- nosy: +xiang.zhang ___ Python tracker

[issue27736] repeated Py_Initialize/PyRun_SimpleString/Py_Finalize segfaults

2016-08-12 Thread Brett Cannon
Brett Cannon added the comment: The revision that Ned found only changed posixmodule.c by adding PyModule_AddObject(m, "DirEntry", (PyObject *)); at the end of the module initializer. Only thing I can think of is it needs to go into the `if (!initialized)` block:

[issue27736] repeated Py_Initialize/PyRun_SimpleString/Py_Finalize segfaults

2016-08-12 Thread Ned Deily
Ned Deily added the comment: Thanks for the good test, Simon. Bisection points to b841972ed0bd for Issue27038 as the culprit here. (It was pushed between 3.6.0a2 and a3.) Brett, Jelle, can you please take a look at this? I'm going to keep it as a Release Blocker for now. --

[issue27736] repeated Py_Initialize/PyRun_SimpleString/Py_Finalize segfaults

2016-08-12 Thread Gregory P. Smith
Changes by Gregory P. Smith : -- nosy: +ned.deily priority: normal -> release blocker ___ Python tracker ___

[issue27736] repeated Py_Initialize/PyRun_SimpleString/Py_Finalize segfaults

2016-08-11 Thread Simon McVittie
Simon McVittie added the comment: This might be a duplicate of https://bugs.python.org/issue24853 but there wasn't enough detail on that bug for me to be sure. -- ___ Python tracker

[issue27736] repeated Py_Initialize/PyRun_SimpleString/Py_Finalize segfaults

2016-08-11 Thread Simon McVittie
New submission from Simon McVittie: dbus-python has a regression test for https://bugs.freedesktop.org/show_bug.cgi?id=23831 which repeatedly initializes the interpreter, imports dbus and finalizes the interpreter. This test passes in Python up to 3.5, but is failing under Python 3.6 nightly