Skip to content

Fuzzer crashes (2) #3959

Description

@aleksisch

Grammar-based fuzzer findings, continuing from #3892. Built from 5c734c4d6 with -DDAS_NO_ASSERTIONS=0CMakeCommon.txt defines DAS_NO_ASSERTIONS for Release, MinSizeRel and RelWithDebInfo, so a stock Release build never reaches these.

1. Oversized type as a function return type is not diagnosed, asserts in getStride

[export]
def f => <- tuple<int[2000000000]>(uninitialized)

[export]
def main { }
$ daslang t.das
assertion failed: stride <= 0x7fffffff, src/ast/ast_typedecl.cpp:3506
stride too big 8000000000

The same type as a local is diagnosed properly — var t = tuple<int[2000000000]>(uninitialized) gives error[30508] — so the check exists but does not cover a function return type. Related to #3892 (comment 8), which reaches getSizeOf at ast_typedecl.cpp:3486 through default<T>: same missing check, different entry point and different assertion.

2. Two chained vector conversions on Point3 emit an ambiguous cvt_pass

require UnitTest

[export]
def main {
    var v = getSamplePoint3() |> uint3 |> int3
}
$ daslang -aot t.das t.cpp
t.cpp:79:30: error: call to 'cvt_pass' is ambiguous
   79 |     int3 __v_rename_at_5_0 = cvt_pass(cvt_uint3(das_alias<Point3>::from(getSamplePoint3())));
      |                              ^~~~~~~~
include/daScript/simulate/aot.h:4506:25: note: candidate function
 4506 |     __forceinline vec4f cvt_pass ( int2 i )  { return i; }

Two conversions are required — a single |> uint3 compiles. int3(1,2,3) in place of getSamplePoint3() compiles, so the das_alias<Point3> wrapper is what makes the overload set ambiguous.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions