Skip to content

CRAN Patch Request #7514

Description

@TysonStanley

In the final testing for the CRAN version 1.18.0, Kurt asked:

In the revdeps checks I got

rdepends_maditr ... WARNING
rdepends_heatwaveR ... ERROR
rdepends_insurancerating ... ERROR
rdepends_myClim ... ERROR
rdepends_vardpoor ... ERROR

where insurancerating is from

Error in data.table::foverlaps(df1, lookup2, type = "any", which = FALSE,  :
  attempt access index -1/4 in VECTOR_ELT

which is another out of bounds error from c89198.

Can you please have a look at this and the others? 

I think this is something we can work on after the holidays but wanted to get it up in from of you all now.

Activity

  1. added this to the 1.18.2 milestone on Dec 24, 2025
  2. aitap commented on Dec 25, 2025

    @aitap
    Member

    maditr re-exports fcoalesce. With the new argument, it now has a code-documentation mismatch. I suppose they'll have to update their documentation and set their dependency to data.table (>= 1.18.0)? Edit: the fix is on GitHub since September, see gdemin/maditr#20

    heatwaveR has the fix on GitHub and needs to publish a new package version.

    vardpoor needs a maintainer to merge CSBLatvia/vardpoor#26 and publish a new version.

  3. aitap commented on Dec 25, 2025

    @aitap
    Member

    insurancerating does indeed cause an out-of-bounds index in overlaps:

    > example(rows_per_date)
    
    Thread 1 "R" hit Breakpoint 1.1, Rf_errorcall (call=0x555558b6aa70, format=format@entry=0x5555557eeb7e "%s") at errors.c:908
    908     {
    (gdb) frame 3
    #3  0x00007ffff437ae4e in overlaps (ux=<optimized out>, imatches=<optimized out>, multArg=<optimized out>, typeArg=<optimized out>, nomatchArg=<optimized out>,
        verbose=0x55556416f1f8) at ijoin.c:408
    408               tmp1 = VECTOR_ELT(lookup, k-1);
    (gdb) call R_inspect(lookup)
    @555564260ec8 19 VECSXP g0c3 [REF(5)] (len=4, tl=0)
      @55556429a840 13 INTSXP g0c1 [REF(1)] (len=1, tl=0) 1
      @5555642ad550 13 INTSXP g0c0 [REF(1)] (len=0, tl=0)
      @55556429a7d0 13 INTSXP g0c1 [REF(1)] (len=1, tl=0) 2
      @5555642ad4e0 13 INTSXP g0c0 [REF(1)] (len=0, tl=0)
    (gdb) p k
    $2 = 0
    

    data.table/src/ijoin.c

    Lines 405 to 408 in a29c209

    // k = (from[i]>0) ? from[i] : 1;
    const int k = from[i];
    if (k<=to[i]) {
    tmp1 = VECTOR_ELT(lookup, k-1);

    from and to come from the imatches argument, which indeed contains zeroes:

    (gdb) call R_inspect(imatches)
    @5555655d6bf8 19 VECSXP g0c2 [REF(1)] (len=2, tl=0)
      @5555655a8340 13 INTSXP g0c1 [REF(2)] (len=2, tl=0) 1,0
      @555565589d20 13 INTSXP g0c1 [REF(2)] (len=2, tl=0) 2,0
    

    The zeroes originate in the R code:

    data.table/R/foverlaps.R

    Lines 159 to 161 in a29c209

    xmatches = indices(uy, x, xintervals, nomatch=0L, roll=roll)
    if (verbose) {cat(timetaken(last.started.at),"\n");flush.console()}
    olaps = .Call(Coverlaps, uy, xmatches, mult, type, nomatch, verbose)

    Look like the check for k<1 still needs to be there.

  4. TysonStanley commented on Jan 18, 2026

    @TysonStanley
    MemberAuthor

    Should we move to milestone 1.19.0?

  5. aitap commented on Jan 18, 2026

    @aitap
    Member

    myClim maintainers fixed the remaining problem; their package passes CRAN checks now.

  6. TysonStanley commented on Jan 22, 2026

    @TysonStanley
    MemberAuthor

    Closing for now, we will see if any additional revdeps show up after this patch but evidence suggests that the list should get smaller (especially if some devs submit their updated packages).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions