flavray / pyavro-rs

Python wrapper around avro-rs and avro-rs-ffi

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Core dump when using pyavro-rs

brunteman opened this issue · comments

Hi,

I tried to use the pyavro-rs module to do some avro experiments and got a core dump. I managed to make a small example of it.
I don't know if there is an actual issue here or if I am just doing something that's really not good, but I guess it shouldn't fail like this either way.

Here's the code that I used to get the crash:

import struct
from pyavro_rs import Schema, schemaless_write

SCHEMA = Schema('''{ "type": "record",
                "name": "Something",
                "fields":
                [
                  {
                    "name": "something",
                    "type": { 
                       "type": "fixed",
                       "name": "SomethingElse",
                       "size": 4
                    }
                  }
                ]
              }''')

def test_core_file_generation():
    schemaless_write(SCHEMA, {'something': struct.pack("i", 0)})

if __name__ == '__main__':
    test_core_file_generation()

I did manage to get this code to work when I changed the "fixed" field to just an integer, so in general it seems to work fine.
I've used similar code with both the "official" avro module as well as with fastavro and it seems to be working fine there.

I guess the stack trace won't tell you much but the error message is:

*** Error in `python': munmap_chunk(): invalid pointer: 0x00007f9fdeace730 ***

Other information:

$ uname -a; python --version
Linux elxaf84z7h2 4.15.0-46-generic #49~16.04.1-Ubuntu SMP Tue Feb 12 17:45:24 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
Python 3.7.2

Any other info needed, just ask.
BR
/Mattias

Yeah, looks like a proper bug. It's a while we don't update the inner rust for this project. We might want to do that first and try to reproduce again.