You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Feb 13, 2025. It is now read-only.
Since Stackless 3.2, the module _stackless is initialized late. Part of this initialization is the call of slp_init_bombtype().
If a tasklet (including the main-tasklet) ends with an exception, a bomb is created, that encapsulates the exception (function PyObject * slp_curexc_to_bomb(void) in Stackless/module/scheduling.c). If the exception is a MemoryError, slp_curexc_to_bomb() does not allocate the bomb-object, but uses a static bomb object, that was allocated during the initialization of the bomb-type in slp_init_bombtype(). Now, if module _stackless hasn't been initialized, the out-of-memory-bomb hasn't been allocated and a NULL-pointer access happens.
I discovered the problem, because the newly introduced (d5d7954) test case test.test_exceptions.ExceptionTests.test_memory_error_in_PyErr_PrintEx failed.
Fix: always initialize the bomb type. And add an assertion to make sure, that the type got initialized.
The text was updated successfully, but these errors were encountered:
Since Stackless 3.2, the module
_stackless
is initialized late. Part of this initialization is the call ofslp_init_bombtype()
.If a tasklet (including the main-tasklet) ends with an exception, a bomb is created, that encapsulates the exception (function PyObject * slp_curexc_to_bomb(void) in Stackless/module/scheduling.c). If the exception is a MemoryError,
slp_curexc_to_bomb()
does not allocate the bomb-object, but uses a static bomb object, that was allocated during the initialization of the bomb-type inslp_init_bombtype()
. Now, if module_stackless
hasn't been initialized, the out-of-memory-bomb hasn't been allocated and a NULL-pointer access happens.I discovered the problem, because the newly introduced (d5d7954) test case
test.test_exceptions.ExceptionTests.test_memory_error_in_PyErr_PrintEx
failed.Fix: always initialize the bomb type. And add an assertion to make sure, that the type got initialized.
The text was updated successfully, but these errors were encountered: