SerenityOS / serenity

The Serenity Operating System 🐞
https://serenityos.org
BSD 2-Clause "Simplified" License
30.63k stars 3.19k forks source link

Browser: crash when opening file:///path/does/not/exist #1516

Closed bcoles closed 4 years ago

bcoles commented 4 years ago

Navigating to a file:/// URL in the address bar causes in the browser to crash if the file does not exist.

Browser(20): HtmlView::load: file:///home/anon/www/doesnoteist.html
Browser(20): ResourceLoader::load: Error: No such file or directory
Browser(20): Load failed!
USERSPACE(20) ASSERTION FAILED: false
HtmlView.cpp:352 in Web::HtmlView::load(const AK::URL&)::<lambda(auto:12)> [with auto:12 = AK::ByteBuffer]
[colonel(0:0)]: Terminating due to signal 6
[Finalizer(3:3)]: 0xdeadc0de  Kernel::Scheduler::switch_now() +62
0xdeadc0de  Kernel::Scheduler::yield() +86
0xdeadc0de  Kernel::Thread::yield_without_holding_big_lock() +36
0xdeadc0de  Kernel::Process::sys$kill(int, int) +400
0xdeadc0de  syscall_handler +1130
0xdeadc0de  syscall_asm_entry +29
0x080eb33d  raise +22
0x08048320  abort +13
0x080eb2c5  kill +0
0x08055e54  AK::Function<void (AK::ByteBuffer const&)>::CallableWrapper<Web::HtmlView::load(AK::URL const&)::{lambda(auto:1)#1}>::call(AK::ByteBuffer const&) const +1530
0x0805fab5  Web::ResourceLoader::load(AK::URL const&, AK::Function<void (AK::ByteBuffer const&)>) +289
0x08055808  Web::HtmlView::load(AK::URL const&) +222
0x0804a134  AK::Function<void ()>::CallableWrapper<main::{lambda()#6}>::call() const +62
0x080978bf  GUI::TextEditor::keydown_event(GUI::KeyEvent&) +133
0x080ca95a  Core::Object::dispatch_event(Core::Event&, Core::Object*) +86
0x080a3905  GUI::Window::event(Core::Event&) +2027
0x080ca95a  Core::Object::dispatch_event(Core::Event&, Core::Object*) +86
0x080c5a7e  Core::EventLoop::pump(Core::EventLoop::WaitMode) +462
0x080c5c35  Core::EventLoop::exec() +71
0x0807aab5  GUI::Application::exec() +29
0x08049118  main +3404
0x080499f3  _start +94

WindowServer(13): ClientConnection{0x02911ca2}: Client disconnected: 8
WindowServer(13): Event type 3011 with no receiver :(
ProtocolServer(21): PSClientConnection{0x01a70296}: Client disconnected: 1

Related: #1210

linusg commented 4 years ago

@bcoles I think this issue can be closed :)