Miss Islington (bot)
ee7d2681f6
[3.13] gh-117657: Fix race involving GC and heap initialization (GH-119923) ( #120038 )
...
The `_PyThreadState_Bind()` function is called before the first
`PyEval_AcquireThread()` so it's not synchronized with the stop the
world GC. We had a race where `gc_visit_heaps()` might visit a thread's
heap while it's being initialized.
Use a simple atomic int to avoid visiting heaps for threads that are not
yet fully initialized (i.e., before `tstate_mimalloc_bind()` is called).
The race was reproducible by running:
`python Lib/test/test_importlib/partial/pool_in_threads.py`.
(cherry picked from commit e69d068ad0 )
Co-authored-by: Sam Gross <colesbury@gmail.com >
2024-06-04 14:08:10 +00:00
..
2024-05-09 20:26:36 +00:00
2024-05-03 06:17:32 -07:00
2024-05-03 06:17:32 -07:00
2024-04-24 16:18:24 +00:00
2024-05-05 19:28:55 +00:00
2024-02-09 17:08:32 -05:00
2024-04-12 07:40:55 +00:00
2023-11-15 16:38:31 +00:00
2024-03-29 13:35:43 -04:00
2024-05-05 03:07:29 +02:00
2024-06-02 14:42:46 +00:00
2024-05-06 20:12:39 -04:00
2024-05-02 18:25:36 -04:00
2024-04-04 15:47:26 +00:00
2023-11-15 16:38:31 +00:00
2024-02-02 13:50:51 +00:00
2024-02-10 00:57:04 +00:00
2024-05-22 19:24:02 +00:00
2024-04-11 23:23:25 +00:00
2024-02-02 12:14:34 +00:00
2024-05-07 00:22:26 +00:00
2023-12-07 13:47:55 +00:00
2023-09-15 15:04:21 -07:00
2024-04-30 22:32:55 +02:00
2024-02-29 08:11:28 -08:00
2024-04-04 15:47:26 +00:00
2024-05-04 12:12:10 +01:00
2024-02-17 10:03:10 +09:00
2024-05-03 16:21:04 -04:00
2024-06-03 22:21:32 +00:00
2024-02-29 08:11:28 -08:00
2024-05-06 23:07:23 -04:00
2024-06-03 17:05:04 -06:00
2024-06-03 17:05:04 -06:00
2023-11-15 16:38:31 +00:00
2024-05-06 23:07:23 -04:00
2024-05-04 21:24:02 +00:00
2024-03-11 11:02:58 -04:00
2024-04-24 09:46:17 +00:00
2024-05-04 08:23:50 +00:00
2024-05-06 20:12:39 -04:00
2024-05-03 06:17:32 -07:00
2024-02-20 09:39:55 +00:00
2024-05-02 13:03:05 -07:00
2024-01-23 11:08:23 -07:00
2024-04-30 15:01:28 -04:00
2024-06-03 09:29:07 +00:00
2024-06-04 14:08:10 +00:00
2023-11-16 12:19:54 -07:00
2024-05-03 11:30:55 -04:00
2024-01-21 01:14:45 +09:00
2024-02-10 00:57:04 +00:00
2024-02-14 00:32:51 +00:00
2024-06-03 23:37:28 +00:00
2024-01-26 19:38:14 -08:00
2024-01-26 19:38:14 -08:00
2024-05-31 21:56:26 -07:00
2023-11-02 10:18:43 +00:00
2024-04-22 13:34:06 +01:00
2024-02-20 16:50:43 +00:00
2023-10-13 09:25:37 +00:00
2024-04-30 12:37:38 -07:00
2024-04-24 16:18:24 +00:00
2024-03-16 21:37:11 +01:00
2023-12-06 15:09:22 +01:00
2024-04-22 12:17:57 -07:00
2024-02-20 13:04:37 -05:00
2024-03-08 09:56:36 -08:00
2024-04-24 16:18:24 +00:00
2024-04-24 16:18:24 +00:00
2024-05-10 15:13:17 +00:00
2024-06-03 17:05:04 -06:00
2024-05-02 19:30:00 +02:00
2024-05-02 19:30:00 +02:00
2024-02-20 16:50:43 +00:00
2024-05-06 20:12:39 -04:00
2023-10-10 08:26:29 +09:00
2024-02-29 08:11:28 -08:00
2024-05-04 15:45:49 +00:00
2024-05-28 11:03:33 -07:00
2024-05-05 12:15:19 +02:00
2023-10-12 14:52:14 +00:00
2024-04-08 12:11:36 -04:00
2024-03-08 00:21:21 +08:00
2024-06-03 23:37:28 +00:00
2024-05-10 16:36:33 +00:00
2023-11-30 11:12:49 +01:00
2024-06-03 17:05:04 -06:00
2024-02-29 08:11:28 -08:00
2024-02-28 09:56:40 +00:00
2024-05-04 12:11:11 +01:00
2024-05-31 21:56:26 -07:00
2024-03-28 15:05:08 +00:00
2024-05-10 14:20:22 +00:00