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

Merge pull request #22 from mrc-ide/mrc-1281 #22

Merged
merged 5 commits into from Jan 14, 2020
Merged

Merge pull request #22 from mrc-ide/mrc-1281 #22

merged 5 commits into from Jan 14, 2020

Conversation

@richfitz
Copy link
Member

@richfitz richfitz commented Jan 14, 2020

As requested by CRAN on 1 January. Three fixes here - see reside-89 as reside-ic/reside-ic.github.io#34 for details.

richfitz added 3 commits Jan 14, 2020
@codecov
Copy link

@codecov codecov bot commented Jan 14, 2020

Codecov Report

Merging #22 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@          Coverage Diff          @@
##           master    #22   +/-   ##
=====================================
  Coverage     100%   100%           
=====================================
  Files          16     16           
  Lines        1829   1787   -42     
=====================================
- Hits         1829   1787   -42
Impacted Files Coverage Δ
src/r_dopri.c 100% <100%> (ø) ⬆️
src/r_difeq.c 100% <100%> (ø) ⬆️
src/dopri.c 100% <100%> (ø) ⬆️
src/dopri_5.c 100% <0%> (ø) ⬆️
src/dopri_853.c 100% <0%> (ø) ⬆️
src/difeq.c 100% <0%> (ø) ⬆️
R/events.R 100% <0%> (ø) ⬆️
... and 1 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 7ebe2ff...33a83e3. Read the comment docs.

@richfitz richfitz requested a review from weshinsley Jan 14, 2020
Copy link
Contributor

@weshinsley weshinsley left a comment

One purely narrative comment by the negative idx section, and one suggestiong for a link to the perhaps a link to the amazing reside blog when it's published.

I'll approve here, but leave you to merge when ready!

## dde 1.0.1

* Several memory errors fixed [#22](https://github.com/mrc-ide/dde/pull/22)

This comment has been minimized.

@weshinsley

weshinsley Jan 14, 2020
Contributor

Perhaps a link to the reside blog about this.

This comment has been minimized.

@richfitz

richfitz Jan 14, 2020
Author Member

I'll retrospectively add it to avoid issues with the CRAN link checker

idx0 = min_size((t - t0) / (t1 - t0) / (n - 1), n - 1);
if ((t0 - t) * (t1 - t) < 0) {
idx0 = (t - t0) / (t1 - t0) / (n - 1);
}

This comment has been minimized.

@weshinsley

weshinsley Jan 14, 2020
Contributor

So as we discussed: the values of t0, t1 and t (11, 12, 0.02) that caused the crash are perfectly reasonable; this part of the code should accept them gracefully, and then the code following this uses idx as a start point for searching the buffer.

Hence, zero is the best answer for idx to have after this bit of code, in the cases where it would previously have been negative.

@richfitz richfitz changed the title mrc-1281: Fix CRAN "additional checks" memory errors Merge pull request #22 from mrc-ide/mrc-1281 Jan 14, 2020
@richfitz richfitz merged commit b18d15e into master Jan 14, 2020
6 checks passed
6 checks passed
codecov/patch 100% of diff hit (target 100%)
Details
codecov/project 100% (+0%) compared to 7ebe2ff
Details
continuous-integration/appveyor/branch AppVeyor build succeeded
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants
You can’t perform that action at this time.