Changeset 262100 in webkit
- Timestamp:
- May 23, 2020, 9:35:29 AM (5 years ago)
- Location:
- trunk
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified trunk/JSTests/ChangeLog ¶
r262088 r262100 1 2020-05-23 Caio Lima <ticaiolima@gmail.com> 2 3 [bmalloc] Fix OOM errors on MIPS after r261667 4 https://bugs.webkit.org/show_bug.cgi?id=212016 5 6 Reviewed by Yusuke Suzuki. 7 8 * stress/array-buffer-view-watchpoint-can-be-fired-in-really-add-in-dfg.js: 9 * stress/big-int-mod-memory-stress.js: 10 * stress/incremental-marking-should-not-dead-lock-in-new-property-transition.js: 11 1 12 2020-05-22 Alexey Shvayka <shvaikalesh@gmail.com> 2 13 -
TabularUnified trunk/JSTests/stress/array-buffer-view-watchpoint-can-be-fired-in-really-add-in-dfg.js ¶
r261862 r262100 1 //@ skip if ["arm", "mips", "powerpc", "powerpc64", "s390"].include?($architecture) and $hostOS == "linux" 1 //@ skip if ["arm", "powerpc", "powerpc64", "s390"].include?($architecture) and $hostOS == "linux" 2 //@ requireOptions("-e", "let iterations=40000") if ["mips"].include?($architecture) 2 3 //@ runDefault("--jitPolicyScale=0") 3 4 -
TabularUnified trunk/JSTests/stress/big-int-mod-memory-stress.js ¶
r261743 r262100 1 //@ skip if ["arm", "mips"].include?($architecture)2 1 //@ runBigIntEnabled 3 2 -
TabularUnified trunk/JSTests/stress/incremental-marking-should-not-dead-lock-in-new-property-transition.js ¶
r261743 r262100 1 //@ skip if ["arm", "mips"].include?($architecture)2 1 //@ skip if $hostOS == "playstation" 3 2 //@ runDefault("--gcIncrementScale=100", "--gcIncrementBytes=10", "--numberOfGCMarkers=1") -
TabularUnified trunk/LayoutTests/ChangeLog ¶
r262097 r262100 1 2020-05-23 Caio Lima <ticaiolima@gmail.com> 2 3 [bmalloc] Fix OOM errors on MIPS after r261667 4 https://bugs.webkit.org/show_bug.cgi?id=212016 5 6 Reviewed by Yusuke Suzuki. 7 8 * js/script-tests/stack-overflow-regexp.js: 9 1 10 2020-05-23 Zalan Bujtas <zalan@apple.com> 2 11 -
TabularUnified trunk/LayoutTests/js/script-tests/stack-overflow-regexp.js ¶
r261808 r262100 1 1 // https://bugs.webkit.org/show_bug.cgi?id=190755 2 //@ skip if ["arm", "mips"].include?($architecture)and $hostOS == "linux"2 //@ skip if $architecture == "arm" and $hostOS == "linux" 3 3 // &&&& 4 4 description('Test that we do not overflow the stack while handling regular expressions'); -
TabularUnified trunk/Source/bmalloc/ChangeLog ¶
r261827 r262100 1 2020-05-23 Caio Lima <ticaiolima@gmail.com> 2 3 [bmalloc] Fix OOM errors on MIPS after r261667 4 https://bugs.webkit.org/show_bug.cgi?id=212016 5 6 Reviewed by Yusuke Suzuki. 7 8 The way we were calculating `newBegin` and `newEnd` on 9 `ObjectTypeTable::set` when index is out of bounds didn't consider 10 cases where `bits->begin() - bits->count()` or `index - ObjectTypeTable::Bits::bitCountPerWord * 4` 11 can underflow and `bits->end() + bits->count()` can overflow. 12 Given that, the value used is going to be `index` or `index + 1`. 13 Since we extend the size of bitvector everytime we have an OOB, this can cause a pathological case 14 that memory will keep extending quite often until systems reachs OOM. 15 It is reproducible on ARMv7 and MIPS architectures on 16 `stress/array-buffer-view-watchpoint-can-be-fired-in-really-add-in-dfg.js`, 17 `stress/big-int-mod-memory-stress.js` and some other tests. 18 This patch is including a verification if those operations are going 19 to overflow/underflow, and properly set `newBegin` to 0 and `newEnd` 20 to UINT_MAX when we observe such behavior. 21 22 * bmalloc/ObjectTypeTable.cpp: 23 (bmalloc::ObjectTypeTable::set): 24 1 25 2020-05-18 Mark Lam <mark.lam@apple.com> 2 26 -
TabularUnified trunk/Source/bmalloc/bmalloc/ObjectTypeTable.cpp ¶
r261667 r262100 42 42 // This is initial allocation of ObjectTypeTable. In this case, it could be possible that for the first registration, 43 43 // some VAs are already allocated for a different purpose, and later they will be reused for bmalloc. In that case, 44 // soon, we will see a smaller index request than this initial one. We subtract a 128MB offset to the initial newBegin 45 // to cover such patterns without extending table too quickly. 46 newBegin = std::min<unsigned>(index, index - ObjectTypeTable::Bits::bitCountPerWord * 4); 44 // soon, we will see a smaller index request than this initial one. We try to subtract a 128MB offset to the initial 45 // newBegin to cover such patterns without extending table too quickly, and if we can't subtract 128MB, we will set 46 // newBegin to 0. 47 constexpr unsigned offsetForInitialAllocation = ObjectTypeTable::Bits::bitCountPerWord * 4; 48 if (index < offsetForInitialAllocation) 49 newBegin = 0; 50 else 51 newBegin = index - offsetForInitialAllocation; 47 52 newEnd = index + 1; 48 53 } else if (index < bits->begin()) { 49 54 BASSERT(bits->begin()); 50 55 BASSERT(bits->end()); 51 newBegin = std::min<unsigned>(index, bits->begin() - bits->count()); 56 // We need to verify if "bits->begin() - bits->count()" doesn't underflow, 57 // otherwise we will set "newBegin" as "index" and it creates a pathological 58 // case that will keep increasing BitVector everytime we access 59 // "index < bits->begin()". 60 if (bits->begin() < bits->count()) 61 newBegin = 0; 62 else 63 newBegin = std::min<unsigned>(index, bits->begin() - bits->count()); 52 64 newEnd = bits->end(); 53 65 } else { … … 55 67 BASSERT(bits->end()); 56 68 newBegin = bits->begin(); 57 newEnd = std::max<unsigned>(index + 1, bits->end() + bits->count()); 69 // We need to verify if "bits->end() + bits->count()" doesn't overflow, 70 // otherwise we will set "newEnd" as "index + 1" and it creates a 71 // pathological case that will keep increasing BitVector everytime we access 72 // "index > bits->end()". 73 if (std::numeric_limits<unsigned>::max() - bits->count() < bits->end()) 74 newEnd = std::numeric_limits<unsigned>::max(); 75 else 76 newEnd = std::max<unsigned>(index + 1, bits->end() + bits->count()); 58 77 } 59 78 newBegin = static_cast<unsigned>(roundDownToMultipleOf<size_t>(ObjectTypeTable::Bits::bitCountPerWord, newBegin));
Note:
See TracChangeset
for help on using the changeset viewer.