Zoltán Borók-Nagy created IMPALA-15858:
------------------------------------------

             Summary: Add fuzz tests for VARIANT values
                 Key: IMPALA-15858
                 URL: https://issues.apache.org/jira/browse/IMPALA-15858
             Project: IMPALA
          Issue Type: Sub-task
            Reporter: Zoltán Borók-Nagy


VARIANT values come from files written by other engines, and decoding them 
follows offsets, sizes and field ids that a corrupt or malicious file can set 
to anything. The tests cover hand-picked malformed values (IMPALA-15221) and 
corrupt files (IMPALA-15142), but nothing fuzzes VARIANT data: 
{{test_scanners_fuzz.py}} has no table with a VARIANT column. This was 
suggested in the review of IMPALA-15142.

Two kinds of tests would help:
* A scanner fuzz test on an Iceberg V3 table with VARIANT columns, e.g. 
{{trino_variant}}. {{run_fuzz_test()}} cannot be reused as is: it creates the 
table with CREATE TABLE LIKE and copies the corrupted files under it, which an 
Iceberg table does not pick up, and its {{SELECT DISTINCT *}} query is not 
allowed on VARIANT. The test needs to keep the Iceberg metadata and query the 
values with {{variant_to_json()}} and {{variant_get()}}.
* A BE test that mutates valid metadata and value blobs (flipped bytes, 
truncation, changed offsets and sizes) and passes them to 
{{VariantMetadata::Init()}}, path navigation, the typed getters, 
{{variant_get()}}/{{try_variant_get()}} and the JSON serializer. It should also 
run in the ASAN and UBSAN builds, where out-of-bounds reads show up.

In both tests a corrupt value must lead to an error, a warning or NULL, never 
to a crash, a DCHECK or a sanitizer report.



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

Reply via email to