The Linux multiprocess crash reporter currently determines the identity of the
process making the crash request by fstat()ing the response socket, assuming the
other end's inode number is 1 less than it, and then walking procfs to search
every /proc/*/fd/* symlink for that socket. This is from Chromium, which
recently removed its copy: https://crbug.com/357670 (see that bug for more
background)
This unsightly workaround is necessary only if all three of these conditions
hold for the breakpad-using project:
1. It uses multiprocess crash reporting (originally added for Gecko in
https://bugzil.la/516759 but might have other users by now?)
2. It supports Linux kernels before 2.6.35 (August 2010)
3. It uses PID namespaces (e.g., using the Chromium sandbox; note that, on those
kernels, this requires root or a setuid-root helper)
So, if no projects satisfy those conditions, then the code can go away.
Gecko fits the first item, but: it doesn't use namespaces yet, and desktop
Firefox won't ever use them on a kernel that old. B2G (Firefox OS) still
supports one specific 2.6.29 kernel, but we can patch that kernel if needed.
The inspiration for deleting this code is another patch (to follow) to change
the dump completion channel from a socketpair to a pipe, which would otherwise
mean adjusting some of the hardcoded assumptions here. Xref:
https://bugzil.la/1068410