ladybird icon indicating copy to clipboard operation
ladybird copied to clipboard

[NixOS] Ladybird crash (Illegal instruction) for about:newtab on start

Open BloodStainedCrow opened this issue 11 months ago • 5 comments

Summary

When I start the execute the program distributed in the current unstable nixpkgs (This seems to be ladybird-0-unstable-2025-03-27) the WebContent process crashes for about::newtab (i.e. on browser start). This WebContent crash then escalates into a full browser crash.

VERIFICATION FAILED: m_default_fixed_width_font at /build/source/Libraries/LibWebView/Plugins/FontPlugin.cpp:49 indicates the source is a problem with fonts. My guess would be that a required font is not available by default on NixOS? (In which case this error could be attributed to a bug the nix package instead of Ladybird itself)

This WebContent crash then leads to a crash of the main process due to UNEXPECTED ERROR: Trying to post_message during IPC shutdown at /build/source/build/Lagom/Services/WebContent/WebContentServerEndpoint.h:4758. This error seems to lead to Illegal instruction, which I would guess is used as a "surefire way to abort" here. This then terminates the browser.

Operating system

Linux

Steps to reproduce

  1. nix-shell -I nixpkgs=https://github.com/NixOS/nixpkgs/archive/nixpkgs-unstable.tar.gz -p ladybird
  2. Ladybird

Expected behavior

No Crash

Actual behavior

Ladybird crashes immediately on open

URL for a reduced test case

N/A

HTML/SVG/etc. source for a reduced test case

N/A

Log output and (if possible) backtrace

[nix-shell:~]$ Ladybird 
Ladybird PID file '/run/user/1000/Ladybird.pid' exists with PID 2491778, but process cannot be found
VERIFICATION FAILED: m_default_fixed_width_font at /build/source/Libraries/LibWebView/Plugins/FontPlugin.cpp:49
/nix/store/1zjr98ippnh7j0vpiga2gpn2lgbk3pbm-ladybird-0-unstable-2025-03-27/libexec/../lib/liblagom-ak.so.0(ak_trap+0x49) [0x7fcd8430e609]
/nix/store/1zjr98ippnh7j0vpiga2gpn2lgbk3pbm-ladybird-0-unstable-2025-03-27/libexec/../lib/liblagom-ak.so.0(ak_verification_failed+0x3f) [0x7fcd8430e59f]
/nix/store/1zjr98ippnh7j0vpiga2gpn2lgbk3pbm-ladybird-0-unstable-2025-03-27/libexec/../lib/liblagom-webview.so.0 WebView::FontPlugin::FontPlugin(bool, Gfx::SystemFontProvider*) 0x5d4) [0x7fcd87b2bab4]
/nix/store/1zjr98ippnh7j0vpiga2gpn2lgbk3pbm-ladybird-0-unstable-2025-03-27/libexec/WebContent() [0x430447]
/nix/store/1zjr98ippnh7j0vpiga2gpn2lgbk3pbm-ladybird-0-unstable-2025-03-27/libexec/WebContent(main+0xff) [0x42e5ff]
/nix/store/vbrdc5wgzn0w1zdp10xd2favkjn5fk7y-glibc-2.40-66/lib/libc.so.6(+0x2a47e) [0x7fcd83be047e]
/nix/store/vbrdc5wgzn0w1zdp10xd2favkjn5fk7y-glibc-2.40-66/lib/libc.so.6(__libc_start_main+0x89) [0x7fcd83be0539]
/nix/store/1zjr98ippnh7j0vpiga2gpn2lgbk3pbm-ladybird-0-unstable-2025-03-27/libexec/WebContent() [0x42e735]
VERIFICATION FAILED: m_default_fixed_width_font at /build/source/Libraries/LibWebView/Plugins/FontPlugin.cpp:49
/nix/store/1zjr98ippnh7j0vpiga2gpn2lgbk3pbm-ladybird-0-unstable-2025-03-27/libexec/../lib/liblagom-ak.so.0(ak_trap+0x49) [0x7f336feea609]
/nix/store/1zjr98ippnh7j0vpiga2gpn2lgbk3pbm-ladybird-0-unstable-2025-03-27/libexec/../lib/liblagom-ak.so.0(ak_verification_failed+0x3f) [0x7f336feea59f]
/nix/store/1zjr98ippnh7j0vpiga2gpn2lgbk3pbm-ladybird-0-unstable-2025-03-27/libexec/../lib/liblagom-webview.so.0 WebView::FontPlugin::FontPlugin(bool, Gfx::SystemFontProvider*) 0x5d4) [0x7f3373707ab4]
/nix/store/1zjr98ippnh7j0vpiga2gpn2lgbk3pbm-ladybird-0-unstable-2025-03-27/libexec/WebContent() [0x430447]
/nix/store/1zjr98ippnh7j0vpiga2gpn2lgbk3pbm-ladybird-0-unstable-2025-03-27/libexec/WebContent(main+0xff) [0x42e5ff]
/nix/store/vbrdc5wgzn0w1zdp10xd2favkjn5fk7y-glibc-2.40-66/lib/libc.so.6(+0x2a47e) [0x7f336f7bc47e]
/nix/store/vbrdc5wgzn0w1zdp10xd2favkjn5fk7y-glibc-2.40-66/lib/libc.so.6(__libc_start_main+0x89) [0x7f336f7bc539]
/nix/store/1zjr98ippnh7j0vpiga2gpn2lgbk3pbm-ladybird-0-unstable-2025-03-27/libexec/WebContent() [0x42e735]
455745.324 Ladybird(2492901): WebContent process crashed! Last page loaded: about:newtab
455745.324 Ladybird(2492901): Consider raising an issue at https://github.com/LadybirdBrowser/ladybird/issues/new/choose
UNEXPECTED ERROR: Trying to post_message during IPC shutdown at /build/source/build/Lagom/Services/WebContent/WebContentServerEndpoint.h:4758
/nix/store/1zjr98ippnh7j0vpiga2gpn2lgbk3pbm-ladybird-0-unstable-2025-03-27/bin/../lib/liblagom-ak.so.0(ak_trap+0x49) [0x7f2b4f8cf609]
/nix/store/1zjr98ippnh7j0vpiga2gpn2lgbk3pbm-ladybird-0-unstable-2025-03-27/bin/../lib/liblagom-webview.so.0(+0xcba29) [0x7f2b5435ba29]
/nix/store/1zjr98ippnh7j0vpiga2gpn2lgbk3pbm-ladybird-0-unstable-2025-03-27/bin/../lib/liblagom-webview.so.0 WebView::ViewImplementation::initialize_client(WebView::ViewImplementation::CreateNewClient) 0x16b) [0x7f2b5433679b]
Ladybird() [0x45b53a]
/nix/store/1zjr98ippnh7j0vpiga2gpn2lgbk3pbm-ladybird-0-unstable-2025-03-27/bin/../lib/liblagom-webview.so.0 WebView::ViewImplementation::handle_web_content_process_crash(WebView::ViewImplementation::LoadErrorPage) 0xe4) [0x7f2b54335c44]
/nix/store/1zjr98ippnh7j0vpiga2gpn2lgbk3pbm-ladybird-0-unstable-2025-03-27/bin/../lib/liblagom-webview.so.0(+0xa6107) [0x7f2b54336107]
/nix/store/1zjr98ippnh7j0vpiga2gpn2lgbk3pbm-ladybird-0-unstable-2025-03-27/bin/../lib/liblagom-core.so.0 Core::ThreadEventQueue::process() 0x353) [0x7f2b4fba7ba3]
/nix/store/1zjr98ippnh7j0vpiga2gpn2lgbk3pbm-ladybird-0-unstable-2025-03-27/bin/../lib/liblagom-webview.so.0 WebView::EventLoopManagerQt::event_target_received_event(AK::Badge<WebView::EventLoopImplementationQtEventTarget>, QEvent*) 0x6d) [0x7f2b543bfadd]
/nix/store/1zjr98ippnh7j0vpiga2gpn2lgbk3pbm-ladybird-0-unstable-2025-03-27/bin/../lib/liblagom-webview.so.0 WebView::EventLoopImplementationQtEventTarget::event(QEvent*) 0x1c) [0x7f2b543c369c]
/nix/store/cp30fin83aimfljxb5988bkn2micgi04-qtbase-6.9.0/lib/libQt6Widgets.so.6 QApplicationPrivate::notify_helper(QObject*, QEvent*) 0x8a) [0x7f2b5459ebaa]
/nix/store/cp30fin83aimfljxb5988bkn2micgi04-qtbase-6.9.0/lib/libQt6Core.so.6 QCoreApplication::notifyInternal2(QObject*, QEvent*) 0x178) [0x7f2b52b63698]
/nix/store/cp30fin83aimfljxb5988bkn2micgi04-qtbase-6.9.0/lib/libQt6Core.so.6 QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) 0x344) [0x7f2b52b673e4]
/nix/store/cp30fin83aimfljxb5988bkn2micgi04-qtbase-6.9.0/lib/libQt6Core.so.6(+0x4c42c7) [0x7f2b52e752c7]
/nix/store/yxyncg0y2b39kjgi4c52w74c4w1za7pg-glib-2.82.5/lib/libglib-2.0.so.0(+0x60fc1) [0x7f2b4efadfc1]
/nix/store/yxyncg0y2b39kjgi4c52w74c4w1za7pg-glib-2.82.5/lib/libglib-2.0.so.0(+0x63280) [0x7f2b4efb0280]
/nix/store/yxyncg0y2b39kjgi4c52w74c4w1za7pg-glib-2.82.5/lib/libglib-2.0.so.0(g_main_context_iteration+0x2c) [0x7f2b4efb0abc]
/nix/store/cp30fin83aimfljxb5988bkn2micgi04-qtbase-6.9.0/lib/libQt6Core.so.6 QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) 0x73) [0x7f2b52e749a3]
/nix/store/cp30fin83aimfljxb5988bkn2micgi04-qtbase-6.9.0/lib/libQt6Core.so.6 QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) 0x1bb) [0x7f2b52b71beb]
/nix/store/cp30fin83aimfljxb5988bkn2micgi04-qtbase-6.9.0/lib/libQt6Core.so.6 QCoreApplication::exec() 0xae) [0x7f2b52b6d02e]
/nix/store/1zjr98ippnh7j0vpiga2gpn2lgbk3pbm-ladybird-0-unstable-2025-03-27/bin/../lib/liblagom-core.so.0 Core::EventLoop::exec() 0x31) [0x7f2b4fb98b01]
/nix/store/1zjr98ippnh7j0vpiga2gpn2lgbk3pbm-ladybird-0-unstable-2025-03-27/bin/../lib/liblagom-webview.so.0 WebView::Application::execute() 0x10) [0x7f2b542e0960]
Ladybird() [0x461fdb]
Ladybird(main+0xff) [0x42096f]
/nix/store/vbrdc5wgzn0w1zdp10xd2favkjn5fk7y-glibc-2.40-66/lib/libc.so.6(+0x2a47e) [0x7f2b4f2ae47e]
/nix/store/vbrdc5wgzn0w1zdp10xd2favkjn5fk7y-glibc-2.40-66/lib/libc.so.6(__libc_start_main+0x89) [0x7f2b4f2ae539]
Ladybird() [0x420aa5]
Illegal instruction (core dumped)

Screenshots or screen recordings

No response

Build flags or config settings

The build environment is specified in this file. (Though I do not immediately see anything weird happening here)

Contribute a patch?

  • [ ] I’ll contribute a patch for this myself.

BloodStainedCrow avatar May 05 '25 05:05 BloodStainedCrow

There is this https://github.com/NixOS/nixpkgs/pull/403413 and I am trying to build it, but given there are reports that it takes ages to build I honestly don't have big hopes my craptop will actually finish the build.

VuiMuich avatar May 06 '25 17:05 VuiMuich

From previous nix issues, you need fontDir enabled. I don't quite know what that means, but it's related to putting font paths in the expected place per the FHS

ADKaster avatar May 06 '25 22:05 ADKaster

Indeed the fix proposed by #3872 resolved the issue for me as well. I'll see what can be done on the NixOS side to make this more visible.

VuiMuich avatar May 07 '25 04:05 VuiMuich

See https://github.com/LadybirdBrowser/ladybird/issues/572#issuecomment-2242268172

@BloodStainedCrow @VuiMuich As a rule, if a package doesn't work on NixOS you should first look for a relevant NixOS option, as it's likely to be required for the package to work. sudo and flatpak are other examples of packages that require options.

This is documented in the note here: https://nixos.org/manual/nixos/stable/#sec-declarative-package-mgmt

Also please, please report issues of NixOS packages in the https://github.com/NixOS/nixpkgs repo first, unless you are absolutely sure the issue isn't specific to NixOS

fgaz avatar May 07 '25 12:05 fgaz

I already guessed the underlying problem with fonts would be fixed by using the NixOS option. The reason I still opened the issue here was that I believed the ungraceful crash of the whole Ladybird process would be considered a bug, regardless of potential configuration problems while using NixOS. i.e.: The fact that ladybird was unable to render about:newtab was less the issue, rather the fact it hard crashed while trying with an internal error message and an „Unexpected Error“. If I am mistaken, then I apologize for my mistake.

BloodStainedCrow avatar May 07 '25 15:05 BloodStainedCrow