Skip to content

Commit 5d88da3

Browse files
author
Anselm Kruis
committed
merge 3.4-slp (Stackless python#123)
2 parents f568fd7 + 2619d22 commit 5d88da3

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

Stackless/changelog.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ What's New in Stackless 3.X.X?
99

1010
*Release date: 20XX-XX-XX*
1111

12+
- https://bitbucket.org/stackless-dev/stackless/issues/123
13+
Fix a rare assertion violation during interpreter shutdown with active
14+
daemon threads.
15+
1216
- https://bitbucket.org/stackless-dev/stackless/issues/122
1317
Disable the C-stack cache, if Py_REF_DEBUG is defined. The cache causes false
1418
block leak errors from the test suite. The performance penalty is irrelevant in

Stackless/module/taskletobject.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,12 @@ slp_current_remove(void)
4646
PyThreadState *ts = PyThreadState_GET();
4747
PyTaskletObject **chain = &ts->st.current, *ret;
4848

49-
/* make sure tasklet belongs to this thread */
50-
assert((*chain)->cstate->tstate == ts);
49+
/* Make sure that the tasklet belongs to this thread.
50+
* During interpreter shutdown '(*chain)->cstate->tstate' may be already NULL.
51+
* See function slp_kill_tasks_with_stacks() in stacklesseval.c
52+
*/
53+
assert((*chain)->cstate->tstate == ts ||
54+
(*chain)->cstate->tstate == NULL);
5155

5256
--ts->st.runcount;
5357
assert(ts->st.runcount >= 0);

0 commit comments

Comments
 (0)