Bug 260303 - os_log_set_hook return value is improperly ignored
Summary: os_log_set_hook return value is improperly ignored
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit Misc. (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Brent Fulgham
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2023-08-16 14:28 PDT by Brent Fulgham
Modified: 2023-08-17 11:22 PDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Brent Fulgham 2023-08-16 14:28:05 PDT
In Bug 253342 we adopted `os_log_set_hook` so that we could relay logging information from the WebContent process to the Network process to add to the logging system.

The documentation for this method says:

 * os_log_set_hook returns the previously registered hook or NULL
 * when this function is first called. As a client, if you register a hook and the
 * return value is not NULL then it is your responsibility to chain the
 * previous hook into the new hook so that both are invoked.

Any previously registered hook is unlikely to be able to interact with `logd`, since we are sandboxed, but perhaps there are other side-effects we want to retain.

To comply with the API design, we should invoke any preregistered hooks before calling our own logic.

<rdar://112032774>
Comment 1 Brent Fulgham 2023-08-16 14:41:18 PDT
Pull request: https://github.com/WebKit/WebKit/pull/16754
Comment 2 EWS 2023-08-17 11:22:15 PDT
Committed 267007@main (3372a68e3655): <https://commits.webkit.org/267007@main>

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