New GitHub issue #118680 from chgnrdv:<br>

<hr>

<pre>
# Crash report

### What happened?

Found when playing with https://github.com/python/cpython/issues/118415#issuecomment-2091032469. Appears on both debug and non-debug builds.
```python
import sys
import threading

l = threading._PyRLock()

def f():
    while True:
 with l:
            pass

t = threading.Thread(target=f)
t.start()
while True:
    f = sys._current_frames()[t.ident]
    while f:
 f.f_code
        f = f.f_back

```


### CPython versions tested on:

CPython main branch

### Operating systems tested on:

Linux

### Output from running 'python -VV' on the command line:

Python 3.13.0a6+ (heads/main:9fd33af5ac, May  7 2024, 03:18:30) [GCC 10.2.1 20210110]
</pre>

<hr>

<a href="https://github.com/python/cpython/issues/118680">View on GitHub</a>
<p>Labels: type-crash</p>
<p>Assignee: </p>