Skip to content

Commit 2106209

Browse files
committed
Bug 1868629 - Don't attempt to recover from failure when creating GC markers for the first time r=sfink
The recovery behaviour was added so that attempting to enable parallel marking by setting a GC parameter didn't cause a hard failure if there was an allocation failure initializing the extra markers. However the change made it so we would ignore failing to allocate the first marker (required) on initialization. This would have been caught by the OOM test we have for creating contexts, but this uses the 'always fail' OOM injection mode. This means that an earlier unhandled OOM condtions can be masked by a later one that is handled. For peace of mind I changed the test to run in both single failure and permanent failure modes. Differential Revision: https://phabricator.services.mozilla.com/D195770 UltraBlame original commit: 12b53a3f19ff688bf80bd723e03511678147b7a7
1 parent 2da2792 commit 2106209

File tree

2 files changed

+65
-3
lines changed

2 files changed

+65
-3
lines changed

js/src/gc/GC.cpp

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4031,10 +4031,18 @@ size
40314031
}
40324032
#
40334033
endif
4034-
initOrDisableParallelMarking
4034+
if
4035+
(
4036+
!
4037+
updateMarkersVector
40354038
(
40364039
)
4040+
)
4041+
{
4042+
return
4043+
false
40374044
;
4045+
}
40384046
{
40394047
AutoLockGCBgAlloc
40404048
lock
@@ -6332,6 +6340,18 @@ initOrDisableParallelMarking
63326340
(
63336341
)
63346342
{
6343+
MOZ_ASSERT
6344+
(
6345+
markers
6346+
.
6347+
length
6348+
(
6349+
)
6350+
!
6351+
=
6352+
0
6353+
)
6354+
;
63356355
if
63366356
(
63376357
!

js/src/jsapi-tests/testOOM.cpp

Lines changed: 44 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,17 +166,52 @@ testName
166166
name
167167
;
168168
\
169+
for
170+
(
171+
bool
172+
always
173+
:
174+
{
175+
false
176+
true
177+
}
178+
)
179+
{
180+
\
181+
const
182+
char
183+
*
184+
subTest
185+
=
186+
always
187+
?
188+
"
189+
fail
190+
always
191+
"
192+
:
193+
"
194+
fail
195+
once
196+
"
197+
;
198+
\
169199
printf
170200
(
171201
"
172202
Test
173203
%
174204
s
205+
(
206+
%
207+
s
208+
)
175209
:
176210
started
177211
:
178212
"
179213
testName
214+
subTest
180215
)
181216
;
182217
\
@@ -226,7 +261,7 @@ js
226261
:
227262
:
228263
THREAD_TYPE_MAIN
229-
true
264+
always
230265
)
231266
#
232267
define
@@ -254,6 +289,10 @@ printf
254289
nTest
255290
%
256291
s
292+
(
293+
%
294+
s
295+
)
257296
:
258297
finished
259298
with
@@ -265,8 +304,9 @@ allocations
265304
\
266305
n
267306
"
268-
testName
269307
\
308+
testName
309+
subTest
270310
oomAfter
271311
-
272312
1
@@ -280,6 +320,8 @@ break
280320
\
281321
}
282322
\
323+
}
324+
\
283325
js
284326
:
285327
:

0 commit comments

Comments
 (0)