GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — deps: V8: backport 786c1c2d88d4 · nodejs/node@f8bdcd5

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • common.gypi
  • deps/v8
    • AUTHORS
    • src/execution
      • isolate.cc
    • test/cctest
      • test-api-stack-traces.cc
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎common.gypi‎

Copy file name to clipboardExpand all lines: common.gypi
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242

4343
# Reset this number to 0 on major V8 upgrades.
4444
# Increment by one for each non-official patch applied to deps/v8.
45-
'v8_embedder_string': '-node.62',
45+
'v8_embedder_string': '-node.63',
4646

4747
##### V8 defaults for Node.js #####
4848

Collapse file

‎deps/v8/AUTHORS‎

Copy file name to clipboardExpand all lines: deps/v8/AUTHORS
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@ Douglas Crosher <[email protected]>
123123
Dusan Milosavljevic <[email protected]>
124124
Eden Wang <[email protected]>
125125
Edoardo Marangoni <[email protected]>
126+
Eliau Elkouby <[email protected]>
126127
Elisha Hollander <[email protected]>
127128
Eric Rannaud <[email protected]>
128129
Erich Ocean <[email protected]>
Collapse file

‎deps/v8/src/execution/isolate.cc‎

Copy file name to clipboardExpand all lines: deps/v8/src/execution/isolate.cc
+7-4Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1614,12 +1614,15 @@ MaybeDirectHandle<JSObject> Isolate::CaptureAndSetErrorStack(
16141614
static_cast<uint32_t>(
16151615
stack_trace_for_uncaught_exceptions_frame_limit_));
16161616
DCHECK_GE(stack_trace_limit, 0);
1617-
if (static_cast<int>(stack_trace_limit) *
1618-
CallSiteInfo::Fields::kCount <
1619-
raw_data_for_call_site_infos->length()) {
1617+
// Compare in frames rather than raw slots to avoid overflowing for
1618+
// large Error.stackTraceLimit values.
1619+
int frame_count = raw_data_for_call_site_infos->length() /
1620+
CallSiteInfo::Fields::kCount;
1621+
if (stack_trace_limit < frame_count) {
16201622
call_site_infos_or_formatted_stack = FixedArray::RightTrimOrEmpty(
16211623
this, raw_data_for_call_site_infos,
1622-
stack_trace_limit * CallSiteInfo::Fields::kCount);
1624+
stack_trace_limit *
1625+
CallSiteInfo::Fields::kCount);
16231626
}
16241627
// Notify the debugger.
16251628
OnStackTraceCaptured(stack_trace);
Collapse file

‎deps/v8/test/cctest/test-api-stack-traces.cc‎

Copy file name to clipboardExpand all lines: deps/v8/test/cctest/test-api-stack-traces.cc
+28Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -440,6 +440,34 @@ TEST(CaptureStackTraceForUncaughtException) {
440440
CHECK_EQ(1, report_count);
441441
}
442442

443+
TEST(CaptureStackTraceForUncaughtExceptionHugeStackTraceLimit) {
444+
LocalContext env;
445+
v8::Isolate* isolate = env->GetIsolate();
446+
v8::HandleScope scope(isolate);
447+
isolate->SetCaptureStackTraceForUncaughtExceptions(true);
448+
449+
CompileRun(
450+
"function foo() { return new Error().stack; }\n"
451+
"function bar() { return foo(); }\n"
452+
"function stackWithLimit(limit) {\n"
453+
" Error.stackTraceLimit = limit;\n"
454+
" return bar();\n"
455+
"}\n");
456+
Local<Value> expected = CompileRun("stackWithLimit(10)");
457+
CHECK(expected->IsString());
458+
459+
// For these limits, limit * CallSiteInfo::Fields::kCount overflows.
460+
for (const char* limit : {"858993460", "858993461", "Infinity"}) {
461+
std::string source = std::string("stackWithLimit(") + limit + ")";
462+
CHECK(CompileRun(source.c_str())->StrictEquals(expected));
463+
}
464+
465+
// Small limits must still trim the stack trace.
466+
CHECK(CompileRun("stackWithLimit(1).split('\\n').length === 2")->IsTrue());
467+
468+
isolate->SetCaptureStackTraceForUncaughtExceptions(false);
469+
}
470+
443471
// Test uncaught exception in a setter
444472
const char uncaught_setter_exception_source[] =
445473
"var setters = ['column', 'lineNumber', 'scriptName',\n"

0 commit comments

Comments
0 (0)
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.