Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit f22132e

Browse filesBrowse files
ofrobotsMylesBorins
authored andcommitted
deps: v8: fix potential segfault in profiler
This change fixes a potential segfault in the sampling heap profiler. This landed as part of a larger change upstream [1]. This is the minimal backport that avoids the segfault. [1]: https://git.io/vdTYL PR-URL: #15498 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: James M Snell <jasnell@gmail.com>
1 parent 1483ebd commit f22132e
Copy full SHA for f22132e

File tree

Expand file treeCollapse file tree

1 file changed

+5
-2
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+5
-2
lines changed
Open diff view settings
Collapse file

‎deps/v8/src/profiler/sampling-heap-profiler.h‎

Copy file name to clipboardExpand all lines: deps/v8/src/profiler/sampling-heap-profiler.h
+5-2Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,8 +146,11 @@ class SamplingAllocationObserver : public AllocationObserver {
146146
void Step(int bytes_allocated, Address soon_object, size_t size) override {
147147
USE(heap_);
148148
DCHECK(heap_->gc_state() == Heap::NOT_IN_GC);
149-
DCHECK(soon_object);
150-
profiler_->SampleObject(soon_object, size);
149+
if (soon_object) {
150+
// TODO(ofrobots): it would be better to sample the next object rather
151+
// than skipping this sample epoch if soon_object happens to be null.
152+
profiler_->SampleObject(soon_object, size);
153+
}
151154
}
152155

153156
intptr_t GetNextStepSize() override { return GetNextSampleInterval(rate_); }

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.