[all-commits] [llvm/llvm-project] 9237b2: [DirectX] Fix IO sandbox violation in DXContainerP...

Joshua Batista via All-commits all-commits at lists.llvm.org
Wed Jun 17 14:57:51 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 9237b264dfc0ef910a08b4c18e5bc7628ffeb9d8
      https://github.com/llvm/llvm-project/commit/9237b264dfc0ef910a08b4c18e5bc7628ffeb9d8
  Author: Joshua Batista <jbatista at microsoft.com>
  Date:   2026-06-17 (Wed, 17 Jun 2026)

  Changed paths:
    M llvm/lib/Target/DirectX/DXContainerPDB.cpp

  Log Message:
  -----------
  [DirectX] Fix IO sandbox violation in DXContainerPDB pass (#204461)

`DXContainerPDB::runOnModule` writes a PDB file to disk via
`PDBFileBuilder::commit`, which calls through `MSFBuilder::commit`  ->
`FileOutputBuffer::create` -> `llvm::sys::fs::status()`. These are raw
filesystem APIs that trigger a fatal "IO sandbox violation" when the IO
sandbox is enabled.

The sandbox is enabled in `CC1Command::Execute` (Job.cpp) to enforce
that all filesystem access goes through the VFS. Since `PDBFileBuilder`
doesn't support VFS-based output, bypass the sandbox for the commit call
using `scopedDisable()`, matching the established pattern used in
`raw_ostream.cpp`, `VirtualFileSystem.cpp`, `BackendUtil.cpp`, and
others.

This crash occurs on any clang invocation targeting the DirectX backend
with PDB emission enabled, e.g.:

`Target: dxilv1.7-unknown-shadermodel6.7-library`

and was introduced with this commit:
https://github.com/llvm/llvm-project/pull/202762, which added the
 `Builder.commit(DebugFileName, ...)`  call that writes a PDB file via
raw filesystem APIs, which violates the IO sandbox.

Stack trace:
```
reportFatalInternalError("IO sandbox violation")
 llvm::sys::fs::status()
  FileOutputBuffer::create()
   MSFBuilder::commit()
    PDBFileBuilder::commit()
     DXContainerPDB::runOnModule()
```

Assisted by: Github Copilot
Fixes: https://github.com/llvm/llvm-project/issues/204468



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list