Git Product home page Git Product logo

Comments (5)

QrczakMK avatar QrczakMK commented on May 6, 2024

The error indicates dereferencing a null pointer and accessing its field at offset 0xc0.

Depending on how RecordWriter template is instantiated and which constructor of RecordWriter is called, you might need move constructor and move assignment. Compiler-generated ones might be correct or not, depending on member variables of your class.

You likely need to also override Done (and call BufferedWriter::Done() in it), assuming that the stream needs to be closed somehow and that closing it might fail.

FdWriter might be hard to follow because it derives from FdWriterBase (for functionality common between FdWriter template instantiations) and FdWriterCommon (for functionality common between FdWriterBase and FdStreamWriterBase). If you do not need a configurable policy regarding owning the underlying Amazon S3 stream, your class does not have to be a template, so it would look more like FdWriter + FdWriterBase + FdWriterCommon flattened. Other aspects of FdWriter (like dest_fd, dest, Reset) are provided for completeness or efficiency and do not need to be emulated.

If you can show the code, I could try to find the error.

from riegeli.

CodeArno avatar CodeArno commented on May 6, 2024

Thank you for your quick response!
My code is here: https://gist.github.com/CodeArno/d922d50de4bd3624b8750fc2b717fc9d
Other than the line "Initialize for..." from initialize() nothing gets logged, so it doesn't seem like any of my other methods ever get called.

from riegeli.

QrczakMK avatar QrczakMK commented on May 6, 2024

The appropriate base class constructor must be called:

RiegeliS3Writer::RiegeliS3Writer(
    Aws::S3::S3Client* s3_client, const std::string& bucket_name, const std::string& key_path)
    : riegeli::BufferedWriter(riegeli::kDefaultBufferSize),
      s3_client_(s3_client), bucket_name_(bucket_name), key_path_(key_path) {
  initialize();
}

The default constructor constructs a dummy closed object.

I will think what to do to make it more clear or to let it fail in a more obvious way.

from riegeli.

CodeArno avatar CodeArno commented on May 6, 2024

That did it - everything works now. Thank you so much!

from riegeli.

QrczakMK avatar QrczakMK commented on May 6, 2024

6d4d59c should make this a tiny bit more helpful.

from riegeli.

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.