apple / apple/container

[Bug]: debuggers do not work under amd64

Open
#766 1 comment 1 reaction 0 assignees View on GitHub
Dominant language
Swift
Stars
49.9k
Forks
1.8k
Avg merge
1d 20h
Merged PRs (30d)
22

Description

### I have done the following

- [x] I have searched the existing issues
- [ ] If possible, I've reproduced the issue using the 'main' branch of this project

### Steps to reproduce

1. container run -a amd64 -it fedora bash
2. yum update
3. yum install gdb
4. gdb /bin/true
5. (gdb) run

```
(gdb) run
Starting program: /usr/bin/true
warning: linux_ptrace_test_ret_to_nx: Cannot PTRACE_GETREGS: Input/output error
warning: linux_ptrace_test_ret_to_nx: PC 0x99 is neither near return address 0x7ffff8f14000 nor is the return instruction 0x555555928d32!
Couldn't get CS register: Input/output error
```

the same with lldb, it even core dumps

### Current behavior

They fail to work.

### Expected behavior

GDB and LLDB are expected to work. Actually, the problem is wider - I am getting `illegal hardware instruction` but I can't debug it as GDB and LLDB do not work.

### Environment

```markdown
- OS: Darwin 24.6.0 Darwin Kernel Version 24.6.0: Mon Aug 11 21:16:30 PDT 2025; root:xnu-11417.140.69.701.11~1/RELEASE_ARM64_T8132 arm64
- Xcode: version: 26.0.0.0.1.1757719676
- Container:

apiserver is running
application data root: /Users/.../Library/Application Support/com.apple.container/
application install root: /usr/local/
container-apiserver version: container-apiserver version 0.5.0 (build: release, commit: 48230f3)
container-apiserver commit: 48230f380499efecd663fdc6749a2cbaf2f8ed76
```

### Relevant log output

```shell
(gdb) run
Starting program: /usr/bin/true
warning: linux_ptrace_test_ret_to_nx: Cannot PTRACE_GETREGS: Input/output error
warning: linux_ptrace_test_ret_to_nx: PC 0x99 is neither near return address 0x7ffff8f14000 nor is the return instruction 0x555555928d32!
Couldn't get CS register: Input/output error
```

### Code of Conduct

- [x] I agree to follow this project's Code of Conduct

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the amd64 Fedora container case with the listed container, gdb, and lldb commands, then investigate how debugger support behaves for amd64 containers on Apple silicon. Done means gdb and lldb run the sample program without the reported register errors or core dump, and the illegal-instruction failure can be debugged.

Written by the indexing model from the issue text.

Assessment

Tech stack
linux, macos
Domain
devtools, operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.