Skip to content

graphcoded.exe crashes silently (0xC000001D) when USERPROFILE is redirected on Windows #558

Description

@coneilen

Describe the bug
graphcoded.exe exits immediately with 0xC000001D (STATUS_ILLEGAL_INSTRUCTION, the usual Windows signature of a Swift runtime trap) and writes nothing to stdout or stderr when USERPROFILE points at a directory other than the real profile. When the shell's supervisor starts the daemon, this shows up only as "daemon unavailable".

Each variable was changed alone, always with GRAPHCODE_SUPPORT_DIR set to a sandbox, using the packaged daemon:

Overridden variable Result
none (support dir only) listening
HOME listening
USERPROFILE exit 0xC000001D, no output
LOCALAPPDATA listening
TEMP and TMP listening

To reproduce

  1. $env:GRAPHCODE_SUPPORT_DIR = <sandbox>, and set $env:USERPROFILE to an existing empty directory.
  2. Run bin\graphcoded.exe from the built package.
  3. The process exits with 0xC000001D and no output.

Expected behavior
Either run normally or exit with a clear diagnostic on stderr and a non-trap exit code.

Environment

  • GraphCode version: 0.1.77 label, built locally from commit 59ebed1
  • OS: Windows 11 Enterprise 26200 x64
  • Swift 6.3.3

Additional context

  • Likely candidates are FileManager.default.homeDirectoryForCurrentUser / NSHomeDirectory() call sites (for example IPC/WindowsNamedPipeTransport.swift, SupportDirectory.swift), or a force-unwrap or precondition on profile identity. The root cause was not determined; attach a debugger, or capture a crash dump with WER LocalDumps.
  • GraphcodeKit/ is shared with macOS, so validate on both platforms per AGENTS.md.
  • Redirecting USERPROFILE is uncommon in practice, but people try it when sandboxing.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingwindowsWindows port

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions