microsoft / microsoft/DirectXShaderCompiler

Fix UBSAN alignment failures

Open
#5,804 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug tech-debt
Dominant language
C++
Stars
3.7k
Forks
900
Avg merge
2d 11h
Merged PRs (30d)
44

Description

In this PR, UBSAN's alignment sanitizer is disabled.

I attempted to address these with a short-term fix (see this commit and this Godbolt code), but unfortunately, the code that makes use of the CheckedReaderWriter, such as in DxilPipelineStateValidation::ReadOrWrite, was just becoming too gnarly and difficult to read. @llvm-beanz has reimplemented this code in upstream Clang properly, and perhaps at some point, we can back-port that code into DXC.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing PR 5803, the CheckedReaderWriter usage in DxilPipelineStateValidation::ReadOrWrite, and the linked upstream Clang reimplementation. Determine whether that implementation can be back-ported into DXC; done means UBSAN alignment sanitization can be enabled without the reported failures.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
compilers
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.