abs-tudelft / fletcher

Fletcher: A framework to integrate FPGA accelerators with Apache Arrow
https://abs-tudelft.github.io/fletcher/
Apache License 2.0
217 stars 31 forks source link

Queueing RecordBatch results in a segfault for snap platform. #174

Closed EraYaN closed 4 years ago

EraYaN commented 5 years ago

Describe the bug Calling the function queue_record_batch with an input batch that results from a RecordBatchFileReader.get_batch call, results in a segfault

To Reproduce

    parser = argparse.ArgumentParser()
    parser.add_argument("schema_path")
    parser.add_argument("input_path")
    parser.add_argument("output_path")
    args = parser.parse_args()

    schema = pa.read_schema(args.schema_path)
    # Set up a RecordBatch reader and read the RecordBatch.
    reader = pa.RecordBatchFileReader(args.input_path)
    input_batch = reader.get_batch(0)

    output_batch = pa.RecordBatch.from_arrays([pa.array([0] * input_batch.num_rows, pa.uint32())],schema)

    print("Got the batches.")

    platform = pf.Platform("snap", False)                         # Create an interface to an auto-detected FPGA Platform.
    platform.init()                                  # Initialize the Platform.

    print("Initialized platform.")
    context = pf.Context(platform)                   # Create a Context for our data on the Platform.
    print("Created context.")
    context.queue_record_batch(input_batch)                # Queue the RecordBatch to the Context.
    print("Queued record output batch.")
    context.queue_record_batch(output_batch)                # Queue the RecordBatch to the Context.
    print("Queued record output batch.")
    context.enable()                                 # Enable the Context, (potentially transferring the data to FPGA).

Run this and the code will fail right after printing: Created context. schema_path is the output schema used for the output_path

Expected behavior To continue, just like the same function call in the C++ runtime.

mbrobbel commented 5 years ago

I'm unable to reproduce the segfault. Can you elaborate a bit on how to reproduce this? Did it work for simulation?

johanpel commented 4 years ago

Since we cannot reproduce this, I will close it until someone runs into it again.