Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fatal Python error: Aborted when deleting span from SpanGroup #13638

Open
NixBiks opened this issue Sep 27, 2024 · 1 comment
Open

Fatal Python error: Aborted when deleting span from SpanGroup #13638

NixBiks opened this issue Sep 27, 2024 · 1 comment

Comments

@NixBiks
Copy link
Contributor

NixBiks commented Sep 27, 2024

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.

del span.doc.spans["my_spans"][index]

The documentation 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
@NixBiks
Copy link
Contributor Author

NixBiks commented Sep 30, 2024

My current workaround is to create a custom span attribute and filter on that.

Span.set_extension("is_removed", default=False)

Instead of removing the object with del I simply change that custom attribute span.doc.spans["my_spans"][index]._.is_removed = True

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant