Skip to content

Conversation

@jeromekelleher
Copy link
Member

Incorrect buffer size calculations caused segfault when long alleles are present.

Closes #2429

@jeromekelleher jeromekelleher force-pushed the fix-variant-copy-segfault branch from e230ccf to dbd6625 Compare July 25, 2022 13:14
@jeromekelleher jeromekelleher marked this pull request as ready for review July 25, 2022 13:14
@jeromekelleher
Copy link
Member Author

This fixes the issue as simply as possible (and underlines the advantages of using the x= malloc(size * sizeof(*x)); pattern), however I think we can do things more simply and robustly by using a proper state machine for the variant class (#2436). We can do this as a follow up once the immediate segfault has been fixed, and released.

@codecov
Copy link

codecov bot commented Jul 25, 2022

Codecov Report

Merging #2437 (8e87bfd) into main (8e87bfd) will not change coverage.
The diff coverage is n/a.

❗ Current head 8e87bfd differs from pull request most recent head 1690069. Consider uploading reports for the commit 1690069 to get more accurate results

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #2437   +/-   ##
=======================================
  Coverage   93.43%   93.43%           
=======================================
  Files          28       28           
  Lines       27346    27346           
  Branches     1253     1253           
=======================================
  Hits        25550    25550           
  Misses       1762     1762           
  Partials       34       34           
Flag Coverage Δ
c-tests 92.26% <0.00%> (ø)
lwt-tests 89.05% <0.00%> (ø)
python-c-tests 71.39% <0.00%> (ø)
python-tests 98.95% <0.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.


Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8e87bfd...1690069. Read the comment docs.

@jeromekelleher jeromekelleher force-pushed the fix-variant-copy-segfault branch from dbd6625 to 26090d5 Compare July 26, 2022 14:01
Copy link
Member

@benjeffery benjeffery left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Incorrect buffer size calculations caused segfault when long
alleles are present.

Closes tskit-dev#2429
@jeromekelleher jeromekelleher force-pushed the fix-variant-copy-segfault branch from 26090d5 to 1690069 Compare July 27, 2022 13:55
@mergify mergify bot merged commit 98dacf5 into tskit-dev:main Jul 27, 2022
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.

crash inside tskit in SLiM's CI tests

2 participants