Skip to content

Commit

Permalink
Legacy reader: reading non written region causes segfault. (#4253)
Browse files Browse the repository at this point in the history
This fixes an issue with legacy dense reads where reading a region that is not written causes segfault. In this case, the reader generates a cell slab with a nullptr tile, which signals the copy function to return the fill value for those cells. The nullptr value was causing an issue when trying to determine if a field is present or not.

---
TYPE: IMPROVEMENT
DESC: Legacy reader: reading non written region causes segfault.
  • Loading branch information
KiterLuc authored Aug 8, 2023
1 parent 9e0e1a2 commit 64b2f64
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tiledb/sm/query/legacy/reader.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1016,8 +1016,8 @@ Status Reader::copy_partitioned_fixed_cells(
// for this tile.
const bool split_buffer_for_zipped_coords =
is_dim && cs.tile_->stores_zipped_coords();
const bool field_not_present =
(is_dim || is_attr) && cs.tile_->tile_tuple(*name) == nullptr;
const bool field_not_present = (is_dim || is_attr) && cs.tile_ != nullptr &&
cs.tile_->tile_tuple(*name) == nullptr;
if ((cs.tile_ == nullptr || field_not_present) &&
!split_buffer_for_zipped_coords) { // Empty range or attributed added
// in schema evolution
Expand Down

0 comments on commit 64b2f64

Please sign in to comment.