Created:        2022-04-07 Thu
Last modified:  2022-04-07 Thu

Chromium: Crashpad

Investigation

I found out that there are rather annoying chromium flag --enable-crashpad and process /usr/lib/chromium-browser/chrome_crashpad_handler. I was surprised that this flag appears even if I doesn't pass it.

$ /usr/lib/chromium-browser/chromium-browser &
[1] 32189
$ *** stack smashing detected ***: <unknown> terminated
*** stack smashing detected ***: <unknown> terminated
*** stack smashing detected ***: <unknown> terminated

$ ps -fp 32189
UID        PID  PPID  C STIME TTY          TIME CMD
i        32189 31005 17 02:05 pts/10   00:00:02 /usr/lib/chromium-browser/chromium-browser --enable-crashpad

This answer [1] pointed to source code [2].

#if BUILDFLAG(IS_LINUX)
// TODO(https://crbug.com/1176772): Remove when Chrome Linux is fully migrated
// to Crashpad.
base::CommandLine::ForCurrentProcess()->AppendSwitch(
    ::switches::kEnableCrashpad);
#endif

As far as I understand, 32189 process launches /usr/lib/chromium-browser/chrome_crashpad_handler and /usr/lib/chromium-browser/chromium-browser again but with --enable-crashpad flag. I think, it's confused way of dealing with options.

Bug [3] mentioned in TODO is not resolved.

Also, I tried to launch Chromium without /usr/lib/chromium-browser/chrome_crashpad_handler file.

$ /usr/lib/chromium-browser/chromium-browser
[29802:29802:0407/022536.884851:FATAL:double_fork_and_exec.cc(131)] execv /usr/lib/chromium-browser/chrome_crashpad_handler: No such file or directory (2)

In that case there is a fatal error and no UI appears.

Conclusion

Unfortunately, looks like there is no easy way to disable this behaviour right now. The option I guess is to modify source code and rebuild to get it work. But it's not an easy way.

References