Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
Investigate why setrlimit setting in PAL on Alpine in breaks GDB #7487
When enabling CoreCLR build on Alpine, I have found that the INIT_IncreaseDescriptorLimit somehow breaks GDB. As soon as I step over the setrlimit in there, GDB reports an unknown signal and stops being able e.g. to continue execution. Even just running a CoreCLR app under GDB without any breakpoints cause the same issue at that point.
This is what happens:
If I run it out of the GDB, I haven't noticed any problem.
What's even more interesting, creating a simple testing app containing just the body of the INIT_IncreaseDescriptorLimit in the main and stepping through that in GDB doesn't have this issue.
I've faced a similar issue with OpenJDK on Alpine V3.8, so I hope I could reason about it.
The culprint is musl's
It is a AS-Safe implementation and updates the limits of active threads in a synchronized manner, which is done by
The issue seems to be specific to gdb's implementation, so it could explain why it not encountered in lldb.