Bug 207807

Summary: REGRESSION(r256633): 4% memory regression in new Membuster, possibly some leaking in WebKit Malloc? (Requested by yusukesuzuki on #webkit).
Product: WebKit Reporter: WebKit Commit Bot <commit-queue>
Component: New BugsAssignee: WebKit Commit Bot <commit-queue>
Status: RESOLVED FIXED    
Severity: Normal CC: chris.reid, Hironori.Fujii, webkit-bug-importer, ysuzuki
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 197684    
Attachments:
Description Flags
ROLLOUT of r256633
none
Potential fix none

Description WebKit Commit Bot 2020-02-14 22:46:45 PST
https://trac.webkit.org/changeset/256633 broke the build:
4% memory regression in new Membuster, possibly some leaking in WebKit Malloc? (Requested by yusukesuzuki on #webkit).

This is an automatic bug report generated by webkitbot. If this bug
report was created because of a flaky test, please file a bug for the flaky
test (if we don't already have one on file) and dup this bug against that bug
so that we can track how often these flaky tests fail.
Comment 1 WebKit Commit Bot 2020-02-14 22:46:53 PST
Created attachment 390856 [details]
ROLLOUT of r256633

Any committer can land this patch automatically by marking it commit-queue+.  The commit-queue will build and test the patch before landing to ensure that the rollout will be successful.  This process takes approximately 15 minutes.

If you would like to land the rollout faster, you can use the following command:

  webkit-patch land-attachment ATTACHMENT_ID

where ATTACHMENT_ID is the ID of this attachment.
Comment 2 WebKit Commit Bot 2020-02-14 22:54:42 PST
Comment on attachment 390856 [details]
ROLLOUT of r256633

Clearing flags on attachment: 390856

Committed r256700: <https://trac.webkit.org/changeset/256700>
Comment 3 WebKit Commit Bot 2020-02-14 22:54:43 PST
All reviewed patches have been landed.  Closing bug.
Comment 4 Radar WebKit Bug Importer 2020-02-14 22:55:13 PST
<rdar://problem/59483218>
Comment 5 Christopher Reid 2020-02-15 03:50:43 PST
Created attachment 390861 [details]
Potential fix

These are the changes isolated for mac and a potential fix.

I believe the cause of the memory regression was because the file descriptor for the mapping was only opened with O_WRONLY and not O_RDWR which caused the mmap calls to fail on mac with EPERM.
The memory regression was likely resources stored in memory that were previously in a mapped file.

I added FileOpenMode::ReadWrite to match the flags from before that patch `O_RDWR | O_CREAT | O_EXCL`.
Comment 6 Yusuke Suzuki 2020-02-16 01:14:03 PST
(In reply to Christopher Reid from comment #5)
> Created attachment 390861 [details]
> Potential fix
> 
> These are the changes isolated for mac and a potential fix.
> 
> I believe the cause of the memory regression was because the file descriptor
> for the mapping was only opened with O_WRONLY and not O_RDWR which caused
> the mmap calls to fail on mac with EPERM.
> The memory regression was likely resources stored in memory that were
> previously in a mapped file.
> 
> I added FileOpenMode::ReadWrite to match the flags from before that patch
> `O_RDWR | O_CREAT | O_EXCL`.

I'm building Safari and running new Membuster to ensure this patch fixes the issue.