[R-pkg-devel] Warnings related to functions from the survival package

Tomas Kalibera tom@@@k@||ber@ @end|ng |rom gm@||@com
Mon Nov 4 11:08:36 CET 2024


On 11/1/24 17:40, Ivan Krylov wrote:
> On Fri, 1 Nov 2024 09:56:01 +0100
> Tomas Kalibera <tomas.kalibera using gmail.com> wrote:
>
>> isn't there a finer-grained way to suppress reports just
>> of this particular issue, ideally at finer granularity than a
>> function?
> The line saying "function:do_dotCode" in the suppression file will
> suppress errors just for mismatched function pointer types inside
> do_dotCode(), because "function" is the name of this check [1]. Here's
> do_dotCode with a different error added:
>
> bin/R -q -s -e 'library(survival); survdiff(Surv(futime, fustat) ~
> rx,data=ovarian)'
>
> dotcode.c:1958:9: runtime error: 1e+100 is outside the range of
> representable values of type 'int'
> SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior dotcode.c:1958:9
> dotcode.c:2012:2: runtime error: call to function survdiff2 through
> pointer to incorrect function type
> 'void (*)(void *, void *, void *, void *, void *, void *, void *, void
> *, void *, void *, void *, void
> *, void *)'
> /tmp/RtmpVPlRnI/R.INSTALL65eb26c0356f/survival/src/survdiff2.c:10:
> note: survdiff2 defined here
> SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior dotcode.c:2012:2
>
> UBSAN_OPTIONS="suppressions=$(realpath dotcode.supp)" \
> bin/R -q -s -e 'library(survival); survdiff(Surv(futime, fustat) ~
> rx,data=ovarian)'
>
> dotcode.c:1958:9: runtime error: 1e+100 is outside the range of
> representable values of type 'int'
>
> I don't think UBSan can suppress errors in a more precise manner. The
> documentation only mentions files, functions ans libraries. Best I
> could find was a 2020 comment [2] suggesting to separate the offending
> code into a function and let the optimiser inline it.
I feared that might be the case, thanks for looking this up,
Tomas
>



More information about the R-package-devel mailing list