Fatal Python error: Aborted when deleting span from SpanGroup
- Dominant language
- Python
- Stars
- 33.9k
- Forks
- 4.7k
- Avg merge
- 3m
- Merged PRs (30d)
- 1
Description
## How to reproduce the behaviour
Unfortunately I haven't been able to make a minimal reproducible example. The error happens sometimes when I run my tests - the more tests I run the higher probability of running into the following critical error
```
Python(69256,0x1fa11cf40) malloc: Region cookie corrupted for region 0x12f800000 (value is c)[0x12f80407c]
Python(69256,0x1fa11cf40) malloc: *** set a breakpoint in malloc_error_break to debug
Fatal Python error: Aborted
```
I've found out that I don't encounter the error if I remove the following line.
```python
del span.doc.spans["my_spans"][index]
```
The [documentation](https://spacy.io/api/spangroup#delitem) states this is the way to do it though. Note there is a typo in the code in the docs though.
I realise you most likely can't help with this little info but maybe you can give me some ways to investigate further.
## Info about spaCy
- **spaCy version:** 3.7.4
- **Platform:** macOS-14.6.1-arm64-arm-64bit
- **Python version:** 3.12.5
Contributor guide
Assessment
This issue has not been assessed yet.