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
[UNIX] Web process crash in websites using service workers while doing garbage collection #6360
Conversation
EWS run on previous version of this PR (hash c212bd0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for fixing this.
r=me with suggestions for improvements.
|
||
for (auto* handle : m_blocks) { | ||
if (!handle) | ||
continue; | ||
|
||
auto markedBlockSizeInBytes = static_cast<size_t>(reinterpret_cast<char*>(handle->end()) - reinterpret_cast<char*>(handle->start())); | ||
char* pageStart = reinterpret_cast<char*>(handle->atomAt(0)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of using atomAt(0)
, can you add a MarkedBlock::Handle::pageStart()
method that returns the value of reinterpret_cast<char*>(atomAt(0))
? I think that would be clearer and would have avoided this fall out when we changed the position of the header/footer in the MarkedBlock.
Have you also grepped the code for uses of handle->start() to make sure that there're no other instances of this bug?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good.
|
||
for (auto* handle : m_blocks) { | ||
if (!handle) | ||
continue; | ||
|
||
auto markedBlockSizeInBytes = static_cast<size_t>(reinterpret_cast<char*>(handle->end()) - reinterpret_cast<char*>(handle->start())); | ||
char* pageStart = reinterpret_cast<char*>(handle->atomAt(0)); | ||
auto markedBlockSizeInBytes = static_cast<size_t>(reinterpret_cast<char*>(handle->end()) - pageStart); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's also introduce and use a MarkedBlock::Handle::pageSize()
for this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually MarkedBlock
can be multiple pageSize
, or so, so I think we should just call it backingStorageSize
.
c212bd0
to
3720a87
Compare
β¦g garbage collection https://bugs.webkit.org/show_bug.cgi?id=247727 rdar://102209090 Reviewed by Mark Lam. MarkedBlock::Handle::start() is not returning page aligned address, so this is not appropriate for mincore. * Source/JavaScriptCore/heap/BlockDirectory.cpp: (JSC::BlockDirectory::updatePercentageOfPagedOutPages): Canonical link: https://commits.webkit.org/256554@main
3720a87
to
292a165
Compare
Committed 256554@main (292a165): https://commits.webkit.org/256554@main Reviewed commits have been landed. Closing PR #6360 and removing active labels. |
292a165
3720a87
π macπ wpeπ π§ͺ winπ mac-debugπ wincairoπ§ͺ ios-wk2π mac-AS-debugπ§ͺ gtk-wk2π§ͺ api-iosπ§ͺ api-macπ§ͺ api-gtkπ§ͺ mac-wk1π§ͺ mac-wk2π§ͺ jsc-armv7-testsπ§ͺ mac-AS-debug-wk2π§ͺ mac-wk2-stress