Skip to content

Segfault of is.sorted on list/vector containing only NA_character_#5170

Merged
mattdowle merged 10 commits intomasterfrom
isSorted_segfault_nachar
Sep 22, 2021
Merged

Segfault of is.sorted on list/vector containing only NA_character_#5170
mattdowle merged 10 commits intomasterfrom
isSorted_segfault_nachar

Conversation

@ben-schwen
Copy link
Copy Markdown
Member

Closes #5070

@codecov
Copy link
Copy Markdown

codecov bot commented Sep 21, 2021

Codecov Report

Merging #5170 (373eb5b) into master (b82eb68) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #5170   +/-   ##
=======================================
  Coverage   99.38%   99.38%           
=======================================
  Files          77       77           
  Lines       14506    14507    +1     
=======================================
+ Hits        14417    14418    +1     
  Misses         89       89           
Impacted Files Coverage Δ
src/forder.c 100.00% <100.00%> (ø)

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 b82eb68...373eb5b. Read the comment docs.

Comment thread src/forder.c
Copy link
Copy Markdown
Member

@MichaelChirico MichaelChirico left a comment

Choose a reason for hiding this comment

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

awesome!

@mattdowle
Copy link
Copy Markdown
Member

Yes: great, thanks!
is.sorted isn't exported though so another tweak to the news item pending ...

@mattdowle mattdowle added this to the 1.14.1 milestone Sep 22, 2021
@mattdowle
Copy link
Copy Markdown
Member

mattdowle commented Sep 22, 2021

And the original test reported with merge should be tested too in case that example doesn't use is.sorted in future. Will do. We try and test from the bottom up and from the top down too: as many ways of testing -- just add them all. Then they all get covered by valgrind and ASAN in CRAN_Release.cmd procedures before release.

@mattdowle
Copy link
Copy Markdown
Member

Thanks for adding the merge test from the issue! I was looking at it too and it's a little odd isn't it, the crash actually happens in the [,.(x1,x2)] part when that calls is.sorted, not in the merge. It's just that the merge creates the result which is keyed by the all-NA_character_ column. Anyway, all I focus on is trying to understand and follow the tests myself, and I run the tests in last released version to make sure they do segfault there (which these do). I wasn't sure why you used copy() though, and I looked at the last key test and wondered about that. I ended up shortening the test block, reducing the number of objects in play so I could compare it to the example in the issue, and included checking the key rather than removing the key from both sides.

…t part was the segfault and 2nd part worked but included for completeness. Easier to see now that it matches the example in the issue.
@mattdowle mattdowle merged commit 1e32776 into master Sep 22, 2021
@mattdowle mattdowle deleted the isSorted_segfault_nachar branch September 22, 2021 21:08
@jangorecki jangorecki modified the milestones: 1.14.9, 1.15.0 Oct 29, 2023
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.

Segfault merging data.tables with keyed NA_character_ columns

4 participants