Coder Social home page Coder Social logo

Getting Segfault writing feather about feather HOT 9 CLOSED

wesm avatar wesm commented on June 25, 2024
Getting Segfault writing feather

from feather.

Comments (9)

hadley avatar hadley commented on June 25, 2024

Can you please provide a reproducible example, preferably without any data.table? (to ensure that isn't the root cause)

from feather.

shapenaji avatar shapenaji commented on June 25, 2024

I'll see what I can do, there are a lot of random characters in this df, (and for proprietary reasons, I unfortunately can't include it, I'll see if I can find a subset where it's the case), maybe I can randomly sample the characters in my fields...

from feather.

shapenaji avatar shapenaji commented on June 25, 2024

Reproduced it, it's coming from fread, read.csv does not trigger it, but I can't seem to generate it with random data. Trying to figure out which one it is

from feather.

hadley avatar hadley commented on June 25, 2024

Try narrowing down to a specific column - the most likely culprit is likely to be a character column, given that read.csv() doesn't illustrate the problem.

from feather.

shapenaji avatar shapenaji commented on June 25, 2024

Sorry for the delay: Got it, seems to have to do with empty characters.

here we go:

library(data.table)
library(feather)
write.csv(data.table(x = rep('',5)),'test.csv')
z <- fread('test.csv', data.table = FALSE)
write_feather(z,  'testfeath')

from feather.

hadley avatar hadley commented on June 25, 2024

Doesn't seem to be anything to do with data.table:

write_feather(data.frame(x = rep('',5)), "test.feather")

@wesm Am I doing something wrong here? Here's the backtrace:

* thread #1: tid = 0x177ea17, 0x000000010a8f9e07 feather.so`chrToPrimitiveArray(SEXPREC*) [inlined] feather::Buffer::data(this=<unavailable>) const + 7 at buffer.h:51, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x10)
  * frame #0: 0x000000010a8f9e07 feather.so`chrToPrimitiveArray(SEXPREC*) [inlined] feather::Buffer::data(this=<unavailable>) const + 7 at buffer.h:51
    frame #1: 0x000000010a8f9e00 feather.so`chrToPrimitiveArray(x=0x00007fff5fbfcdc0) + 704 at feather-write.cpp:221
    frame #2: 0x000000010a8fa5b7 feather.so`addCategoryColumn(table=0x00007fff5fbfcef8, name="x", x=0x000000010588dd28) + 119 at feather-write.cpp:265
    frame #3: 0x000000010a8fabfb feather.so`addColumn(table=0x00007fff5fbfcef8, name="x", x=0x000000010588dd28) + 59 at feather-write.cpp:314
    frame #4: 0x000000010a8faeda feather.so`writeFeather(df=Rcpp::DataFrame @ 0x00007fff5fbfcfa0, path=<unavailable>) + 538 at feather-write.cpp:340

I think the problem is that because there are only empty strings, the size_ of the BufferBuilder is 0 and data_ is a nullptr.

from feather.

wesm avatar wesm commented on June 25, 2024

I'm able to get a core dump in Python, too. Patch incoming

from feather.

wesm avatar wesm commented on June 25, 2024

Can you confirm #86 fixes the bug in R, too?

from feather.

shapenaji avatar shapenaji commented on June 25, 2024

Works for me! Thank you!

from feather.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.