mbutrovich commented on issue #21662:
URL: https://github.com/apache/datafusion/issues/21662#issuecomment-4261423160

   Reopening — the fix in #21663 removed the nested async block but miri still 
reports a Stacked Borrows violation at the same location (`opener.rs:1267`). 
The inlined code still reborrows `&mut self` across the `.await` yield point in 
`get_byte_ranges`, which conflicts with the subsequent 
`self.decoder.push_ranges()` call. Miri sees these as overlapping reborrows of 
the same `&mut self` even though they access disjoint fields.
   
   Reproducer: running Comet's miri tests against current DF main (commit 
2ef0217705) triggers this on 
`test_nested_types_extract_missing_struct_names_missing_field`. CI run: 
https://github.com/apache/datafusion-comet/actions/runs/24518967597/job/71671004017?pr=3916
   
   ```
   error: Undefined Behavior: trying to retag from <28193196> for 
SharedReadWrite permission at alloc8537353[0x8], but that tag does not exist in 
the borrow stack for this location
       --> datafusion/datasource-parquet/src/opener.rs:1267:45
        |
   1267 | ...                   if let Err(e) = 
self.decoder.push_ranges(ranges, data) {
        |                                       ^^^^^^^^^^^^ this error occurs 
as part of two-phase retag at alloc8537353[0x8..0x20]
   ```
   
   A possible fix would be to destructure `self` into its fields before the 
loop so that miri can see the disjoint borrows explicitly, e.g.:
   
   ```rust
   let Self { reader, decoder, baseline_metrics, .. } = self;
   // then use reader, decoder, baseline_metrics directly
   ```
   CC @Dandandan 


-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to