Skip to content
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

OOM triggered when compiling wgsl shader #2560

Closed
wgslfuzz opened this issue Oct 16, 2023 · 1 comment · Fixed by #2561
Closed

OOM triggered when compiling wgsl shader #2560

wgslfuzz opened this issue Oct 16, 2023 · 1 comment · Fixed by #2561
Labels
area: validation Validation of the IR kind: bug Something isn't working

Comments

@wgslfuzz
Copy link

On git commit 9eb3a1d naga some kind of resource exhaustion bug when executing naga input.wgsl output.hlsl. Setting a ulimit of 4GB terminates the execution, higher limit fail also.

memory allocation of 4294967296 bytes failed
[1]    1426281 IOT instruction (core dumped) 
@group(0) @binding(2) var g_4: texture_depth_2d_array;
@group(1025612598) @binding(3) var g_5: sampler_comparison;

@fragment
fn fs_main_without_storage() {
    let flip_correction = vec2<f32>(0.0, 0.0) ; 
    textureSampleCompareLevel(g_4, g_5, flip_correction, 0, 0.0); 
} 
@teoxoy
Copy link
Member

teoxoy commented Oct 16, 2023

Traced it down to this problematic code block:

naga/src/valid/interface.rs

Lines 771 to 773 in 9eb3a1d

while self.bind_group_masks.len() <= bind.group as usize {
self.bind_group_masks.push(BitSet::new());
}

@teoxoy teoxoy added this to the WGSL Specification V1 milestone Oct 16, 2023
@teoxoy teoxoy added kind: bug Something isn't working area: validation Validation of the IR labels Oct 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: validation Validation of the IR kind: bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants