Message318991
One solution to trigger so crash more frequently is to reduce the threshold of the generation 0 of the garbage collector.
Here is a patch to do that when using -X dev: change the default threshold from 700 to 5 for the generation 0.
With this patch, "PYTHONDEVMODE=1 python -m test test_context" does also crash as expected.
diff --git a/Python/pylifecycle.c b/Python/pylifecycle.c
index 958219b744..81218fb964 100644
--- a/Python/pylifecycle.c
+++ b/Python/pylifecycle.c
@@ -622,6 +622,10 @@ _Py_InitializeCore(const _PyCoreConfig *core_config)
return _Py_INIT_ERR("runtime core already initialized");
}
+ if (core_config->dev_mode) {
+ _PyRuntime.gc.generations[0].threshold = 5;
+ }
+
/* Py_Finalize leaves _Py_Finalizing set in order to help daemon
* threads behave a little more gracefully at interpreter shutdown.
* We clobber it here so the new interpreter can start with a clean |
|
Date |
User |
Action |
Args |
2018-06-08 00:06:52 | vstinner | set | recipients:
+ vstinner, ned.deily, yselivanov |
2018-06-08 00:06:52 | vstinner | set | messageid: <1528416412.66.0.592728768989.issue33803@psf.upfronthosting.co.za> |
2018-06-08 00:06:52 | vstinner | link | issue33803 messages |
2018-06-08 00:06:50 | vstinner | create | |
|