LadybirdBrowser / ladybird

Truly independent web browser
https://ladybird.org
BSD 2-Clause "Simplified" License
12.47k stars 498 forks source link

NetBSD status #438

Open 0-wiz-0 opened 1 week ago

0-wiz-0 commented 1 week ago

This is a followup to https://github.com/SerenityOS/serenity/issues/23375#issuecomment-2202100248 This patch still needs to be applied to fix the build on NetBSD:

--- Userland/Libraries/LibGfx/EdgeFlagPathRasterizer.h.orig     2024-06-06 21:18:50.814506936 +0000
+++ Userland/Libraries/LibGfx/EdgeFlagPathRasterizer.h
@@ -21,7 +21,7 @@ namespace Detail {
 static auto constexpr coverage_lut = [] {
     Array<u8, 256> coverage_lut {};
     for (u32 sample = 0; sample <= 255; sample++)
-        coverage_lut[sample] = popcount(sample);
+        coverage_lut[sample] = AK::popcount(sample);
     return coverage_lut;
 }();

With that patch, I got a working browser that could display github.com (a first for me with ladybird) but when scrolling down, it died with:

(gdb) bt
#0  ak_verification_failed () at /scratch/wip/ladybird-git/work/serenity/AK/Assertions.cpp:108
#1  0x0000000000685b48 in AK::ErrorOr<IPC::File, AK::Error>::release_value_but_fixme_should_propagate_errors () at /scratch/wip/ladybird-git/work/serenity/AK/Error.h:202
#2  Ladybird::WebContentView::initialize_client () at /scratch/wip/ladybird-git/work/serenity/Ladybird/Qt/WebContentView.cpp:571
#3  0x00007817d19169de in WebView::ViewImplementation::handle_web_content_process_crash ()
    at /scratch/wip/ladybird-git/work/serenity/Userland/Libraries/LibWebView/ViewImplementation.cpp:450
#4  0x00007817cd508402 in AK::Function<void ()>::operator()() const () at /scratch/wip/ladybird-git/work/serenity/AK/Function.h:125
#5  0x00007817cd4f68de in Core::ThreadEventQueue::process () at /scratch/wip/ladybird-git/work/serenity/Userland/Libraries/LibCore/ThreadEventQueue.cpp:108
#6  0x000000000066a7fd in Ladybird::EventLoopManagerQt::event_target_received_event ()
    at /scratch/wip/ladybird-git/work/serenity/Ladybird/Qt/EventLoopImplementationQt.cpp:154
#7  0x000000000066ae6c in Ladybird::EventLoopImplementationQtEventTarget::event ()
    at /scratch/wip/ladybird-git/work/serenity/Ladybird/Qt/EventLoopImplementationQtEventTarget.cpp:13
#8  0x00007817d0f9f958 in QApplicationPrivate::notify_helper (this=<optimized out>, receiver=0x7817c6cb7510, e=0x7817c6c6ccb0)
    at /scratch/x11/qt6-qtbase/work/qtbase-everywhere-src-6.7.1/src/widgets/kernel/qapplication.cpp:3287
#9  0x00007817d004262f in QCoreApplication::notifyInternal2 (receiver=0x7817c6cb7510, event=0x7817c6c6ccb0)
    at /scratch/x11/qt6-qtbase/work/qtbase-everywhere-src-6.7.1/src/corelib/kernel/qcoreapplication.cpp:1134
#10 0x00007817d004294c in QCoreApplication::sendEvent (receiver=<optimized out>, event=<optimized out>)
    at /scratch/x11/qt6-qtbase/work/qtbase-everywhere-src-6.7.1/src/corelib/kernel/qcoreapplication.cpp:1575
#11 0x00007817d004666c in QCoreApplicationPrivate::sendPostedEvents (receiver=0x0, event_type=0, data=0x7817c7ac83c0)
    at /scratch/x11/qt6-qtbase/work/qtbase-everywhere-src-6.7.1/src/corelib/kernel/qcoreapplication.cpp:1932
#12 0x00007817d00469be in QCoreApplication::sendPostedEvents (receiver=<optimized out>, event_type=<optimized out>)
    at /scratch/x11/qt6-qtbase/work/qtbase-everywhere-src-6.7.1/src/corelib/kernel/qcoreapplication.cpp:1789
#13 0x00007817d029a67f in postEventSourceDispatch (s=s@entry=0x7817c6ca50e0)
    at /scratch/x11/qt6-qtbase/work/qtbase-everywhere-src-6.7.1/src/corelib/kernel/qeventdispatcher_glib.cpp:244
#14 0x00007817cbe9bb0d in g_main_dispatch (context=context@entry=0x7817c6d64180) at ../glib/gmain.c:3344
#15 0x00007817cbe9ef68 in g_main_context_dispatch_unlocked (context=0x7817c6d64180) at ../glib/gmain.c:4152
#16 g_main_context_iterate_unlocked (context=context@entry=0x7817c6d64180, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at ../glib/gmain.c:4217
#17 0x00007817cbe9f833 in g_main_context_iteration (context=0x7817c6d64180, may_block=may_block@entry=1) at ../glib/gmain.c:4282
#18 0x00007817d0299dfa in QEventDispatcherGlib::processEvents (this=0x7817c7a93e40, flags=...)
    at /scratch/x11/qt6-qtbase/work/qtbase-everywhere-src-6.7.1/src/corelib/kernel/qeventdispatcher_glib.cpp:394
#19 0x00007817d004de5a in QEventLoop::exec (this=this@entry=0x7f7fff25f6d0, flags=..., flags@entry=...)
    at /scratch/x11/qt6-qtbase/work/qtbase-everywhere-src-6.7.1/src/corelib/global/qflags.h:34
#20 0x00007817d004bbe4 in QCoreApplication::exec () at /scratch/x11/qt6-qtbase/work/qtbase-everywhere-src-6.7.1/src/corelib/global/qflags.h:74
#21 0x00007817cd4dd79d in Core::EventLoop::exec () at /scratch/wip/ladybird-git/work/serenity/Userland/Libraries/LibCore/EventLoop.cpp:88
#22 0x00000000006893c0 in serenity_main () at /scratch/wip/ladybird-git/work/serenity/Ladybird/Qt/main.cpp:210
#23 0x000000000068ba48 in main () at /scratch/wip/ladybird-git/work/serenity/Userland/Libraries/LibMain/Main.cpp:43
BertalanD commented 1 week ago

We would appreciate if you opened a PR with the fix -- maybe mentioning the compilation error it fixes for context in the commit message.

0-wiz-0 commented 1 week ago

Thanks for looking at this, I've created #439 for this.

0-wiz-0 commented 1 week ago

Thanks for merging the patch. I've tried github.com again with the current version but it died while loading the page. Backtrace:

#0  ak_verification_failed () at /scratch/wip/ladybird-git/work/serenity/AK/Assertions.cpp:100
100     /scratch/wip/ladybird-git/work/serenity/AK/Assertions.cpp: No such file or directory.
[Current thread is 1 (process 7857)]
(gdb) bt
#0  ak_verification_failed () at /scratch/wip/ladybird-git/work/serenity/AK/Assertions.cpp:100
#1  0x0000771dfd1ff7b1 in Protocol::RequestClient::die ()
    at /scratch/wip/ladybird-git/work/serenity/Userland/Libraries/LibProtocol/RequestClient.cpp:23
#2  0x0000771df96764e2 in AK::Function<void ()>::operator()() const ()
    at /scratch/wip/ladybird-git/work/serenity/AK/Function.h:125
#3  0x0000771df96649b2 in Core::ThreadEventQueue::process ()
    at /scratch/wip/ladybird-git/work/serenity/Userland/Libraries/LibCore/ThreadEventQueue.cpp:118
#4  0x0000000000de488d in Ladybird::EventLoopManagerQt::event_target_received_event ()
    at /scratch/wip/ladybird-git/work/serenity/Ladybird/Qt/EventLoopImplementationQt.cpp:154
#5  0x0000771dfc991a53 in QApplicationPrivate::notify_helper (this=<optimized out>, receiver=0x771df2e07480,
    e=0x771df2e07160)
    at /scratch/x11/qt6-qtbase/work/qtbase-everywhere-src-6.7.2/src/widgets/kernel/qapplication.cpp:3287
#6  0x0000771dfba37d84 in QCoreApplication::notifyInternal2 (receiver=0x771df2e07480, event=0x771df2e07160)
    at /scratch/x11/qt6-qtbase/work/qtbase-everywhere-src-6.7.2/src/corelib/kernel/qcoreapplication.cpp:1142
#7  0x0000771dfba3809e in QCoreApplication::sendEvent (receiver=<optimized out>, event=<optimized out>)
    at /scratch/x11/qt6-qtbase/work/qtbase-everywhere-src-6.7.2/src/corelib/kernel/qcoreapplication.cpp:1583
#8  0x0000771dfba3bdc4 in QCoreApplicationPrivate::sendPostedEvents (receiver=0x0, event_type=0, data=0x771df3bf23c0)
    at /scratch/x11/qt6-qtbase/work/qtbase-everywhere-src-6.7.2/src/corelib/kernel/qcoreapplication.cpp:1940
#9  0x0000771dfba3c136 in QCoreApplication::sendPostedEvents (receiver=<optimized out>, event_type=<optimized out>)
    at /scratch/x11/qt6-qtbase/work/qtbase-everywhere-src-6.7.2/src/corelib/kernel/qcoreapplication.cpp:1797
#10 0x0000771dfbc9388b in postEventSourceDispatch (s=0x771df2def0e0)
    at /scratch/x11/qt6-qtbase/work/qtbase-everywhere-src-6.7.2/src/corelib/kernel/qeventdispatcher_glib.cpp:244
#11 0x0000771df7fc1d14 in g_main_dispatch (context=context@entry=0x771df2ea8180) at ../glib/gmain.c:3344
#12 0x0000771df7fc51f5 in g_main_context_dispatch_unlocked (context=0x771df2ea8180) at ../glib/gmain.c:4152
#13 g_main_context_iterate_unlocked (context=context@entry=0x771df2ea8180, block=block@entry=1,
    dispatch=dispatch@entry=1, self=<optimized out>) at ../glib/gmain.c:4217
#14 0x0000771df7fc59db in g_main_context_iteration (context=0x771df2ea8180, may_block=1) at ../glib/gmain.c:4282
#15 0x0000771dfbc93026 in QEventDispatcherGlib::processEvents (this=0x771df3bbddf0, flags=...)
    at /scratch/x11/qt6-qtbase/work/qtbase-everywhere-src-6.7.2/src/corelib/kernel/qeventdispatcher_glib.cpp:394
#16 0x0000771dfba43506 in QEventLoop::exec (this=this@entry=0x7f7fff369210, flags=..., flags@entry=...)
    at /scratch/x11/qt6-qtbase/work/qtbase-everywhere-src-6.7.2/src/corelib/global/qflags.h:34
#17 0x0000771dfba412f0 in QCoreApplication::exec ()
    at /scratch/x11/qt6-qtbase/work/qtbase-everywhere-src-6.7.2/src/corelib/global/qflags.h:74
#18 0x0000771df96479f3 in Core::EventLoop::exec ()
    at /scratch/wip/ladybird-git/work/serenity/Userland/Libraries/LibCore/EventLoop.cpp:88
#19 0x0000000000e03460 in serenity_main () at /scratch/wip/ladybird-git/work/serenity/Ladybird/Qt/main.cpp:210
#20 0x0000000000e04372 in main () at /scratch/wip/ladybird-git/work/serenity/Userland/Libraries/LibMain/Main.cpp:43

(We had a NetBSD bug report that I kept up-to-date with the latest problem in the previous project, should we continue this tradition here or should I file new bug reports for each new core dump?)

AtkinsSJ commented 5 days ago

(We had a NetBSD bug report that I kept up-to-date with the latest problem in the previous project, should we continue this tradition here or should I file new bug reports for each new core dump?)

Keeping one issue open for progress on making Ladybird work on NetBSD sounds fine to me. But it'd be clearer if you renamed the issue to reflect that. Right now it sounds like it's specifically for the popcount problem, which has been fixed.

0-wiz-0 commented 5 days ago

I've renamed the bug report, thanks for the feedback!