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

REGRESSION (261793@main): [Mail] Clicking markup button causes image/attachment to go blank/disappear #12887

Merged
merged 1 commit into from Apr 18, 2023

Conversation

whsieh
Copy link
Member

@whsieh whsieh commented Apr 18, 2023

bbae082

REGRESSION (261793@main): [Mail] Clicking markup button causes image/attachment to go blank/disappear
https://bugs.webkit.org/show_bug.cgi?id=255627
rdar://107635311

Reviewed by Aditya Keerthi.

After the changes in 261793@main, `WebKit::ContextMenuContextData` no longer decodes properly in the
UI process, when created via service controls codepaths (i.e. when clicking the services rollover
button over an attachment in Mail). This is because one of the new members, `m_hasEntireImage`, is
uninitialized to either `true` or `false` and ends up triggering undefined behavior; in turn, code
in the UI process expects either a value of exactly 0 or 1 when decoding `bool` types, so we
subsequently fail to decode and `MESSAGE_CHECK` the Mail web content process.

Fix this by simple initializing `m_hasEntireImage` (I've also added a few more initial values to
harden against similar bugs in the future).

Covered by the existing API test: ImageAnalysisTests.RemoveBackgroundItemInServicesMenu, which began
timing out after 261793@main. Also, credit to Aditya for being the first to spot that
`m_hasEntireImage` is uninitialized.

* Source/WebCore/page/ContextMenuContext.h:
* Source/WebKit/Shared/ContextMenuContextData.h:
* Source/WebKit/UIProcess/API/APIContextMenuElementInfoMac.h:

Canonical link: https://commits.webkit.org/263109@main

03728dd

Misc iOS, tvOS & watchOS macOS Linux Windows
βœ… πŸ§ͺ style   πŸ›  ios βœ… πŸ›  mac βœ… πŸ›  wpe   πŸ›  wincairo
βœ… πŸ§ͺ bindings βœ… πŸ›  ios-sim βœ… πŸ›  mac-AS-debug βœ… πŸ§ͺ wpe-wk2
βœ… πŸ§ͺ webkitperl   πŸ§ͺ ios-wk2 βœ… πŸ§ͺ api-mac βœ… πŸ›  gtk
  πŸ§ͺ ios-wk2-wpt βœ… πŸ§ͺ mac-wk1   πŸ§ͺ gtk-wk2
❌ πŸ§ͺ api-ios βœ… πŸ§ͺ mac-wk2 βœ… πŸ§ͺ api-gtk
βœ… πŸ›  tv   πŸ§ͺ mac-AS-debug-wk2
βœ… πŸ›  tv-sim βœ… πŸ§ͺ mac-wk2-stress
βœ… πŸ›  πŸ§ͺ merge βœ… πŸ›  watch
βœ… πŸ›  watch-sim

@whsieh whsieh requested a review from cdumez as a code owner April 18, 2023 22:09
@whsieh whsieh self-assigned this Apr 18, 2023
@whsieh whsieh changed the title ??? REGRESSION (261793@main): [Mail] Clicking markup button causes image/attachment to go blank/disappear Apr 18, 2023
@whsieh whsieh added the Platform Portability improvements and other general platform improvements not driven directly by site bugs. label Apr 18, 2023
@whsieh
Copy link
Member Author

whsieh commented Apr 18, 2023

Thanks for the review!

@whsieh whsieh added the merge-queue Applied to send a pull request to merge-queue label Apr 18, 2023
…attachment to go blank/disappear

https://bugs.webkit.org/show_bug.cgi?id=255627
rdar://107635311

Reviewed by Aditya Keerthi.

After the changes in 261793@main, `WebKit::ContextMenuContextData` no longer decodes properly in the
UI process, when created via service controls codepaths (i.e. when clicking the services rollover
button over an attachment in Mail). This is because one of the new members, `m_hasEntireImage`, is
uninitialized to either `true` or `false` and ends up triggering undefined behavior; in turn, code
in the UI process expects either a value of exactly 0 or 1 when decoding `bool` types, so we
subsequently fail to decode and `MESSAGE_CHECK` the Mail web content process.

Fix this by simple initializing `m_hasEntireImage` (I've also added a few more initial values to
harden against similar bugs in the future).

Covered by the existing API test: ImageAnalysisTests.RemoveBackgroundItemInServicesMenu, which began
timing out after 261793@main. Also, credit to Aditya for being the first to spot that
`m_hasEntireImage` is uninitialized.

* Source/WebCore/page/ContextMenuContext.h:
* Source/WebKit/Shared/ContextMenuContextData.h:
* Source/WebKit/UIProcess/API/APIContextMenuElementInfoMac.h:

Canonical link: https://commits.webkit.org/263109@main
@webkit-commit-queue
Copy link
Collaborator

Committed 263109@main (bbae082): https://commits.webkit.org/263109@main

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

@webkit-commit-queue webkit-commit-queue merged commit bbae082 into WebKit:main Apr 18, 2023
@webkit-commit-queue webkit-commit-queue removed the merge-queue Applied to send a pull request to merge-queue label Apr 18, 2023
@whsieh whsieh deleted the eng/255627 branch April 19, 2023 00:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Platform Portability improvements and other general platform improvements not driven directly by site bugs.
Projects
None yet
4 participants