Issue 5160: Intermittant segmentation fault with ctrl-c (threads and queues) (original) (raw)
little more info:
If you create a Queue in the main thread and pass this to each worker thread, it works fine.
If you create the Queue inside the worker thread and then pass it to a new thread, it can crash.
when it crashes, you get an immediate core dump with no error messages or stack trace.
This happens very intermittently but can be reproduced easily.
Here is stack trace.
PyEval_EvalFrameEx(_frame * 0x00a62060, int 83) line 2841 + 6 bytes fast_function(_object * 0x00000000, _object * * * 0x00fbfa98, int 1, int 1, int 9870576) line 3946 call_function(_object * * * 0x00fbfa98, int 0) line 3880 + 16 bytes PyEval_EvalFrameEx(_frame * 0x00a60ac0, int 131) line 2515 fast_function(_object * 0x00000000, _object * * * 0x00fbfbe0, int 1, int 1, int 9870576) line 3946 call_function(_object * * * 0x00fbfbe0, int 0) line 3880 + 16 bytes PyEval_EvalFrameEx(_frame * 0x00a60918, int 131) line 2515 PyEval_EvalCodeEx(PyCodeObject * 0x00a142c8, _object * 0x00a60918, _object * 0x00000001, _object * * 0x00a194ac, int 1, _object * * 0x00000000, int 0, _object * * 0x00000000, int 0, _object * 0x00000000) line 3104 + 11 bytes function_call(_object * 0x00a35350, _object * 0x00a19498, _object * 0x00000000) line 529 + 64 bytes PyObject_Call(_object * 0x00a35350, _object * 0x00a19498, _object * 0x00000000) line 2506 + 15 bytes instancemethod_call(_object * 0x00a35350, _object * 0x00a19498, _object
- 0x00000000) line 2579 + 17 bytes PyObject_Call(_object * 0x009fdef8, _object * 0x008c1038, _object * 0x00000000) line 2506 + 15 bytes PyEval_CallObjectWithKeywords(_object * 0x009fdef8, _object * 0x008c1038, _object * 0x00000000) line 3729 t_bootstrap(void * 0x008c7608) line 426 + 26 bytes bootstrap(void * 0x00234d08) line 122 + 7 bytes _threadstartex(void * 0x009aeaf0) line 227 + 13 bytes KERNEL32! 77e5b3bc()
//////////////////////////////////////////
if (tstate->frame->f_exc_type != NULL) /* crash: tstate->frame is NULL */
reset_exc_info(tstate);
else {
assert(tstate->frame->f_exc_value == NULL);
assert(tstate->frame->f_exc_traceback == NULL);
}