Skip to content

[C++] segfault when writing CSV from RecordBatchReader #30636

Closed

Description

@asfimport

I'm currently trying to implement functionality in R so that we can open a dataset and then write to a CSV file, but I'm getting a segfault when I run my tests:

 

tbl <- tibble::tibble(
  dbl = c(1:8, NA, 10) + .1,
  lgl = sample(c(TRUE, FALSE, NA), 10, replace = TRUE),
  false = logical(10),
  chr = letters[c(1:5, NA, 7:10)]
)

make_temp_dir <- function() {
  path <- tempfile()
  dir.create(path)
  normalizePath(path, winslash = "/")
}

data_dir <- make_temp_dir()
write_dataset(tbl, data_dir, partitioning = "lgl")
data_in <- open_dataset(data_dir)

csv_file <- tempfile()
tbl_out <- write_csv_arrow(data_in, csv_file)

 

Thread 1 "R" received signal SIGSEGV, Segmentation fault.
0x00007fffee51fdd7 in __gnu_cxx::__exchange_and_add (__mem=0xe9, __val=-1)
    at /usr/include/c++/9/ext/atomicity.h:49
49	  { return __atomic_fetch_add(__mem, __val, __ATOMIC_ACQ_REL); }

Reporter: Nicola Crane / @thisisnic
Assignee: Ákos Hadnagy / @ahadnagy

Related issues:

Note: This issue was originally created as ARROW-15128. Please see the migration documentation for further details.

Activity

  1. asfimport commented on Dec 20, 2021

    @asfimport
    Author

    Nicola Crane / @thisisnic:
    @ahadnagy Just wanted to check if this looks obvious to you what's happening here, as I know you implemented the original code that implemented the C++ capabilities here? Thank you! :)

  2. asfimport commented on Dec 20, 2021

    @asfimport
    Author

    Ákos Hadnagy / @ahadnagy:
    Hmm, not as of yet. :( I'll try to reproduce it in C++. Thanks for letting me know!

  3. asfimport commented on Feb 1, 2022

    @asfimport
    Author

    Nicola Crane / @thisisnic:
    Was doing the wrong thing here, this works fine

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions