Commit 5c9f9dd
fix: Add missing metadataFilter_ transfer for split prefetch (#15385)
Summary:
Pull Request resolved: #15385
We're seeing crash when prefetch is turned on, ASAN log P2022180855
In `setFromDataSource`:
1. `scanSpec_ = std::move(source->scanSpec_);` - The scanSpec is moved from old source to new one
2. The `scanSpec_` contains raw pointers*to Filter objects owned by `source->metadataFilter_`
3. But `metadataFilter_` is **NOT** transferred from source to this
4. When `sourceUnique` (the old source) is destroyed at the end of the function, `source->metadataFilter_` is destroyed
5. The `scanSpec_` in the new HiveDataSource now has **dangling pointers** to the destroyed Filters
6. Later async operations try to use these pointers → heap-use-after-free
Reviewed By: Yuhta
Differential Revision: D86178967
fbshipit-source-id: 26bdd74a1339f38472ada0ef2308624898c713011 parent e174b46 commit 5c9f9dd
File tree
2 files changed
+48
-0
lines changed- velox
- connectors/hive
- exec/tests
2 files changed
+48
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
505 | 505 | | |
506 | 506 | | |
507 | 507 | | |
| 508 | + | |
508 | 509 | | |
509 | 510 | | |
510 | 511 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4318 | 4318 | | |
4319 | 4319 | | |
4320 | 4320 | | |
| 4321 | + | |
| 4322 | + | |
| 4323 | + | |
| 4324 | + | |
| 4325 | + | |
| 4326 | + | |
| 4327 | + | |
| 4328 | + | |
| 4329 | + | |
| 4330 | + | |
| 4331 | + | |
| 4332 | + | |
| 4333 | + | |
| 4334 | + | |
| 4335 | + | |
| 4336 | + | |
| 4337 | + | |
| 4338 | + | |
| 4339 | + | |
| 4340 | + | |
| 4341 | + | |
| 4342 | + | |
| 4343 | + | |
| 4344 | + | |
| 4345 | + | |
| 4346 | + | |
| 4347 | + | |
| 4348 | + | |
| 4349 | + | |
| 4350 | + | |
| 4351 | + | |
| 4352 | + | |
| 4353 | + | |
| 4354 | + | |
| 4355 | + | |
| 4356 | + | |
| 4357 | + | |
| 4358 | + | |
| 4359 | + | |
| 4360 | + | |
| 4361 | + | |
| 4362 | + | |
| 4363 | + | |
| 4364 | + | |
| 4365 | + | |
| 4366 | + | |
| 4367 | + | |
4321 | 4368 | | |
4322 | 4369 | | |
4323 | 4370 | | |
| |||
0 commit comments