Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update view.FindSidebar.reset to call gc #1362

Closed
wants to merge 1 commit into from
Closed

Conversation

beru
Copy link

@beru beru commented Sep 21, 2024

This PR adds a workaround to resolve the problem reported in #1358 .

@lutzroeder
Copy link
Owner

lutzroeder commented Sep 21, 2024

What is causing the issue, is this a known external bug? The workaround applies only for some users and given it's rather general might have other side effects. Is it possible to track down the root cause upstream?

@lutzroeder lutzroeder closed this Sep 21, 2024
@beru beru deleted the gc branch September 22, 2024 00:27
@beru
Copy link
Author

beru commented Sep 22, 2024

With efficientdet-d3.onnx file, I see the following messages on a console window after repeating FIND sidebar by typing Ctrl+F keys. So far, I don't see the problem reproduces with other files.

case no.1
DevTools listening on ws://127.0.0.1:9222/devtools/browser/bebbeeab-96a2-440e-b2d8-1e86d128548b

<--- Last few GCs --->

[7740:0000543000860000]    31770 ms: Mark-Compact (reduce) 71.1 (91.1) -> 62.8 (68.0) MB, pooled: 0 MB, 592.56 / 0.00 ms  (average mu = 0.959, current mu = 0.942) CppHeap allocation failure; GC in old space requested
[7740:0000543000860000]    33112 ms: Mark-Compact (reduce) 62.8 (68.0) -> 62.8 (65.3) MB, pooled: 0 MB, 1341.66 / 0.00 ms  (average mu = 0.828, current mu = 0.000) CppHeap allocation failure; GC in old space requested


<--- JS stacktrace --->

FATAL ERROR: Oilpan: Large allocation. Ran out of reservation Allocation failed - process out of memory
----- Native stack trace -----

 1: 00007FF779087F4A uv_cpumask_size+56266
 2: 00007FF77900228B node::OnFatalError+747
 3: 00007FF77C296CB4 v8::Function::NewInstance+868
 4: 00007FF77C296C23 v8::Function::NewInstance+723
 5: 00007FF77C357298 v8::CppHeap::CollectGarbageInYoungGenerationForTesting+296
 6: 00007FF77C68D20B cppgc::internal::Fatal+91
 7: 00007FF77AC7C81D cppgc::LivenessBroker::IsHeapObjectAliveImpl+20013
 8: 00007FF77AC75B16 cppgc::internal::MakeGarbageCollectedTraitInternal::Allocate+230
 9: 00007FF77DB32503 Cr_z_adler32_combine+3706771
10: 00007FF77DB324A0 Cr_z_adler32_combine+3706672
11: 00007FF77DB31EF3 Cr_z_adler32_combine+3705219
12: 00007FF77E1999DF sqlite3_dbdata_init+1665087
13: 00007FF7794EA6CC uv_fs_get_path+185884
14: 00007FF77B3132B3 Cr_z_adler32+1760611
15: 00007FF77B31606D Cr_z_adler32+1772317
16: 00007FF77F564A7C sqlite3_dbdata_init+22419676
17: 00007FF77AF287F3 v8::internal::compiler::CompilationDependencies::FieldTypeDependencyOffTheRecord+2263523
18: 00007FF7DB09E85F
Renderer process crashed - see https://www.electronjs.org/docs/tutorial/application-debugging for potential debugging information.
case no.2

DevTools listening on ws://127.0.0.1:9222/devtools/browser/251b8b27-ac19-42b2-b9f6-f823e709c8a8

<--- Last few GCs --->

[11992:000016880085C000]    55467 ms: Mark-Compact (reduce) 65.8 (70.4) -> 65.8 (67.9) MB, pooled: 0 MB, 1192.71 / 0.00 ms  (average mu = 0.858, current mu = 0.050) CppHeap allocation failure; GC in old space requested
[11992:000016880085C000]    59021 ms: Mark-Compact (reduce) 65.8 (67.9) -> 65.8 (67.4) MB, pooled: 0 MB, 708.56 / 0.00 ms  (+ 216.0 ms in 0 steps since start of marking, biggest step 0.0 ms, walltime since start of marking 2836 ms) (average mu = 0.828, cu

<--- JS stacktrace --->

FATAL ERROR: Oilpan: Large allocation. Ran out of reservation Allocation failed - process out of memory
----- Native stack trace -----

 1: 00007FF779087F4A uv_cpumask_size+56266
 2: 00007FF77900228B node::OnFatalError+747
 3: 00007FF77C296CB4 v8::Function::NewInstance+868
 4: 00007FF77C296C23 v8::Function::NewInstance+723
 5: 00007FF77C357298 v8::CppHeap::CollectGarbageInYoungGenerationForTesting+296
 6: 00007FF77C68D20B cppgc::internal::Fatal+91
 7: 00007FF77AC7C81D cppgc::LivenessBroker::IsHeapObjectAliveImpl+20013
 8: 00007FF77AC75B16 cppgc::internal::MakeGarbageCollectedTraitInternal::Allocate+230
 9: 00007FF77B5FB24D Cr_z_adler32+4807933
10: 00007FF77B60F7ED Cr_z_adler32+4891293
11: 00007FF77B668E49 Cr_z_adler32+5257465
12: 00007FF77B5EC566 Cr_z_adler32+4747286
13: 00007FF77B462C50 Cr_z_adler32+3135232
14: 00007FF77B5F443A Cr_z_adler32+4779754
15: 00007FF77B5F1DB9 Cr_z_adler32+4769897
16: 00007FF77B46718D Cr_z_adler32+3152957
17: 00007FF77B461E68 Cr_z_adler32+3131672
18: 00007FF77B5F443A Cr_z_adler32+4779754
19: 00007FF77B5F1DB9 Cr_z_adler32+4769897
20: 00007FF77B46718D Cr_z_adler32+3152957
21: 00007FF77B461E68 Cr_z_adler32+3131672
22: 00007FF77B67F3FE Cr_z_adler32+5349038
23: 00007FF77B67E6E4 Cr_z_adler32+5345684
24: 00007FF77B669F16 Cr_z_adler32+5261766
25: 00007FF77B5EC8BC Cr_z_adler32+4748140
26: 00007FF77B462C50 Cr_z_adler32+3135232
27: 00007FF77945E052 GetHandleVerifier+3610546
28: 00007FF779441CCE GetHandleVerifier+3494958
29: 00007FF77944270F GetHandleVerifier+3497583
30: 00007FF77B2DAA60 Cr_z_adler32+1529104
31: 00007FF77B2D03FF Cr_z_adler32+1486511
32: 00007FF77945AFF6 GetHandleVerifier+3598166
33: 00007FF77943C824 GetHandleVerifier+3473284
34: 00007FF77943C541 GetHandleVerifier+3472545
35: 00007FF779BE92DC uv_stream_set_blocking+3791868
36: 00007FF779BE919B uv_stream_set_blocking+3791547
37: 00007FF778CFA696 IsSandboxedProcess+2442838
38: 00007FF7792CA79E GetHandleVerifier+1957630
39: 00007FF777444BF1 v8::Extension::dependency_count+401
40: 00007FF77B1372DD v8::internal::compiler::CompilationDependencies::FieldTypeDependencyOffTheRecord+4420813
41: 00007FF77B211B6D Cr_z_adler32+706077
42: 00007FF77B2196A7 Cr_z_adler32+737623
43: 00007FF779101336 GetHandleVerifier+84630
44: 00007FF778A0717F uv_os_getpid+213759
45: 00007FF778EC38E3 uv_fs_get_system_error+1323283
46: 00007FF777372C9E v8::internal::StrongRootAllocatorBase::StrongRootAllocatorBase+485534
47: 00007FF777373AA2 v8::internal::StrongRootAllocatorBase::StrongRootAllocatorBase+489122
48: 00007FF7773722F4 v8::internal::StrongRootAllocatorBase::StrongRootAllocatorBase+483060
49: 00007FF7773724AD v8::internal::StrongRootAllocatorBase::StrongRootAllocatorBase+483501
50: 00007FF7770B3361 v8::SourceLocation::SourceLocation+61121
51: 00007FF77B6B31A2 Cr_z_adler32+5561426
52: 00007FF9A7147374 BaseThreadInitThunk+20
53: 00007FF9A883CC91 RtlUserThreadStart+33
Renderer process crashed - see https://www.electronjs.org/docs/tutorial/application-debugging for potential debugging information.
case no.3
DevTools listening on ws://127.0.0.1:9222/devtools/browser/fd0ff740-5ab9-4e7b-bd72-9d1886d95245

<--- Last few GCs --->

[11272:000038600085C000]    33292 ms: Mark-Compact (reduce) 64.6 (70.1) -> 64.6 (67.1) MB, pooled: 0 MB, 1350.28 / 0.00 ms  (average mu = 0.829, current mu = 0.041) CppHeap allocation failure; GC in old space requested
[11272:000038600085C000]    36223 ms: Mark-Compact (reduce) 64.6 (67.1) -> 64.6 (66.6) MB, pooled: 0 MB, 149.04 / 0.00 ms  (+ 142.7 ms in 0 steps since start of marking, biggest step 0.0 ms, walltime since start of marking 2689 ms) (average mu = 0.872, cu

<--- JS stacktrace --->

FATAL ERROR: Oilpan: Large allocation. Ran out of reservation Allocation failed - process out of memory
----- Native stack trace -----

 1: 00007FF779087F4A uv_cpumask_size+56266
 2: 00007FF77900228B node::OnFatalError+747
 3: 00007FF77C296CB4 v8::Function::NewInstance+868
 4: 00007FF77C296C23 v8::Function::NewInstance+723
 5: 00007FF77C357298 v8::CppHeap::CollectGarbageInYoungGenerationForTesting+296
 6: 00007FF77C68D20B cppgc::internal::Fatal+91
 7: 00007FF77AC7C81D cppgc::LivenessBroker::IsHeapObjectAliveImpl+20013
 8: 00007FF77AC75A24 cppgc::internal::MakeGarbageCollectedTraitInternal::Allocate+260
 9: 00007FF77B479B4D Cr_z_adler32+3229181
10: 00007FF77B669FCF Cr_z_adler32+5261951
11: 00007FF77B5EC8C7 Cr_z_adler32+4748151
12: 00007FF77B462C50 Cr_z_adler32+3135232
13: 00007FF77B5F443A Cr_z_adler32+4779754
14: 00007FF77B5F1DB9 Cr_z_adler32+4769897
15: 00007FF77A185506 uv_version_string+2486662
16: 00007FF77B5F2019 Cr_z_adler32+4770505
17: 00007FF77B46718D Cr_z_adler32+3152957
18: 00007FF77B461E68 Cr_z_adler32+3131672
19: 00007FF77B5F0B08 Cr_z_adler32+4765112
20: 00007FF77B5F29AB Cr_z_adler32+4772955
21: 00007FF77B5F1AB9 Cr_z_adler32+4769129
22: 00007FF77B46718D Cr_z_adler32+3152957
23: 00007FF77B461E68 Cr_z_adler32+3131672
24: 00007FF77B67F3FE Cr_z_adler32+5349038
25: 00007FF77B67E6E4 Cr_z_adler32+5345684
26: 00007FF77B669F16 Cr_z_adler32+5261766
27: 00007FF77B5EC8BC Cr_z_adler32+4748140
28: 00007FF77B462C50 Cr_z_adler32+3135232
29: 00007FF77945E052 GetHandleVerifier+3610546
30: 00007FF779441CCE GetHandleVerifier+3494958
31: 00007FF77944270F GetHandleVerifier+3497583
32: 00007FF77B2DAA60 Cr_z_adler32+1529104
33: 00007FF77B2D03FF Cr_z_adler32+1486511
34: 00007FF77945AFF6 GetHandleVerifier+3598166
35: 00007FF77943C824 GetHandleVerifier+3473284
36: 00007FF77943C541 GetHandleVerifier+3472545
37: 00007FF779BE92DC uv_stream_set_blocking+3791868
38: 00007FF779BE919B uv_stream_set_blocking+3791547
39: 00007FF778CFA696 IsSandboxedProcess+2442838
40: 00007FF7792CA79E GetHandleVerifier+1957630
41: 00007FF777444BF1 v8::Extension::dependency_count+401
42: 00007FF77B1372DD v8::internal::compiler::CompilationDependencies::FieldTypeDependencyOffTheRecord+4420813
43: 00007FF77B211B6D Cr_z_adler32+706077
44: 00007FF77B2196A7 Cr_z_adler32+737623
45: 00007FF779101336 GetHandleVerifier+84630
46: 00007FF778A0717F uv_os_getpid+213759
47: 00007FF778EC38E3 uv_fs_get_system_error+1323283
48: 00007FF777372C9E v8::internal::StrongRootAllocatorBase::StrongRootAllocatorBase+485534
49: 00007FF777373AA2 v8::internal::StrongRootAllocatorBase::StrongRootAllocatorBase+489122
50: 00007FF7773722F4 v8::internal::StrongRootAllocatorBase::StrongRootAllocatorBase+483060
51: 00007FF7773724AD v8::internal::StrongRootAllocatorBase::StrongRootAllocatorBase+483501
52: 00007FF7770B3361 v8::SourceLocation::SourceLocation+61121
53: 00007FF77B6B31A2 Cr_z_adler32+5561426
54: 00007FF9A7147374 BaseThreadInitThunk+20
55: 00007FF9A883CC91 RtlUserThreadStart+33
Renderer process crashed - see https://www.electronjs.org/docs/tutorial/application-debugging for potential debugging information.

The Oilpan appeared in the error messages is a name of the V8 garbage collector. After calling this._content.replaceChildren(); in view.FindSidebar._reset method, I don't think any references to the child nodes are remained in the JavaScript program. So I suspect this is a bug of the V8 garbage collector.

After googling with V8 process out of memory, node process out of memory and so on, I've come to the conclusion that this process out of memory error isn't super rare.

@lutzroeder
Copy link
Owner

lutzroeder commented Sep 22, 2024

So I suspect this is a bug of the V8 garbage collector.

Is it possible to track this down with the Chrome or V8 team? If there isn't a bug already it might be helpful creating one with a minimal repro if the issue reproduces reliably?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants