Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LibWeb: Don't try to wait for HTTP server to exit if kill call fails #2682

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

tcl3
Copy link
Member

@tcl3 tcl3 commented Dec 1, 2024

This change fixes a crash I saw locally where headless-browser would always crash with the following error just prior to exit:

VERIFICATION FAILED: !_temporary_result.is_error() at /home/tim/repos/ladybird/UI/Headless/Fixture.cpp:83
/home/tim/repos/ladybird/Build/release/lib/liblagom-ak.so.0(ak_verification_failed+0xef) [0x7032bd52790f]
/home/tim/repos/ladybird/Build/release/bin/headless-browser(+0x143e0) [0x56277a50a3e0]
/home/tim/repos/ladybird/Build/release/bin/headless-browser(+0x12658) [0x56277a508658]
/home/tim/repos/ladybird/Build/release/bin/headless-browser(+0x127f9) [0x56277a5087f9]
/home/tim/repos/ladybird/Build/release/bin/headless-browser(+0x268ee) [0x56277a51c8ee]
/home/tim/repos/ladybird/Build/release/bin/headless-browser(+0x27542) [0x56277a51d542]
/lib/x86_64-linux-gnu/libc.so.6(+0x2a1ca) [0x7032bce2a1ca]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0x8b) [0x7032bce2a28b]

This happened because the call to waitpid failed for the HTTP server process. This was because the HTTP server failed to start on my local machine because the address it wanted to use was already in use.

We now don't call waitpid if the prior call to kill failed.

I've also included a small fix to LibCore to return the correct error code from Process::wait_for_termination() if waitpid fails.

@rmg-x
Copy link
Contributor

rmg-x commented Dec 1, 2024

Is there any reason we still MUST the wait_for_termination() call? My PR (#2553) partially addresses this by just warning when that fails instead of crashing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants