PF4Public / gentoo-overlay

Personal Gentoo overlay

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

www-client/ungoogled-chromium:122.0.6261.111 (and at least 121 too) crash at start with “Assertion 'this->_M_is_engaged()' failed.”

waptaff opened this issue · comments

Compilation is a success.

Lately, when starting it, the last session's previous windows appear then immediately vanish, I get this error:

/usr/lib/gcc/x86_64-pc-linux-gnu/13/include/g++-v13/optional:479: _Tp &std::_Optional_base_impl<content::DocumentAssociatedData, std::_Optional_base<content::DocumentAssociatedData>>::_M_get() [_Tp = content::DocumentAssociatedData, _Dp = std::_Optional_base<content::DocumentAssociatedData>]: Assertion 'this->_M_is_engaged()' failed.

My USE flags:
X bluetooth clang cups official optimize-webui proprietary-codecs selinux system-crc32c system-double-conversion system-harfbuzz system-icu system-libevent system-libusb system-openh264 system-openjpeg system-png system-snappy system-woff2 system-zstd vaapi -cfi -convert-dict -cromite -custom-cflags -debug -enable-driver -gtk4 -hangouts -headless -hevc -kerberos -libcxx -nvidia -optimize-thinlto -override-data-dir -pax-kernel -pgo -pulseaudio -qt5 -qt6 -screencast -system-abseil-cpp -system-av1 -system-brotli -system-ffmpeg -system-jsoncpp -system-libvpx -system-re2 -thinlto -wayland -widevine

My CHROMIUM_FLAGS:
--enable-accelerated-video-decode --enable-features=VaapiVideoDecoder,PlatformHEVCDecoderSupport --disable-features=UseChromeOSDirectVideoDecoder --alsa-output-device=chromiumvolume

Here is a copy of a gdb backtrace — alas, debugging symbols are minimal, it already takes 8-10 hours to compile the application on my system.

When I try with a fresh user profile (chromium --user-data-dir=/tmp/garbage), application does not crash immediately, but installing extensions (tried uBlock and CheerpJ) and then restarting chromium makes it crash with the same error.

Using =sys-devel/gcc-13.2.1_p20240113-r1, clang/llvm 17.0.6.

The matching ungoogled-chromium-bin versions don't crash.

Any clue or method to dig deeper into the error would be appreciated as I'd like to avoid playing an almost never-ending blind whack-a-mole game with the USE flags.

Thank you for your time,

Did you build with ccache?

Did you build with ccache?

No, dev-util/ccache is not even installed.

@waptaff Is your gcc hardened?

Yes it is, gcc has the hardened USE flag. Should I try removing the flag?

Or maybe try adding -U_GLIBCXX_ASSERTIONS to my ungoogled-chromium CXXFLAGS?

gcc has the hardened USE flag

That could explain the failure. It looks like a reappearance of https://chromium-review.googlesource.com/c/chromium/src/+/5014405. Although the fix had been merged, the code seems to be changed since then, perhaps the bug returned or they forgot to fix an edge-case with extensions.

If you intentionally enabled hardened for gcc, then your options are:

  • Disable assertions for ungoogled-chromium via CXXFLAGS, like you've already discovered
  • Use the bundled libcxx, but that would require disabling system-snappy and system-woff2 (in addition to system-jsoncpp)

@PF4Public Thank you for your analysis and proposed workarounds.

I will try disabling assertions first, as I'd prefer to avoid the libcxx rabbit hole.

I'll post results once I have them; that should be in about 24 hours.

I confirm that adding -U_GLIBCXX_ASSERTIONS to ungoogled-chromium CXXFLAGS fixes the crashes at start.

Thank you for pointing me to the right direction, your hunch around gcc's hardened flag saved me lots of frustration.

You did a great job on eliminating possibilities in your original report, I had to examine the remaining ones :)

Have you attempted installing extensions? Is it completely solved then?

It is completely solved as far as I can tell. My day-to-day setup which has about twenty-five extension doesn't crash anymore. All scenarios that caused a crash at startup don't do anymore.

Wonderful

commented

Just want to say thanks. Had a smiliar issue and adding -U_GLIBCXX_ASSERTIONS helped me as well.

I, as well, use the Gentoo hardened profile. I have created the following file:

# cat /etc/portage/env/glibcxx-assertions
CXXFLAGS="${CXXFLAGS} -U_GLIBCXX_ASSERTIONS"

And I have adjusted the following file:

# cat /etc/portage/package.env
www-client/ungoogled-chromium glibcxx-assertions

I can confirm that building the ungoogled-chromium package that way helps with the crashes. However, I still get the Aw, Snap! page in Chromium more often than not:

screenshot_2024-04-14-090457

The only output that I can see on the command line is:

[30232:30245:0414/090021.333911:ERROR:object_proxy.cc(576)] Failed to call method: org.freedesktop.DBus.Properties.Get: object_path= /org/freedesktop/portal/desktop: org.freedesktop.DBus.Error.InvalidArgs: No such interface “org.freedesktop.portal.FileChooser”
[30232:30245:0414/090021.333951:ERROR:select_file_dialog_linux_portal.cc(286)] Failed to read portal version property
[30232:30232:0414/090021.343564:ERROR:policy_logger.cc(157)] :components/enterprise/browser/controller/chrome_browser_cloud_management_controller.cc(161) Cloud management controller initialization aborted as CBCM is not enabled. Please use the `--enable-chrome-browser-cloud-management` command line flag to enable it if you are not using the official Google Chrome build.
[30232:30243:0414/090021.989895:ERROR:ev_root_ca_metadata.cc(162)] Failed to decode OID: 0

This didn't happen on a different machine on which I also have the hardened profile.
This is a new installation on a new machine.

@mrusme Are you using version 123? That looks like #333. I'm getting the same error and I'm not using the hardened profile

@thubble Indeed, I'm using 123.0.6312.122_p1 with the flags listen in ungoogled-software/ungoogled-chromium#2802 which appear to be relatively similar to yours.