Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong PID passed to systemd-coredump for process in different PID namespace #1930

Closed
antrik opened this issue Nov 17, 2015 · 3 comments
Closed
Labels
bug 🐛 Programming errors, that need preferential fixing coredump

Comments

@antrik
Copy link

antrik commented Nov 17, 2015

The default /usr/lib/sysctl.d/50-coredump.conf shipped with systemd sets the core dump command to '/usr/lib/systemd/systemd-coredump %p %u %g %s %t %e', where %p is the "PID of dumped process, as seen in the PID namespace in which the process resides" (according to http://man7.org/linux/man-pages/man5/core.5.html ) -- so when a process dumps core inside a container, systemd-coredump (running in the global PID namespace) gets the wrong PID, and thus fetches meta data (command name etc.) from the wrong process. (See coreos/bugs#172 and https://groups.google.com/forum/#!topic/coreos-user/l00MNe6fOHM )

This can be avoided by using %P ("PID of dumped process, as seen in the initial PID namespace (since Linux 3.12)") instead of %p.

Is there any reason for not using %P in the default config shipped with systemd?

@poettering
Copy link
Member

No, really, sounds like something to fix.

@poettering
Copy link
Member

will prep a fix

@poettering poettering added bug 🐛 Programming errors, that need preferential fixing coredump labels Nov 17, 2015
@poettering
Copy link
Member

Of course, apparently there's not "%U" to match the same namespacing logic for the userns stuff... Meh.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Programming errors, that need preferential fixing coredump
Development

No branches or pull requests

2 participants