docker run --rm -it --shm-size=1g my_image ./program.exe
→ Still crashes with the same Bus error.
Shared Memory Usage:
The program allocates almost all of /dev/shm, so the issue is not insufficient memory,
but rather an invalid memory access (inside or near shared memory).
Debugging with GDB:
The crash happens during a memory operation
no core dump created
The problem not disappears after a full cleanup or reboot
What could cause a Bus error inside a Docker container
when the exact same binary runs fine on the host?
I’m using a custom base image that I built previously.
It has been used as the base for several other containers without any issues,
so the base image itself should be stable.
For this application, I created a separate Dockerfile that adds the specific dependencies my app needs, using that same base image.