RESOLVED FIXED 200103
[bmalloc] Add IsoHeap test to ensure that IsoHeap pages are not allocating too large VA
https://bugs.webkit.org/show_bug.cgi?id=200103
Summary [bmalloc] Add IsoHeap test to ensure that IsoHeap pages are not allocating to...
Yusuke Suzuki
Reported 2019-07-24 17:41:48 PDT
[bmalloc] Add IsoHeap test to ensure that IsoHeap pages are not allocating too large VA
Attachments
Patch (44.67 KB, patch)
2019-07-24 17:53 PDT, Yusuke Suzuki
mark.lam: review+
Patch (49.01 KB, patch)
2019-07-24 19:04 PDT, Yusuke Suzuki
commit-queue: commit-queue-
Yusuke Suzuki
Comment 1 2019-07-24 17:50:20 PDT
Yusuke Suzuki
Comment 2 2019-07-24 17:53:31 PDT
EWS Watchlist
Comment 3 2019-07-24 17:56:16 PDT
Attachment 374841 [details] did not pass style-queue: ERROR: Source/WTF/wtf/spi/cocoa/MachVMSPI.h:38: mach_vm_allocate is incorrectly named. Don't use underscores in your identifier names. [readability/naming/underscores] [4] ERROR: Source/WTF/wtf/spi/cocoa/MachVMSPI.h:39: mach_vm_deallocate is incorrectly named. Don't use underscores in your identifier names. [readability/naming/underscores] [4] ERROR: Source/WTF/wtf/spi/cocoa/MachVMSPI.h:40: mach_vm_map is incorrectly named. Don't use underscores in your identifier names. [readability/naming/underscores] [4] ERROR: Source/WTF/wtf/spi/cocoa/MachVMSPI.h:42: mach_vm_protect is incorrectly named. Don't use underscores in your identifier names. [readability/naming/underscores] [4] ERROR: Source/WTF/wtf/spi/cocoa/MachVMSPI.h:43: mach_vm_region is incorrectly named. Don't use underscores in your identifier names. [readability/naming/underscores] [4] ERROR: Source/WTF/wtf/spi/cocoa/MachVMSPI.h:45: mach_vm_region_recurse is incorrectly named. Don't use underscores in your identifier names. [readability/naming/underscores] [4] ERROR: Source/WTF/wtf/spi/cocoa/MachVMSPI.h:46: mach_vm_purgable_control is incorrectly named. Don't use underscores in your identifier names. [readability/naming/underscores] [4] Total errors found: 7 in 19 files If any of these errors are false positives, please file a bug against check-webkit-style.
Mark Lam
Comment 4 2019-07-24 18:26:30 PDT
Comment on attachment 374841 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=374841&action=review r=me > Source/WebCore/PAL/PAL.xcodeproj/project.pbxproj:-46 > - 0C2DA1481F3BEB4900DBC317 /* MachVMSPI.h in Headers */ = {isa = PBXBuildFile; fileRef = 0C2DA12C1F3BEB4900DBC317 /* MachVMSPI.h */; }; I don't see the old MachVMSPI.h being deleted. Are you missing a "svn rm"?
Yusuke Suzuki
Comment 5 2019-07-24 18:34:46 PDT
Comment on attachment 374841 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=374841&action=review > Tools/TestWebKitAPI/Tests/WTF/bmalloc/IsoHeap.cpp:2474 > + for (unsigned i = 0; i < 100; ++i) I'll add a comment that this is exhausting IsoHeap shared tier. > Tools/TestWebKitAPI/Tests/WTF/bmalloc/IsoHeap.cpp:2490 > + EXPECT_LT((static_cast<int64_t>(after[VM_MEMORY_JAVASCRIPT_JIT_REGISTER_FILE].reserved) - static_cast<int64_t>(before[VM_MEMORY_JAVASCRIPT_JIT_REGISTER_FILE].reserved)) * static_cast<int64_t>(WTF::vmPageSize()), 100 * static_cast<int64_t>(WTF::vmPageSize())); I'll add a comment like this, // Previously, we have an issue that every thread leaks 1~ page. Underlying IsoHeap implementation can add some IsoPages during this test and it would change the value of this, but we can say that such an implementation change would not add 100 pages, and if we have a leak in IsoTLS, it is larger than 1000 pages and this test correctly catch the issue. > Tools/TestWebKitAPI/Tests/WTF/bmalloc/IsoHeap.cpp:2518 > + EXPECT_LT((static_cast<int64_t>(after[VM_MEMORY_JAVASCRIPT_JIT_REGISTER_FILE].reserved) - static_cast<int64_t>(before[VM_MEMORY_JAVASCRIPT_JIT_REGISTER_FILE].reserved)) * static_cast<int64_t>(WTF::vmPageSize()), (50 << 20)); I'll add a comment like this, // We picked 50MB here to make this test work even if the underlying implementation of IsoHeap is changed, like, adding more # of IsoHeap shared tier instances. // Currently, this number says 31MB in macOS, so 50MB threshold can catch the issue if the catastrophic thing happens. For example, if we revert https://bugs.webkit.org/show_bug.cgi?id=200024, // we will see 2GB VA allocations here, which can be caught by this test.
Yusuke Suzuki
Comment 6 2019-07-24 19:04:01 PDT
Created attachment 374845 [details] Patch Patch for landing
EWS Watchlist
Comment 7 2019-07-24 19:06:09 PDT
Attachment 374845 [details] did not pass style-queue: ERROR: Source/WTF/wtf/spi/cocoa/MachVMSPI.h:38: mach_vm_allocate is incorrectly named. Don't use underscores in your identifier names. [readability/naming/underscores] [4] ERROR: Source/WTF/wtf/spi/cocoa/MachVMSPI.h:39: mach_vm_deallocate is incorrectly named. Don't use underscores in your identifier names. [readability/naming/underscores] [4] ERROR: Source/WTF/wtf/spi/cocoa/MachVMSPI.h:40: mach_vm_map is incorrectly named. Don't use underscores in your identifier names. [readability/naming/underscores] [4] ERROR: Source/WTF/wtf/spi/cocoa/MachVMSPI.h:42: mach_vm_protect is incorrectly named. Don't use underscores in your identifier names. [readability/naming/underscores] [4] ERROR: Source/WTF/wtf/spi/cocoa/MachVMSPI.h:43: mach_vm_region is incorrectly named. Don't use underscores in your identifier names. [readability/naming/underscores] [4] ERROR: Source/WTF/wtf/spi/cocoa/MachVMSPI.h:45: mach_vm_region_recurse is incorrectly named. Don't use underscores in your identifier names. [readability/naming/underscores] [4] ERROR: Source/WTF/wtf/spi/cocoa/MachVMSPI.h:46: mach_vm_purgable_control is incorrectly named. Don't use underscores in your identifier names. [readability/naming/underscores] [4] Total errors found: 7 in 19 files If any of these errors are false positives, please file a bug against check-webkit-style.
WebKit Commit Bot
Comment 8 2019-07-24 20:26:36 PDT
Comment on attachment 374845 [details] Patch Rejecting attachment 374845 [details] from commit-queue. Failed to run "['/Volumes/Data/EWS/WebKit/Tools/Scripts/webkit-patch', '--status-host=webkit-queues.webkit.org', '--bot-id=webkit-cq-03', 'validate-changelog', '--check-oops', '--non-interactive', 374845, '--port=mac']" exit_code: 1 cwd: /Volumes/Data/EWS/WebKit ChangeLog entry in Source/WTF/ChangeLog contains OOPS!. Full output: https://webkit-queues.webkit.org/results/12806511
Yusuke Suzuki
Comment 9 2019-07-24 20:42:16 PDT
Note You need to log in before you can comment on or make changes to this bug.