Skip to content

darwin/amd64: _demo/go/readdir fails due syscall trampoline ABI mismatch #1661

@luoliwoshang

Description

@luoliwoshang

Summary

On macOS Intel (darwin/amd64), _demo/go/readdir can fail with corrupted directory entries when built/run by llgo.

Reproduction

cd _demo/go/readdir
llgo run .

Observed behavior (intermittent/runner-dependent):

  • empty or corrupted entry names
  • panic like Bad readdir entries go.mod/go.sum

Scope

  • Reproduced on darwin/amd64
  • Other matrix targets did not show the same failure

Root Cause

The Darwin syscall trampoline call path in llgo uses uintptr ABI assumptions.
fdopendir/closedir/readdir_r were not consistently routed through ABI-safe wrappers, leading to symbol/ABI mismatch in this path and corrupted dirent reads.

Expected

_demo/go/readdir should consistently print valid entry names and must not panic.

Tracking

Fix is included in PR #1655.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions