[ 
https://issues.apache.org/jira/browse/ARROW-8627?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Mahmut Bulut updated ARROW-8627:
--------------------------------
    Description: 
Currently, there is an invalid access happening through the append_n method to 
a mutable location with multiple shared refs. Happens when benchmark code 
executes with `bench_bool`.

Happens on (rustc 1.44.0-nightly (45d050cde 2020-04-21))

 

bt shown below:

```
 * thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS 
(code=1, address=0x1004e7000)
 * frame #0: 0x0000000100150d37 
builder-6a49123b1fedb178`_$LT$arrow..array..builder..BufferBuilder$LT$arrow..datatypes..BooleanType$GT$$u20$as$u20$arrow..array..builder..BufferBuilderTrait$LT$arrow..datatypes..BooleanType$GT$$GT$::append_n::h6ae4d34cca93d03c
 + 311
 frame #1: 0x0000000100007303 
builder-6a49123b1fedb178`arrow::array::builder::PrimitiveBuilder$LT$T$GT$::append_slice::h8d33144acea1616b
 + 51
 frame #2: 0x000000010001b143 
builder-6a49123b1fedb178`criterion::Bencher$LT$M$GT$::iter::hfcae173a53b56e6f + 
259
 frame #3: 0x0000000100003136 
builder-6a49123b1fedb178`_$LT$criterion..routine..Function$LT$M$C$F$C$T$GT$$u20$as$u20$criterion..routine..Routine$LT$M$C$T$GT$$GT$::warm_up::h5b415f52c0951798
 + 102
 frame #4: 0x000000010000373b 
builder-6a49123b1fedb178`criterion::routine::Routine::sample::h2802012b9b92a2a5 
+ 203
 frame #5: 0x00000001000287a2 
builder-6a49123b1fedb178`criterion::analysis::common::h1eabf5af2afe42e5 + 834
 frame #6: 0x0000000100023a83 
builder-6a49123b1fedb178`_$LT$criterion..benchmark..Benchmark$LT$M$GT$$u20$as$u20$criterion..benchmark..BenchmarkDefinition$LT$M$GT$$GT$::run::hf631a3f91617ae46
 + 1507
 frame #7: 0x00000001000109b8 
builder-6a49123b1fedb178`builder::main::he83c09c3b2c8f318 + 216
 frame #8: 0x0000000100021c96 
builder-6a49123b1fedb178`std::rt::lang_start::_$u7b$$u7b$closure$u7d$$u7d$::hfb404fc983af2389
 + 6
 frame #9: 0x00000001001e9499 
builder-6a49123b1fedb178`std::rt::lang_start_internal::h434140244059d623 
[inlined] 
std::rt::lang_start_internal::_$u7b$$u7b$closure$u7d$$u7d$::h096599b40842db82 
at rt.rs:52:13 [opt]
 frame #10: 0x00000001001e948e 
builder-6a49123b1fedb178`std::rt::lang_start_internal::h434140244059d623 
[inlined] std::panicking::try::do_call::h1c9f73590350b657 at panicking.rs:331 
[opt]
 frame #11: 0x00000001001e948e 
builder-6a49123b1fedb178`std::rt::lang_start_internal::h434140244059d623 
[inlined] std::panicking::try::hca6829be93a31f1b at panicking.rs:274 [opt]
 frame #12: 0x00000001001e948e 
builder-6a49123b1fedb178`std::rt::lang_start_internal::h434140244059d623 
[inlined] std::panic::catch_unwind::hb3c8ad89db0960bd at panic.rs:394 [opt]
 frame #13: 0x00000001001e948e 
builder-6a49123b1fedb178`std::rt::lang_start_internal::h434140244059d623 at 
rt.rs:51 [opt]
 frame #14: 0x0000000100010b49 builder-6a49123b1fedb178`main + 41
 frame #15: 0x00007fff691c07fd libdyld.dylib`start + 1
 frame #16: 0x00007fff691c07fd libdyld.dylib`start + 1

```

  was:
Currently, there is an invalid access happening through the append_n method to 
a mutable location with multiple shared refs. Happens when benchmark code 
executes with `bench_bool`.

bt shown below:

```
 * thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS 
(code=1, address=0x1004e7000)
 * frame #0: 0x0000000100150d37 
builder-6a49123b1fedb178`_$LT$arrow..array..builder..BufferBuilder$LT$arrow..datatypes..BooleanType$GT$$u20$as$u20$arrow..array..builder..BufferBuilderTrait$LT$arrow..datatypes..BooleanType$GT$$GT$::append_n::h6ae4d34cca93d03c
 + 311
 frame #1: 0x0000000100007303 
builder-6a49123b1fedb178`arrow::array::builder::PrimitiveBuilder$LT$T$GT$::append_slice::h8d33144acea1616b
 + 51
 frame #2: 0x000000010001b143 
builder-6a49123b1fedb178`criterion::Bencher$LT$M$GT$::iter::hfcae173a53b56e6f + 
259
 frame #3: 0x0000000100003136 
builder-6a49123b1fedb178`_$LT$criterion..routine..Function$LT$M$C$F$C$T$GT$$u20$as$u20$criterion..routine..Routine$LT$M$C$T$GT$$GT$::warm_up::h5b415f52c0951798
 + 102
 frame #4: 0x000000010000373b 
builder-6a49123b1fedb178`criterion::routine::Routine::sample::h2802012b9b92a2a5 
+ 203
 frame #5: 0x00000001000287a2 
builder-6a49123b1fedb178`criterion::analysis::common::h1eabf5af2afe42e5 + 834
 frame #6: 0x0000000100023a83 
builder-6a49123b1fedb178`_$LT$criterion..benchmark..Benchmark$LT$M$GT$$u20$as$u20$criterion..benchmark..BenchmarkDefinition$LT$M$GT$$GT$::run::hf631a3f91617ae46
 + 1507
 frame #7: 0x00000001000109b8 
builder-6a49123b1fedb178`builder::main::he83c09c3b2c8f318 + 216
 frame #8: 0x0000000100021c96 
builder-6a49123b1fedb178`std::rt::lang_start::_$u7b$$u7b$closure$u7d$$u7d$::hfb404fc983af2389
 + 6
 frame #9: 0x00000001001e9499 
builder-6a49123b1fedb178`std::rt::lang_start_internal::h434140244059d623 
[inlined] 
std::rt::lang_start_internal::_$u7b$$u7b$closure$u7d$$u7d$::h096599b40842db82 
at rt.rs:52:13 [opt]
 frame #10: 0x00000001001e948e 
builder-6a49123b1fedb178`std::rt::lang_start_internal::h434140244059d623 
[inlined] std::panicking::try::do_call::h1c9f73590350b657 at panicking.rs:331 
[opt]
 frame #11: 0x00000001001e948e 
builder-6a49123b1fedb178`std::rt::lang_start_internal::h434140244059d623 
[inlined] std::panicking::try::hca6829be93a31f1b at panicking.rs:274 [opt]
 frame #12: 0x00000001001e948e 
builder-6a49123b1fedb178`std::rt::lang_start_internal::h434140244059d623 
[inlined] std::panic::catch_unwind::hb3c8ad89db0960bd at panic.rs:394 [opt]
 frame #13: 0x00000001001e948e 
builder-6a49123b1fedb178`std::rt::lang_start_internal::h434140244059d623 at 
rt.rs:51 [opt]
 frame #14: 0x0000000100010b49 builder-6a49123b1fedb178`main + 41
 frame #15: 0x00007fff691c07fd libdyld.dylib`start + 1
 frame #16: 0x00007fff691c07fd libdyld.dylib`start + 1

```


> [Rust] Invalid mem access in BufferBuilderTrait
> -----------------------------------------------
>
>                 Key: ARROW-8627
>                 URL: https://issues.apache.org/jira/browse/ARROW-8627
>             Project: Apache Arrow
>          Issue Type: Bug
>          Components: Rust
>            Reporter: Mahmut Bulut
>            Priority: Major
>
> Currently, there is an invalid access happening through the append_n method 
> to a mutable location with multiple shared refs. Happens when benchmark code 
> executes with `bench_bool`.
> Happens on (rustc 1.44.0-nightly (45d050cde 2020-04-21))
>  
> bt shown below:
> ```
>  * thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS 
> (code=1, address=0x1004e7000)
>  * frame #0: 0x0000000100150d37 
> builder-6a49123b1fedb178`_$LT$arrow..array..builder..BufferBuilder$LT$arrow..datatypes..BooleanType$GT$$u20$as$u20$arrow..array..builder..BufferBuilderTrait$LT$arrow..datatypes..BooleanType$GT$$GT$::append_n::h6ae4d34cca93d03c
>  + 311
>  frame #1: 0x0000000100007303 
> builder-6a49123b1fedb178`arrow::array::builder::PrimitiveBuilder$LT$T$GT$::append_slice::h8d33144acea1616b
>  + 51
>  frame #2: 0x000000010001b143 
> builder-6a49123b1fedb178`criterion::Bencher$LT$M$GT$::iter::hfcae173a53b56e6f 
> + 259
>  frame #3: 0x0000000100003136 
> builder-6a49123b1fedb178`_$LT$criterion..routine..Function$LT$M$C$F$C$T$GT$$u20$as$u20$criterion..routine..Routine$LT$M$C$T$GT$$GT$::warm_up::h5b415f52c0951798
>  + 102
>  frame #4: 0x000000010000373b 
> builder-6a49123b1fedb178`criterion::routine::Routine::sample::h2802012b9b92a2a5
>  + 203
>  frame #5: 0x00000001000287a2 
> builder-6a49123b1fedb178`criterion::analysis::common::h1eabf5af2afe42e5 + 834
>  frame #6: 0x0000000100023a83 
> builder-6a49123b1fedb178`_$LT$criterion..benchmark..Benchmark$LT$M$GT$$u20$as$u20$criterion..benchmark..BenchmarkDefinition$LT$M$GT$$GT$::run::hf631a3f91617ae46
>  + 1507
>  frame #7: 0x00000001000109b8 
> builder-6a49123b1fedb178`builder::main::he83c09c3b2c8f318 + 216
>  frame #8: 0x0000000100021c96 
> builder-6a49123b1fedb178`std::rt::lang_start::_$u7b$$u7b$closure$u7d$$u7d$::hfb404fc983af2389
>  + 6
>  frame #9: 0x00000001001e9499 
> builder-6a49123b1fedb178`std::rt::lang_start_internal::h434140244059d623 
> [inlined] 
> std::rt::lang_start_internal::_$u7b$$u7b$closure$u7d$$u7d$::h096599b40842db82 
> at rt.rs:52:13 [opt]
>  frame #10: 0x00000001001e948e 
> builder-6a49123b1fedb178`std::rt::lang_start_internal::h434140244059d623 
> [inlined] std::panicking::try::do_call::h1c9f73590350b657 at panicking.rs:331 
> [opt]
>  frame #11: 0x00000001001e948e 
> builder-6a49123b1fedb178`std::rt::lang_start_internal::h434140244059d623 
> [inlined] std::panicking::try::hca6829be93a31f1b at panicking.rs:274 [opt]
>  frame #12: 0x00000001001e948e 
> builder-6a49123b1fedb178`std::rt::lang_start_internal::h434140244059d623 
> [inlined] std::panic::catch_unwind::hb3c8ad89db0960bd at panic.rs:394 [opt]
>  frame #13: 0x00000001001e948e 
> builder-6a49123b1fedb178`std::rt::lang_start_internal::h434140244059d623 at 
> rt.rs:51 [opt]
>  frame #14: 0x0000000100010b49 builder-6a49123b1fedb178`main + 41
>  frame #15: 0x00007fff691c07fd libdyld.dylib`start + 1
>  frame #16: 0x00007fff691c07fd libdyld.dylib`start + 1
> ```



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to