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
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
assignee=Noneclosed_at=<Date2010-09-10.22:29:29.420>created_at=<Date2010-03-22.01:08:22.931>labels= ['type-crash']
title='Fatal error on thread creation in low memory condition: local storage'updated_at=<Date2010-09-10.22:29:29.419>user='https://github.com/vstinner'
I wrote a patch to preallocate Python thread state before creating the thread to avoid a fatal error: bpo-7544 (it's now closed). This patch is not enough to avoid fatal errors in low memory condition.
Just after the creation of the thread, _PyGILState_NoteThreadState() is called. This function can fail with a fatal error (Couldn't create autoTLSkey mapping) in low memory condition if a memory allocation fails in find_key(), called by PyThread_set_key_value().
PyThread_set_key_value() fills a global single linked list of type 'struct key', the head is 'keyhead'. This list contains values and uses an index composed of (long thread id, int key). Only one key is used: autoTLSkey (0). The list is used to get the thread state (eg. in PyGILState_Ensure).
Note: This issue is very unlikely, but it does exist :-)
vstinner
changed the title
Fatal error on thread creation in low memory condition (2)
Fatal error on thread creation in low memory condition: local storage
Mar 22, 2010
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: