Skip to content

Fix setting name, score, or strand on short BED intervals (fixes #83) - #443

Open
rpinho wants to merge 1 commit into
daler:masterfrom
rpinho:fix-bed-setter-short-intervals
Open

rpinho wants to merge 1 commit into
daler:masterfrom
rpinho:fix-bed-setter-short-intervals

Conversation

@rpinho

@rpinho rpinho commented Dec 1, 2026

Copy link
Copy Markdown

Who hits this: anyone setting .name, .score, or .strand on a BED3, BED4, or BED5 interval, as in #83 (#83).

It looks like it works, but it's not. If you set .strand = '+' on chr1 1 100, like in the example from #83, you still get chr1 1 100 when you save it. That's because it writes past the end of the C++ fields vector. I did .name on a BED3 20 times, and one time it was a crash (SIGBUS).

With this, it adds . for the missing columns first, so now you get chr1 1 100 . . +. And bed[3] = ... also updates .name. For GFF and VCF, .score now works instead of KeyError. If a negative index is too big, it's an IndexError now (before it was OverflowError). This fixes #83.

I added a test for this. It works now: 556 before, 557 now.

I'm doing this with AI agents. A second agent on a different model checked the bug again from the report alone, without the first agent's code.

🤖 Generated with Claude Code

…r#83)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
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

Successfully merging this pull request may close these issues.

Segmentation fault when trying to assign value to feature['score']

1 participant