zig icon indicating copy to clipboard operation
zig copied to clipboard

Stage2: validate packed struct field types

Open Vexu opened this issue 3 years ago • 3 comments

This is a best-effort implementation since my understanding of the current accepted semantics for packed structs is a bit hazy and none of the proposals list all the allowed types.

Vexu avatar Jul 28 '22 20:07 Vexu

compiler [222/1114] compile_errors/packed_struct_with_fields_of_not_allowed_types (stage2, nati... 
Unexpected error:
================================================================================
./zig-cache/tmp/plW0auczXefu6bBW/tmp.zig:51:8: error: unable to codegen: InputOutput
================================================================================
update_index=0

How do I debug this?

Vexu avatar Jul 29 '22 11:07 Vexu

ci.ziglang is hitting #12288 (at least locally), drone is hitting #11871, and sourcehut is hitting some sort of disk failure?

Vexu avatar Jul 29 '22 17:07 Vexu

How do I debug this?

In order of increasing pain,

  1. Run the test locally
  2. Run the test locally with Valgrind
  3. Get the other CI runs to pass first; maybe it is related
  4. Run the test locally with a debug LLVM (assertions enabled)
  5. Hack the std lib and compiler, delete all the irrelevant CI stuff, and insert logs everywhere to track down what's going on, and try to collect more information from the CI about what is happening

Drone is not failing due to #11871, it is failing due to

safety/pointer casting null to non-optional pointer (stage1, native) failed: TestExpectedEqual
safety/pointer slice sentinel mismatch (stage1, native) failed: TestExpectedEqual
safety/shift left by huge amount (stage1, native) failed: TestExpectedEqual
safety/shift right by huge amount (stage1, native) failed: TestExpectedEqual
safety/signed integer division overflow (stage1, native) failed: TestExpectedEqual
safety/slice sentinel mismatch - floats (stage1, native) failed: TestExpectedEqual
safety/slice with sentinel out of bounds (stage1, native) failed: TestExpectedEqual
safety/slicing null C pointer (stage1, native) failed: TestExpectedEqual
safety/switch on corrupted union value (stage1, native) failed: TestExpectedEqual

For ci.ziglang.org, as of now, the failing test from #12288 is disabled.

andrewrk avatar Jul 29 '22 18:07 andrewrk