Commit 72986b8
committed
gh-123241: Make gc_free_threading.c more robust to increfs/decrefs in
The GC for the free threading build reuses `ob_ref_local` when
determining if any objects in the unreachable set were resurrected.
This is generally okay because the refcount fields are already merged.
However, if the tp_traverse calls `Py_INCREF`/`Py_DECREF`, it may see an
`ob_ref_local` of `UINT32_MAX` that looks like an immortal object.
Refactor `handle_resurrected_objects` so that `ob_ref_local` doesn't
reach `UINT32_MAX`.tp_traverse
1 parent b3bf212 commit 72986b8
2 files changed
Lines changed: 34 additions & 11 deletions
File tree
- Misc/NEWS.d/next/Core_and_Builtins
- Python
Lines changed: 3 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1788 | 1788 | | |
1789 | 1789 | | |
1790 | 1790 | | |
| 1791 | + | |
| 1792 | + | |
| 1793 | + | |
| 1794 | + | |
| 1795 | + | |
| 1796 | + | |
| 1797 | + | |
| 1798 | + | |
| 1799 | + | |
| 1800 | + | |
| 1801 | + | |
| 1802 | + | |
| 1803 | + | |
| 1804 | + | |
| 1805 | + | |
| 1806 | + | |
| 1807 | + | |
| 1808 | + | |
| 1809 | + | |
| 1810 | + | |
| 1811 | + | |
1791 | 1812 | | |
1792 | 1813 | | |
1793 | 1814 | | |
1794 | 1815 | | |
1795 | 1816 | | |
1796 | | - | |
| 1817 | + | |
| 1818 | + | |
| 1819 | + | |
| 1820 | + | |
1797 | 1821 | | |
1798 | 1822 | | |
1799 | 1823 | | |
| |||
1846 | 1870 | | |
1847 | 1871 | | |
1848 | 1872 | | |
1849 | | - | |
1850 | | - | |
| 1873 | + | |
1851 | 1874 | | |
1852 | 1875 | | |
1853 | 1876 | | |
| |||
1856 | 1879 | | |
1857 | 1880 | | |
1858 | 1881 | | |
1859 | | - | |
1860 | | - | |
1861 | | - | |
1862 | | - | |
1863 | | - | |
1864 | 1882 | | |
1865 | 1883 | | |
1866 | 1884 | | |
1867 | 1885 | | |
1868 | 1886 | | |
1869 | 1887 | | |
1870 | 1888 | | |
1871 | | - | |
| 1889 | + | |
1872 | 1890 | | |
1873 | 1891 | | |
1874 | | - | |
| 1892 | + | |
| 1893 | + | |
| 1894 | + | |
1875 | 1895 | | |
1876 | | - | |
| 1896 | + | |
1877 | 1897 | | |
1878 | 1898 | | |
1879 | 1899 | | |
| |||
0 commit comments