Skip to content

Get third party project "zig-gamedev" working successfully with self-hosted #12552

Closed
@michal-z

Description

@michal-z

Zig Version

0.10.0-dev.3659+e5e6eb983

Steps to Reproduce

The problem occurs only on macOS AArch64 with stage2 and stage3 (works correctly on Windows, Linux and macOS x86_64 with stage1/stage2/stage3).

  1. git clone https://github.com/michal-z/zig-gamedev
  2. cd zig-gamedev
  3. zig build audio_experiments_wgpu-run
  4. Crash in the sample application (looks like miscompilation)

Expected Behavior

Sample application works correctly.

Actual Behavior

[zgpu] High-performance device has been selected:
[zgpu]   Name: Apple M1 Max
[zgpu]   Driver: Metal driver on macOS Version 12.5 (Build 21G72)
[zgpu]   Adapter type: discrete_gpu
[zgpu]   Backend type: metal
Segmentation fault at address 0xbb1b259f81cd0091
???:?:?: 0x1028743d0 in _ma_waveform_config_init (???)
/Users/jonas/src/zig/zig-gamedev/samples/audio_experiments_wgpu/src/audio_experiments_wgpu.zig:358:35: 0x1023c9523 in create (audio_experiments_wgpu)
        audio.engine.getSampleRate(),
                                  ^
/Users/jonas/src/zig/zig-gamedev/samples/audio_experiments_wgpu/src/audio_experiments_wgpu.zig:1001:28: 0x1023d1d77 in main (audio_experiments_wgpu)
    const demo = try create(allocator, window);
                           ^
/Users/jonas/src/zig/zig/build/stage3/lib/zig/std/start.zig:574:37: 0x1023d62eb in main (audio_experiments_wgpu)
        },
                                    ^
???:?:?: 0x10364508b in ??? (???)
???:?:?: 0x1e1f7fffffffffff in ??? (???)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugObserved behavior contradicts documented or intended behaviorfrontendTokenization, parsing, AstGen, Sema, and Liveness.miscompilationThe compiler reports success but produces semantically incorrect code.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions