Skip to content

segfault with read_fwf() and fwf_positions() #1544

@MatthieuStigler

Description

@MatthieuStigler

I get a segfault error when running the code below, tested on two different Ubuntu machines. vroom (1.6.5) and readr (2.1.5) seem to be at the latest version currently available.

library(readr)
packageVersion("readr")
packageVersion("vroom")
starts <- c(0, 13, 19, 26)
ends <- c(11, 17, 24, NA)


txt <- "ID           Arch  Saved  What
C014KLCJSHY  -     -      #string
C014QHAKJHY  -     -      #somethin"
cat(txt)

channel_ids <- read_fwf(
  file=  txt,
  col_positions = fwf_positions(starts, ends))

Will give:

*** caught segfault ***
address 0x7f6c910fbfff, cause 'memory not mapped'
Traceback:
1: vroom_fwf_(file, as.integer(col_positions$begin), as.integer(col_positions$end), trim_ws = trim_ws, col_names = col_positions$col_names, col_types = col_types, col_select = col_select, name_repair = .name_repair, id = id, na = na, guess_max = guess_max, skip = skip, comment = comment, skip_empty_rows = skip_empty_rows, n_max = n_max, num_threads = num_threads, altrep = vroom_altrep(altrep), locale = locale, progress = progress)
2: vroom::vroom_fwf(file, col_positions = col_positions, col_types = col_types, col_select = { { col_select } }, id = id, .name_repair = name_repair, locale = locale, na = na, comment = comment, skip_empty_rows = skip_empty_rows, trim_ws = trim_ws, skip = skip, n_max = n_max, guess_max = guess_max, show_col_types = show_col_types, progress = progress, altrep = lazy, num_threads = num_threads)
3: read_fwf(file = txt, col_positions = fwf_positions(starts, ends))
Possible actions:
1: abort (with core dump, if enabled)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions