Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[R] clang UBSAN failure on CRAN #159

Closed
paleolimbot opened this issue Mar 10, 2023 · 0 comments · Fixed by #167
Closed

[R] clang UBSAN failure on CRAN #159

paleolimbot opened this issue Mar 10, 2023 · 0 comments · Fixed by #167

Comments

@paleolimbot
Copy link
Member

As reported by https://www.stats.ox.ac.uk/pub/bdr/memtests/clang-UBSAN/nanoarrow/tests/testthat.Rout


R Under development (unstable) (2023-03-10 r83967) -- "Unsuffered Consequences"
Copyright (C) 2023 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> # Licensed to the Apache Software Foundation (ASF) under one
> # or more contributor license agreements.  See the NOTICE file
> # distributed with this work for additional information
> # regarding copyright ownership.  The ASF licenses this file
> # to you under the Apache License, Version 2.0 (the
> # "License"); you may not use this file except in compliance
> # with the License.  You may obtain a copy of the License at
> #
> #   http://www.apache.org/licenses/LICENSE-2.0
> #
> # Unless required by applicable law or agreed to in writing,
> # software distributed under the License is distributed on an
> # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
> # KIND, either express or implied.  See the License for the
> # specific language governing permissions and limitations
> # under the License.
> 
> library(testthat)
> library(nanoarrow)
> 
> verbose_test_output <- identical(tolower(Sys.getenv("ARROW_R_DEV", "false")), "true") ||
+   identical(tolower(Sys.getenv("ARROW_R_VERBOSE_TEST", "false")), "true")
> 
> if (verbose_test_output) {
+   reporter <- MultiReporter$new(list(CheckReporter$new(), LocationReporter$new()))
+ } else {
+   reporter <- check_reporter()
+ }
> 
> test_check("nanoarrow", reporter = reporter)
as_array.c:261:26: runtime error: nan is outside the range of representable values of type 'int'
    

SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior as_array.c:261:26 in 
as_array.c:239:24: runtime error: nan is outside the range of representable values of type 'long'
    

SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior as_array.c:239:24 in 
nanoarrow.h:2745:14: runtime error: 1.79769e+308 is outside the range of representable values of type 'long'
    #0 0x7fedb98a0906 in ArrowArrayViewGetIntUnsafe /data/gannet/ripley/R/packages/tests-clang-SAN/nanoarrow/src/./nanoarrow.h:2745:14
   

SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior nanoarrow.h:2745:14 in 
[ FAIL 0 | WARN 0 | SKIP 4 | PASS 971 ]

══ Skipped tests ═══════════════════════════════════════════════════════════════
• On CRAN (4)

[ FAIL 0 | WARN 0 | SKIP 4 | PASS 971 ]
> 
> proc.time()
   user  system elapsed 
 61.568   1.955  74.956 

paleolimbot added a commit that referenced this issue Mar 26, 2023
…#167)

Closes #159.

Checked via:

```bash
PKG_CFLAGS=-fsanitize=undefined PKG_LIBS=-fsanitize=undefined R CMD INSTALL . --preclean
```

Then:

```r
devtools::test()
```
paleolimbot added a commit to paleolimbot/arrow-nanoarrow that referenced this issue Mar 26, 2023
…apache#167)

Closes apache#159.

Checked via:

```bash
PKG_CFLAGS=-fsanitize=undefined PKG_LIBS=-fsanitize=undefined R CMD INSTALL . --preclean
```

Then:

```r
devtools::test()
```
@paleolimbot paleolimbot added this to the nanoarrow 0.2.0 milestone Jun 8, 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 a pull request may close this issue.

1 participant