LadybirdBrowser / ancient-history

The Ladybird web browser
BSD 2-Clause "Simplified" License
1.62k stars 109 forks source link

Assertion error in ConnectionBase::read_as_much_as_possible_from_socket_without_blocking #116

Closed lokedhs closed 1 year ago

lokedhs commented 1 year ago

When attempting to load a web application, I'm getting an assertion error in the above mentioned function and the browser exits:

The problem can be reproduced by loading the following URL: https://kapdemo.dhsdevelopments.com/clientweb2/

ResourceLoader: Finished load of: "https://kapdemo.dhsdevelopments.com/clientweb2/compute-queue-worker.js", Duration: 14ms
WebContent: /home/elias/src/ladybird/Build/serenity/AK/TypeCasts.h:42: AK::Detail::CopyConst<InputType, OutputType>& AK::verify_cast(InputType&) [with OutputType = Web::HTML::Window; InputType = JS::Object; Detail::CopyConst<InputType, OutputType> = Web::HTML::Window]: Assertion `is<OutputType>(input)' failed.
ConnectionBase::read_as_much_as_possible_from_socket_without_blocking: recv: Connection reset by peer (errno=104)
ConnectionBase::read_as_much_as_possible_from_socket_without_blocking: recv: Connection reset by peer (errno=104)
ladybird: /home/elias/src/ladybird/Build/serenity/Userland/Libraries/LibIPC/Connection.cpp:170: AK::ErrorOr<AK::Vector<unsigned char> > IPC::ConnectionBase::read_as_much_as_possible_from_socket_without_blocking(): Assertion `false' failed.
Subprocess aborted
FAILED: CMakeFiles/run /home/elias/src/ladybird/Build/CMakeFiles/run 
cd /home/elias/src/ladybird/Build && /usr/bin/cmake -E env SERENITY_SOURCE_DIR=/home/elias/src/ladybird/Build/serenity /home/elias/src/ladybird/Build/ladybird

The assertion appears to be the call to VERIFY_NOT_REACHED() that is called if there is an error, and the following expression is not true: error.is_syscall() && error.code() == EAGAIN

rice7th commented 1 year ago

Same error here! hope it gets fixed soon

xyproto commented 1 year ago

I get the same assertion on Arch Linux, when building ladybird from the latest commit and just running it:

execvp: No such file or directory
VERIFICATION FAILED: false
/build/ladybird/src/ladybird/WebContentView.cpp:615
ConnectionBase::read_as_much_as_possible_from_socket_without_blocking: recv: Connection reset by peer (errno=104)
ConnectionBase::read_as_much_as_possible_from_socket_without_blocking: recv: Connection reset by peer (errno=104)
VERIFICATION FAILED: false
/build/ladybird/src/ladybird/build/serenity/Userland/Libraries/LibIPC/Connection.cpp:170
/usr/bin/ladybird: line 2: 68828 Illegal instruction     (core dumped) SERENITY_SOURCE_DIR=/usr/share/serenity /usr/share/serenity/Base/bin/ladybird

The Connection reset by peer (errno=104) error:

BertalanD commented 1 year ago

This will be fixed by https://github.com/SerenityOS/serenity/pull/16166. The crash was caused by the IPC layer not correctly handling the death of the WebContent process in some cases. As such, even after the fix lands, the affected website won't load, but at least the WebContent crash won't bring down the whole browser GUI.