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

Fault logs should not be skipped #15337

Merged

Conversation

pvollan
Copy link
Contributor

@pvollan pvollan commented Jun 27, 2023

@pvollan pvollan requested a review from cdumez as a code owner June 27, 2023 15:49
@pvollan pvollan self-assigned this Jun 27, 2023
@pvollan pvollan added the WebKit Misc. For miscellaneous bugs in the WebKit framework (and not JavaScriptCore or WebCore). label Jun 27, 2023
@@ -723,14 +723,30 @@ static void registerLogHook()
if (msg->buffer_sz > 1024)
return;

// Skip faults and debug logs in non-internal builds.
if (type == OS_LOG_TYPE_FAULT || type == OS_LOG_TYPE_DEBUG)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh wow, this is an important fix lol


auto connectionID = WebProcess::singleton().networkProcessConnectionID();
if (connectionID)
IPC::Connection::send(connectionID, Messages::NetworkConnectionToWebProcess::LogOnBehalfOfWebContent(logChannel.bytesInludingNullTerminator(), logCategory.bytesInludingNullTerminator(), logString, OS_LOG_TYPE_ERROR, getpid()), 0);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest with still use the dispatch queue but use WorkQueue::dispatchWithQoS() to make the message priority higher. Otherwise, we can end up with out-of-order logging which would be unfortunate.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should also pass the QoS to IPC::Connection::send() for FAULT messages (already supported).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, good point, will fix!

Thanks for reviewing!

@pvollan pvollan force-pushed the eng/Fault-logs-should-not-be-skipped branch from ca29d61 to eba8117 Compare June 27, 2023 16:40
@pvollan pvollan force-pushed the eng/Fault-logs-should-not-be-skipped branch from eba8117 to 8528226 Compare June 27, 2023 16:48

// Send fault logs with high priority. If the WebContent process is terminated, we might not be able to send the log in time.
if (type == OS_LOG_TYPE_FAULT) {
type = type == OS_LOG_TYPE_ERROR;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That was a typo, fixed in latest patch :)

@pvollan pvollan force-pushed the eng/Fault-logs-should-not-be-skipped branch from 8528226 to ddaee3f Compare June 27, 2023 16:52
@pvollan pvollan requested a review from cdumez June 27, 2023 16:52
Copy link
Contributor

@cdumez cdumez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@pvollan pvollan added the merge-queue Applied to send a pull request to merge-queue label Jun 27, 2023
https://bugs.webkit.org/show_bug.cgi?id=258577
rdar://111393438

Reviewed by Chris Dumez.

Fault logs should not be skipped in the WebContent process, but sent asap to the Networking process.

* Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm:
(WebKit::registerLogHook):

Canonical link: https://commits.webkit.org/265558@main
@webkit-commit-queue webkit-commit-queue force-pushed the eng/Fault-logs-should-not-be-skipped branch from ddaee3f to 4e7db72 Compare June 27, 2023 18:56
@webkit-commit-queue
Copy link
Collaborator

Committed 265558@main (4e7db72): https://commits.webkit.org/265558@main

Reviewed commits have been landed. Closing PR #15337 and removing active labels.

@webkit-commit-queue webkit-commit-queue merged commit 4e7db72 into WebKit:main Jun 27, 2023
@webkit-commit-queue webkit-commit-queue removed the merge-queue Applied to send a pull request to merge-queue label Jun 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
WebKit Misc. For miscellaneous bugs in the WebKit framework (and not JavaScriptCore or WebCore).
Projects
None yet
4 participants