Skip to content

spirv-fuzz: Segmentation fault in FuzzerPassInterchangeZeroLikeConstants::FindOrCreateToggledConstant #3663

@andreperezmaselco

Description

@andreperezmaselco
Program received signal SIGSEGV, Segmentation fault.
0x0000555555daae30 in
spvtools::fuzz::FuzzerPassInterchangeZeroLikeConstants::FindOrCreateToggledConstant
at source/fuzz/fuzzer_pass_interchange_zero_like_constants.cpp:41

Debugging spirv-fuzz, I found that the segmentation fault is caused because FindDeclaredConstant returns a null pointer that is used to call a function.

auto constant = GetIRContext()->get_constant_mgr()->FindDeclaredConstant(declaration->result_id());

if (!constant->IsZero()) {
  return 0;
}

declaration is %10 = OpSpecConstant %5 1, but opt::analysis::ConstantManager does not support OpSpecConstant.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions