[issue7544] Fatal error on thread creation in low memory condition

2010-03-21 Thread STINNER Victor
STINNER Victor added the comment: > Commited: r78638 (trunk) Backport done: r79199 (2.6). -- resolution: -> fixed status: open -> closed ___ Python tracker ___

[issue7544] Fatal error on thread creation in low memory condition

2010-01-31 Thread STINNER Victor
Changes by STINNER Victor : Removed file: http://bugs.python.org/file15888/thread_prealloc_pystate-3.patch ___ Python tracker ___ ___ Python-bu

[issue7544] Fatal error on thread creation in low memory condition

2010-01-31 Thread STINNER Victor
STINNER Victor added the comment: > PyThreadState_Prealloc and PyThreadState_Init should (...) be prefixed with > an underscore (...) done > _PyThreadState_New should be static (...) so something like "new_threadstate" done > the last change ("Py_InitializeEx() calls _PyGILState_Init() befo

[issue7544] Fatal error on thread creation in low memory condition

2010-01-30 Thread Antoine Pitrou
Antoine Pitrou added the comment: Oh, and besides, you can use the -R option to regrtest to find out if there are any reference leaks (e.g. "-R 3:2:"). -- ___ Python tracker ___

[issue7544] Fatal error on thread creation in low memory condition

2010-01-30 Thread Antoine Pitrou
Antoine Pitrou added the comment: I didn't test the patch but some comments: - PyThreadState_Prealloc and PyThreadState_Init should probably be prefixed with an underscore, because there's no use for them outside of the interpreter - _PyThreadState_New should be static. Besides, static function

[issue7544] Fatal error on thread creation in low memory condition

2010-01-21 Thread STINNER Victor
STINNER Victor added the comment: Sum up of my patch: * it pass all test_thread*.py tests (tested with in pydebug mode) * it preallocates the thread state in the parent thread to be able to raise an error with PyErr_NoMemory() instead of Py_FatalError() * PyThreadState_Prealloc() doesn't ca

[issue7544] Fatal error on thread creation in low memory condition

2010-01-14 Thread STINNER Victor
Changes by STINNER Victor : Removed file: http://bugs.python.org/file15848/thread_prealloc_pystate-2.patch ___ Python tracker ___ ___ Python-bu

[issue7544] Fatal error on thread creation in low memory condition

2010-01-14 Thread STINNER Victor
Changes by STINNER Victor : Removed file: http://bugs.python.org/file15805/thread_prealloc_pystate.patch ___ Python tracker ___ ___ Python-bugs

[issue7544] Fatal error on thread creation in low memory condition

2010-01-14 Thread STINNER Victor
Changes by STINNER Victor : Added file: http://bugs.python.org/file15888/thread_prealloc_pystate-3.patch ___ Python tracker ___ ___ Python-bugs

[issue7544] Fatal error on thread creation in low memory condition

2010-01-13 Thread STINNER Victor
STINNER Victor added the comment: > If initsite() calls PyGILState_Ensure() (...) Note: I was using gdb to track a bug on a debug build (--with-pydebug). I used "pyo" macro which calls _PyObject_Dump(), and _PyObject_Dump() calls PyGILState_Ensure() => assertion error. -- __

[issue7544] Fatal error on thread creation in low memory condition

2010-01-13 Thread STINNER Victor
STINNER Victor added the comment: Another problem with my patch! If initsite() calls PyGILState_Ensure(): assert(autoInterpreterState) fails because autoInterpreterState is NULL. _PyGILState_Init() have to be called before initsite(). I don't know where it should be called exactly. Why not ju

[issue7544] Fatal error on thread creation in low memory condition

2010-01-12 Thread STINNER Victor
STINNER Victor added the comment: > Running the tests in debug mode gives the following error: > ... Fatal Python error: Invalid thread state for this thread I tried all Lib/test/test_thread*py, but not in debug mode :-/ The problem is here: PyThreadState_New() -> _PyGILState_NoteThreadState()

[issue7544] Fatal error on thread creation in low memory condition

2010-01-12 Thread Antoine Pitrou
Antoine Pitrou added the comment: Running the tests in debug mode gives the following error: test_3_join_in_forked_from_thread (test.test_threading.ThreadJoinOnShutdown) ... Fatal Python error: Invalid thread state for this thread [21851 refs] FAIL [snip] =

[issue7544] Fatal error on thread creation in low memory condition

2010-01-10 Thread STINNER Victor
STINNER Victor added the comment: > I'm not sure about autoTLSkey value (...) After some tests (printf fun), it looks ok. -- There is another problem in _testcapi: test_thread_state() calls directly PyThread_start_new_thread() and the thread function calls PyGILState_Ensure(). PyGILState_En

[issue7544] Fatal error on thread creation in low memory condition

2010-01-10 Thread STINNER Victor
STINNER Victor added the comment: > The patch looks good I'm not sure about autoTLSkey value. PyThreadState_New() calls _PyGILState_NoteThreadState() which checks that autoTLSkey is not zero, but I don't know if autoTLSkey have the right value with my preallocation patch. -- ___

[issue7544] Fatal error on thread creation in low memory condition

2010-01-10 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: The patch looks good; the line tstate->thread_id = PyThread_get_thread_ident(); is needed because the tstate is created in the main thread, but used in another thread. -- nosy: +amaury.forgeotdarc ___ Pyth

[issue7544] Fatal error on thread creation in low memory condition

2010-01-09 Thread STINNER Victor
STINNER Victor added the comment: Here I come with a patch! nirai idea was the good one: prealloc PyThreadState before creating the thread. Raise a MemoryError if the allocation fail, instead of raising a *fatal* Python error. Patch is quite simple and allow better error handling. --

[issue7544] Fatal error on thread creation in low memory condition

2009-12-27 Thread Nir Aides
Nir Aides added the comment: Memory can be pre-allocated by thread_PyThread_start_new_thread() before thread is spawned. -- ___ Python tracker ___ __

[issue7544] Fatal error on thread creation in low memory condition

2009-12-27 Thread Nir Aides
Changes by Nir Aides : -- nosy: +nirai ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/ma

[issue7544] Fatal error on thread creation in low memory condition

2009-12-23 Thread STINNER Victor
Changes by STINNER Victor : -- title: multiprocessing.Pool(): Fatal Python error: PyEval_AcquireThread: NULL new thread state -> Fatal error on thread creation in low memory condition ___ Python tracker ___