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

Fix for recent Fedora and ASAN errors #3098

Merged
merged 14 commits into from Sep 29, 2017
8 changes: 4 additions & 4 deletions .travis.yml
Expand Up @@ -10,10 +10,10 @@ env:
- _R_CHECK_FORCE_SUGGESTS_=false
- MAKEFLAGS="-j 2"

include:
- r: release
- r: oldrel
- r: devel
r:
- release
- oldrel
- devel

before_script:
- mkdir -p ~/.R; echo 'PKG_CXXFLAGS := ${PKG_CXXFLAGS} -Wall -Wextra -pedantic -Werror' > ~/.R/Makevars
Expand Down
2 changes: 1 addition & 1 deletion DESCRIPTION
@@ -1,6 +1,6 @@
Type: Package
Package: dplyr
Version: 0.7.3.9000
Version: 0.7.4
Title: A Grammar of Data Manipulation
Description: A fast, consistent tool for working with data frame like objects,
both in memory and out of memory.
Expand Down
6 changes: 6 additions & 0 deletions NEWS.md
@@ -1,3 +1,9 @@
# dplyr 0.7.4

* Fix recent Fedora and ASAN check errors (#3098).

* Avoid dependency on Rcpp 0.12.10 (#3106).

# dplyr 0.7.3

* Fixed protection error that occurred when creating a character column using grouped `mutate()` (#2971).
Expand Down
2 changes: 1 addition & 1 deletion README.Rmd
Expand Up @@ -20,7 +20,7 @@ options(tibble.print_min = 5, tibble.print_max = 5)
[![Build Status](https://travis-ci.org/tidyverse/dplyr.svg?branch=master)](https://travis-ci.org/tidyverse/dplyr)
[![AppVeyor Build Status](https://ci.appveyor.com/api/projects/status/github/tidyverse/dplyr?branch=master&svg=true)](https://ci.appveyor.com/project/tidyverse/dplyr)
[![CRAN_Status_Badge](http://www.r-pkg.org/badges/version/dplyr)](http://cran.r-project.org/package=dplyr)
[![Coverage Status](https://img.shields.io/codecov/c/github/tidyverse/dplyr/master.svg)](https://codecov.io/github/tidyverse/dplyr?branch=master)
[![Coverage Status](https://codecov.io/gh/tidyverse/dplyr/branch/master/graph/badge.svg)](https://codecov.io/gh/tidyverse/dplyr?branch=master)

## Overview

Expand Down
81 changes: 39 additions & 42 deletions README.md
Expand Up @@ -3,7 +3,7 @@
dplyr <img src="man/figures/logo.png" align="right" />
======================================================

[![Build Status](https://travis-ci.org/tidyverse/dplyr.svg?branch=master)](https://travis-ci.org/tidyverse/dplyr) [![AppVeyor Build Status](https://ci.appveyor.com/api/projects/status/github/tidyverse/dplyr?branch=master&svg=true)](https://ci.appveyor.com/project/tidyverse/dplyr) [![CRAN\_Status\_Badge](http://www.r-pkg.org/badges/version/dplyr)](http://cran.r-project.org/package=dplyr) [![Coverage Status](https://img.shields.io/codecov/c/github/tidyverse/dplyr/master.svg)](https://codecov.io/github/tidyverse/dplyr?branch=master)
[![Build Status](https://travis-ci.org/tidyverse/dplyr.svg?branch=master)](https://travis-ci.org/tidyverse/dplyr) [![AppVeyor Build Status](https://ci.appveyor.com/api/projects/status/github/tidyverse/dplyr?branch=master&svg=true)](https://ci.appveyor.com/project/tidyverse/dplyr) [![CRAN\_Status\_Badge](http://www.r-pkg.org/badges/version/dplyr)](http://cran.r-project.org/package=dplyr) [![Coverage Status](https://codecov.io/gh/tidyverse/dplyr/branch/master/graph/badge.svg)](https://codecov.io/gh/tidyverse/dplyr?branch=master)

Overview
--------
Expand Down Expand Up @@ -32,7 +32,7 @@ install.packages("tidyverse")
# Alternatively, install just dplyr:
install.packages("dplyr")

# Or the the development version from GitHub:
# Or the development version from GitHub:
# install.packages("devtools")
devtools::install_github("tidyverse/dplyr")
```
Expand All @@ -48,54 +48,51 @@ library(dplyr)
starwars %>%
filter(species == "Droid")
#> # A tibble: 5 x 13
#> name height mass hair_color skin_color eye_color birth_year gender
#> <chr> <int> <dbl> <chr> <chr> <chr> <dbl> <chr>
#> 1 C-3PO 167 75 <NA> gold yellow 112 <NA>
#> 2 R2-D2 96 32 <NA> white, blue red 33 <NA>
#> 3 R5-D4 97 32 <NA> white, red red NA <NA>
#> 4 IG-88 200 140 none metal red 15 none
#> 5 BB8 NA NA none none black NA none
#> # ... with 5 more variables: homeworld <chr>, species <chr>, films <list>,
#> # vehicles <list>, starships <list>
#> name height mass hair… skin… eye_… birt… gend… home… spec… films vehi…
#> <chr> <int> <dbl> <chr> <chr> <chr> <dbl> <chr> <chr> <chr> <lis> <lis>
#> 1 C-3PO 167 75.0 <NA> gold yell… 112 <NA> Tato… Droid <chr… <chr…
#> 2 R2-D2 96 32.0 <NA> "whi… red 33.0 <NA> Naboo Droid <chr… <chr…
#> 3 R5-D4 97 32.0 <NA> "whi… red NA <NA> Tato… Droid <chr… <chr…
#> 4 IG-88 200 140 none metal red 15.0 none <NA> Droid <chr… <chr…
#> 5 BB8 NA NA none none black NA none <NA> Droid <chr… <chr…
#> # ... with 1 more variable: starships <list>

starwars %>%
select(name, ends_with("color"))
#> # A tibble: 87 x 4
#> name hair_color skin_color eye_color
#> <chr> <chr> <chr> <chr>
#> 1 Luke Skywalker blond fair blue
#> 2 C-3PO <NA> gold yellow
#> 3 R2-D2 <NA> white, blue red
#> 4 Darth Vader none white yellow
#> 5 Leia Organa brown light brown
#> name hair_color skin_color eye_color
#> <chr> <chr> <chr> <chr>
#> 1 "Luke Skywalker" blond fair blue
#> 2 C-3PO <NA> gold yellow
#> 3 R2-D2 <NA> "white, blue" red
#> 4 "Darth Vader" none white yellow
#> 5 "Leia Organa" brown light brown
#> # ... with 82 more rows

starwars %>%
mutate(name, bmi = mass / ((height / 100) ^ 2)) %>%
select(name:mass, bmi)
#> # A tibble: 87 x 4
#> name height mass bmi
#> <chr> <int> <dbl> <dbl>
#> 1 Luke Skywalker 172 77 26.02758
#> 2 C-3PO 167 75 26.89232
#> 3 R2-D2 96 32 34.72222
#> 4 Darth Vader 202 136 33.33007
#> 5 Leia Organa 150 49 21.77778
#> name height mass bmi
#> <chr> <int> <dbl> <dbl>
#> 1 "Luke Skywalker" 172 77.0 26.0
#> 2 C-3PO 167 75.0 26.9
#> 3 R2-D2 96 32.0 34.7
#> 4 "Darth Vader" 202 136 33.3
#> 5 "Leia Organa" 150 49.0 21.8
#> # ... with 82 more rows

starwars %>%
arrange(desc(mass))
#> # A tibble: 87 x 13
#> name height mass hair_color skin_color
#> <chr> <int> <dbl> <chr> <chr>
#> 1 Jabba Desilijic Tiure 175 1358 <NA> green-tan, brown
#> 2 Grievous 216 159 none brown, white
#> 3 IG-88 200 140 none metal
#> 4 Darth Vader 202 136 none white
#> 5 Tarfful 234 136 brown brown
#> # ... with 82 more rows, and 8 more variables: eye_color <chr>,
#> # birth_year <dbl>, gender <chr>, homeworld <chr>, species <chr>,
#> # films <list>, vehicles <list>, starships <list>
#> name heig… mass hair… skin… eye_… birt… gend… home… spec… films vehi…
#> <chr> <int> <dbl> <chr> <chr> <chr> <dbl> <chr> <chr> <chr> <lis> <lis>
#> 1 "Jabb… 175 1358 <NA> "gre… oran… 600 herm… "Nal… Hutt <chr… <chr…
#> 2 Griev… 216 159 none "bro… "gre… NA male Kalee Kale… <chr… <chr…
#> 3 IG-88 200 140 none metal red 15.0 none <NA> Droid <chr… <chr…
#> 4 "Dart… 202 136 none white yell… 41.9 male Tato… Human <chr… <chr…
#> 5 Tarff… 234 136 brown brown blue NA male Kash… Wook… <chr… <chr…
#> # ... with 82 more rows, and 1 more variable: starships <list>

starwars %>%
group_by(species) %>%
Expand All @@ -105,12 +102,12 @@ starwars %>%
) %>%
filter(n > 1)
#> # A tibble: 9 x 3
#> species n mass
#> <chr> <int> <dbl>
#> 1 Droid 5 69.75000
#> 2 Gungan 3 74.00000
#> 3 Human 35 82.78182
#> 4 Kaminoan 2 88.00000
#> 5 Mirialan 2 53.10000
#> species n mass
#> <chr> <int> <dbl>
#> 1 Droid 5 69.8
#> 2 Gungan 3 74.0
#> 3 Human 35 82.8
#> 4 Kaminoan 2 88.0
#> 5 Mirialan 2 53.1
#> # ... with 4 more rows
```
27 changes: 13 additions & 14 deletions cran-comments.md
@@ -1,6 +1,6 @@
## Release summary

This is a minor bugfix release in response to CRAN's request. This is the third release attempt (with the same version), following up test failures with reverse dependencies from CRAN's incoming checks.
This is a minor bugfix release in response to errors with ASAN, UBSAN, and Fedora+clang builds on CRAN. We now were able to finally replicate the problems we were seeing on CRAN in a Docker container, our minimal fix resolves these problems.

## Test environments

Expand All @@ -10,31 +10,30 @@ This is a minor bugfix release in response to CRAN's request. This is the third

## R CMD check results

0 ERRORs | 0 WARNINGs | 1 NOTEs
0 ERRORs | 0 WARNINGs | 2 NOTEs

* checking installed package size ... NOTE
* 6 days since last update

This is all compiled code in the libs/ directory.
The UB errors seem important to fix now.

## ASAN errors on CRAN
* checking installed package size ... NOTE

We could not replicate the ASAN errors on Fedora with clang. We changed code that we believe may be responsible for the problem, and we'll watch the check results once the package is released.
This is all compiled code in the libs/ directory.

## Reverse dependencies

We checked 795 reverse dependencies (721 from CRAN + 74 from BioConductor) by running R CMD check twice, once with the CRAN version installed, and once with this version installed. We saw 3 new problems. We failed to check 4 packages. Issues are summarised below.
We checked 804 reverse dependencies (730 from CRAN + 74 from BioConductor) by running R CMD check twice, once with the CRAN version installed, and once with this version installed. We saw 2 new problems. We failed to check 4 packages. Issues are summarised below.

### New problems

Most likely web API problems:

* censusr
* hansard
* roadoi
* banR
* FedData

### Failed to check

* flowWorkspace (failed to install)
* loon (failed to install)
* naniar (check timed out)
* visdat (check timed out)
* eyetrackingR (check timed out)
* hypothesisr (check timed out)
* loon (failed to install)
* MonetDBLite (check timed out)
18 changes: 9 additions & 9 deletions inst/include/dplyr/Result/Rank.h
Expand Up @@ -186,7 +186,7 @@ class Rank_Impl : public Result, public Increment {

void process_slice(OutputVector& out, const SlicingIndex& index) {
map.clear();
Slice slice(data, index);
Slice slice(&data, index);
int m = index.size();
for (int j = 0; j < m; j++) {
map[ slice[j] ].push_back(j);
Expand Down Expand Up @@ -256,10 +256,10 @@ class RowNumber : public Result {
int m = index.size();
for (int j = 0; j < m; j++) tmp[j] = j;

Slice slice(data, index);
Slice slice(&data, index);
// order( gdf.group(i) )
Visitor visitor(slice);
Comparer comparer = Comparer(visitor);
Comparer comparer(visitor);
std::sort(tmp.begin(), tmp.begin() + m, comparer);
int j = m - 1;
for (; j >= 0; j--) {
Expand Down Expand Up @@ -290,7 +290,7 @@ class RowNumber : public Result {
int nrows = index.size();
if (nrows == 0) return IntegerVector(0);
IntegerVector x = seq(0, nrows - 1);
Slice slice(data, index);
Slice slice(&data, index);
Visitor visitor(slice);
std::sort(x.begin(), x.end(), Comparer(visitor));
IntegerVector out = no_init(nrows);
Expand All @@ -309,7 +309,7 @@ class RowNumber : public Result {
}

private:
SEXP data;
Vector<RTYPE> data;
};

template <int RTYPE, bool ascending = true>
Expand Down Expand Up @@ -337,11 +337,11 @@ class Ntile : public Result {
// tmp <- 0:(m-1)
int m = index.size();
for (int j = 0; j < m; j++) tmp[j] = j;
Slice slice(data, index);
Slice slice(&data, index);

// order( gdf.group(i) )
Visitor visitor(slice);
Comparer comparer = Comparer(visitor);
Comparer comparer(visitor);
std::sort(tmp.begin(), tmp.begin() + m, comparer);
int j = m - 1;
for (; j >= 0; j--) {
Expand Down Expand Up @@ -372,7 +372,7 @@ class Ntile : public Result {
int nrows = index.size();
if (nrows == 0) return IntegerVector(0);
IntegerVector x = seq(0, nrows - 1);
Slice slice(data, index);
Slice slice(&data, index);
Visitor visitor(slice);
std::sort(x.begin(), x.end(), Comparer(visitor));
IntegerVector out = no_init(nrows);
Expand All @@ -393,7 +393,7 @@ class Ntile : public Result {
}

private:
SEXP data;
Vector<RTYPE> data;
double ntiles;
};

Expand Down
4 changes: 2 additions & 2 deletions inst/include/dplyr/Result/VectorSliceVisitor.h
Expand Up @@ -10,8 +10,8 @@ class VectorSliceVisitor {
public:
typedef typename Rcpp::traits::storage_type<RTYPE>::type STORAGE;

VectorSliceVisitor(const Vector<RTYPE>& data_, const SlicingIndex& index_) :
data(data_),
VectorSliceVisitor(const Vector<RTYPE>* data_, const SlicingIndex& index_) :
data(*data_),
n(index_.size()),
index(index_)
{}
Expand Down