Hi all,

I have been running fuzz tests on arrow C FFI and noticed an interesting edge 
case that I couldn't find an answer in the docs/code for. The format spec has 
field names as flatbuffer string 
https://github.com/apache/arrow/blob/39125bac3960fb0a0625d924b5b3fe174974f530/format/Schema.fbs#L514
 which is as defined in https://flatbuffers.dev/schema/#scalars is

> Strings (indicated by `string`) are zero-terminated strings, prefixed by 
> their length. Strings may only hold UTF-8 or 7-bit ASCII. For other text 
> encodings or general binary data use vectors (`[byte]` or `[ubyte]`) instead.

The C FFI interface specifies the schema names as regular char * in 
https://github.com/apache/arrow/blob/39125bac3960fb0a0625d924b5b3fe174974f530/cpp/src/arrow/c/abi.h#L53.
 

The question I have is whether there should be duality between the IPC and C 
FFI apis, i.e. should they all handle the same schemas and array. What the 
fuzzer have found is that column names of shape "abc\0def\0" don't correctly 
roundtrip through C FFI. The arrow-rs has an interesting case that it detects 
this case and panics in 
https://github.com/apache/arrow-rs/blob/52920f946cf8aa038d04fe432e77889f8253b7ce/arrow-schema/src/ffi.rs#L174.
 

I am curious to know where do you think validation should live or even if there 
should be any and we should just let the users decide how they want to deal 
with it?

Best,
Robert

Reply via email to