AndreaBozzo commented on issue #7136:
URL: https://github.com/apache/arrow-rs/issues/7136#issuecomment-6447502080
Still reachable on 60.0.0, shall i take?
Repro (`arrow = { version = "=60.0.0", default-features = false, features =
["ffi"] }`, `cargo run` in debug):
```rust
use arrow::array::{Array, StringArray, make_array};
use arrow::buffer::Buffer;
use arrow::datatypes::DataType;
use arrow::ffi::{FFI_ArrowArray, FFI_ArrowSchema, from_ffi};
fn main() {
let strings = StringArray::from(vec!["a", "bb", "ccc"]);
let offsets = strings.offsets().inner().inner().as_slice();
// Same offsets, placed one byte past an aligned address.
let mut bytes = vec![0u8];
bytes.extend_from_slice(offsets);
let misaligned = Buffer::from_vec(bytes).slice(1);
assert_ne!(misaligned.as_ptr() as usize % 4, 0);
let data = unsafe {
arrow::array::ArrayData::builder(DataType::Utf8)
.len(strings.len())
.add_buffer(misaligned)
.add_buffer(strings.values().clone())
.build_unchecked()
};
let array = FFI_ArrowArray::new(&data);
let schema = FFI_ArrowSchema::try_from(&DataType::Utf8).unwrap();
let imported = unsafe { from_ffi(array, &schema) }.unwrap();
println!("{:?}", make_array(imported));
}
```
```
thread 'main' panicked at arrow-array-60.0.0/src/ffi.rs:495:27:
misaligned pointer dereference: address must be a multiple of 0x4 but is
0x1b16d906b4d
thread caused non-unwinding panic. aborting.
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]