Skip to content

reworked fmelt.c:concat to survive gctorture#4631

Merged
mattdowle merged 2 commits intomasterfrom
gctorture
Jul 22, 2020
Merged

reworked fmelt.c:concat to survive gctorture#4631
mattdowle merged 2 commits intomasterfrom
gctorture

Conversation

@mattdowle
Copy link
Copy Markdown
Member

@mattdowle mattdowle commented Jul 22, 2020

Closes #4628
Confirmed that all parts of test 1036 now pass full strength gctorture(TRUE) with latest R-devel compiled strictly.
concat was marked as a hack anyway so needed attention. If I was forced to guess I'd guess it was that SETCAR(t, mkString(", ")); doesn't protect the result of mkString but I'd be surprised if it doesn't. Initially I protected the result of concat before it was passed on to warning/Rprintf which definitely needed doing, but it wasn't just that (it still failed torture). Not sure what else it could be as I don't see anything else missing protection. The dev cycle time to resolve this one was significant due to the slowness of torture so I just went for the rework approach which needed doing anyway. The new approach for concat is simpler and cleaner, but we need to make sure not to use it twice in the same warning/Rprintf call (comment added).
Several of the fmelt tests weren't checking the dynamic parts of their messages; i.e. the result of concat being correct, so I expanded those tests too. I checked that the expanded fmelt tests also pass v1.12.8 to ensure the reworked concat returns the same string as before. concat is only used in warning and verbose messages, and only in fmelt, so the risk of this code rework at this stage in release is limited. Reran rchk just to make sure nothing new introduced, and all fine.

@mattdowle mattdowle added this to the 1.12.9 milestone Jul 22, 2020
@codecov
Copy link
Copy Markdown

codecov bot commented Jul 22, 2020

Codecov Report

Merging #4631 into master will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff            @@
##           master    #4631    +/-   ##
========================================
  Coverage   99.61%   99.61%            
========================================
  Files          73       73            
  Lines       14103    14244   +141     
========================================
+ Hits        14048    14189   +141     
  Misses         55       55            
Impacted Files Coverage Δ
R/duplicated.R 100.00% <ø> (ø)
src/between.c 100.00% <ø> (ø)
src/cj.c 100.00% <ø> (ø)
src/coalesce.c 100.00% <ø> (ø)
src/froll.c 100.00% <ø> (ø)
src/frolladaptive.c 100.00% <ø> (ø)
src/reorder.c 100.00% <ø> (ø)
src/types.c 100.00% <ø> (ø)
R/data.table.R 100.00% <100.00%> (ø)
R/fcast.R 100.00% <100.00%> (ø)
... and 24 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 55b9561...f59feb3. Read the comment docs.

@mattdowle mattdowle merged commit a7d17a3 into master Jul 22, 2020
@mattdowle mattdowle deleted the gctorture branch July 22, 2020 20:30
Comment thread src/fmelt.c

if (TYPEOF(vec) != STRSXP) error(_("concat: 'vec must be a character vector"));
static const char *concat(SEXP vec, SEXP idx) {
if (!isString(vec)) error(_("concat: 'vec must be a character vector"));
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

should be 'vec', i'll file follow-up

@MichaelChirico MichaelChirico mentioned this pull request Jul 23, 2020
hongyuanjia pushed a commit to hongyuanjia/data.table that referenced this pull request Dec 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.

strict gctorture results to work through

2 participants