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

parse_date() segfaults on invalid format #1151

Closed
sonicdoe opened this issue Nov 17, 2020 · 1 comment
Closed

parse_date() segfaults on invalid format #1151

sonicdoe opened this issue Nov 17, 2020 · 1 comment

Comments

@sonicdoe
Copy link

If a percent sign (%) is misplaced in parse_date()’s format specification, a segmentation fault is raised.

library(readr)
# Note this percent sign  ↓
parse_date("2020-11-17", "%%Y-%m-%d")

With R v4.0.3 and readr v1.4.0:

 *** caught segfault ***
address 0x20, cause 'memory not mapped'

Traceback:
 1: parse_vector_(x, collector, na = na, locale_ = locale, trim_ws = trim_ws)
 2: withCallingHandlers(expr, warning = function(w) if (inherits(w,     classes)) tryInvokeRestart("muffleWarning"))
 3: suppressWarnings(x)
 4: probs(x)
 5: n_problems(x)
 6: warn_problems(parse_vector_(x, collector, na = na, locale_ = locale,     trim_ws = trim_ws))
 7: parse_vector(x, col_date(format), na = na, locale = locale, trim_ws = trim_ws)
 8: parse_date("2020-11-17", "%%Y-%m-%d")
@jimhester
Copy link
Collaborator

Thanks for opening the issue, a clear bug that happened in the recent conversion. Should now be fixed.

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

No branches or pull requests

2 participants