| Summary: | [iOS 15] Nullptr crashes in ShareableBitmap::createGraphicsContext, mostly on twitter.com | ||||||
|---|---|---|---|---|---|---|---|
| Product: | WebKit | Reporter: | Ali Juma <ajuma> | ||||
| Component: | Images | Assignee: | Cameron McCormack (:heycam) <heycam> | ||||
| Status: | RESOLVED FIXED | ||||||
| Severity: | Normal | CC: | heycam, sabouhallawa, webkit-bug-importer, wenson_hsieh | ||||
| Priority: | P2 | Keywords: | InRadar | ||||
| Version: | WebKit Nightly Build | ||||||
| Hardware: | Unspecified | ||||||
| OS: | Unspecified | ||||||
| Attachments: |
|
||||||
|
Description
Ali Juma
2021-11-16 14:50:10 PST
Thanks for the report, Ali. There were a few changes to ShareableBitmap in the iOS 15 release. I'll try to reproduce. It's possible ShareableBitmap::create returned null due to either numBytes overflowing (though that would require something like a 32k x 32k image) or the ShareableBitmapMalloc::tryMalloc call failing. Either way, PageClientImpl::startDrag should probably defend against ShareableBitmap::create returning null. (In reply to Cameron McCormack (:heycam) from comment #3) > It's possible ShareableBitmap::create returned null due to either numBytes > overflowing (though that would require something like a 32k x 32k image) or > the ShareableBitmapMalloc::tryMalloc call failing. Either way, > PageClientImpl::startDrag should probably defend against > ShareableBitmap::create returning null. Thanks for having a look. A large fraction of the crash reports are happening when free memory is low, so it's probably the ShareableBitmapMalloc::tryMalloc call failing. (In reply to Ali Juma from comment #4) > Thanks for having a look. A large fraction of the crash reports are > happening when free memory is low, so it's probably the > ShareableBitmapMalloc::tryMalloc call failing. Oh actually this is the ShareableBitmap::create call that takes a shared memory handle, so there's no allocation failure here. But there are still paths where we can return null (mapping the shared memory failing, or numBytes is too big, or the shared memory size not matching the number of bytes we expect). Created attachment 444579 [details]
Patch
Committed r285976 (244373@main): <https://commits.webkit.org/244373@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 444579 [details]. |