Skip to content

Stage2: validate packed struct field types #12277

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Aug 2, 2022

Conversation

Vexu
Copy link
Member

@Vexu Vexu commented Jul 28, 2022

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 Vexu force-pushed the stage2-compile-errors branch 4 times, most recently from 2b31115 to cfc1141 Compare July 29, 2022 11:02
@Vexu
Copy link
Member Author

Vexu commented Jul 29, 2022

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
Copy link
Member Author

Vexu commented Jul 29, 2022

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

@andrewrk
Copy link
Member

andrewrk commented Jul 29, 2022

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.

@Vexu Vexu force-pushed the stage2-compile-errors branch 2 times, most recently from bb08eee to 843b2dd Compare August 1, 2022 20:05
@Vexu Vexu force-pushed the stage2-compile-errors branch 2 times, most recently from 8e46b7a to 991185c Compare August 1, 2022 20:45
@Vexu Vexu force-pushed the stage2-compile-errors branch from 991185c to e47706f Compare August 1, 2022 20:59
@Vexu Vexu merged commit 4831c1c into ziglang:master Aug 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants