Skip to content

Enable debug for v8's heap.cc - #7388

Open
dbezhetskov wants to merge 1 commit into
cloudflare:mainfrom
dbezhetskov:perfetto-bug
Open

dbezhetskov wants to merge 1 commit into
cloudflare:mainfrom
dbezhetskov:perfetto-bug

Conversation

@dbezhetskov

@dbezhetskov dbezhetskov commented Sep 16, 2026

Copy link
Copy Markdown

The root cause of this bug was that V8 was built without Perfetto support, while Workerd used its own Perfetto SDK.
This is a V8 issue; see https://chromium-review.googlesource.com/c/v8/v8/+/8418430.

When V8 is built with Perfetto disabled, it still exports symbols in the perfetto namespace. In debug builds, the linker may resolve references to the wrong symbols, causing the build to fail.

Workerd now configures V8 correctly:
5967ef7.

In addition, https://chromium-review.googlesource.com/c/v8/v8/+/8418430 should fix the underlying issue in V8 itself soon.

@dbezhetskov
dbezhetskov requested review from a team as code owners September 16, 2026 14:48
@dbezhetskov

Copy link
Copy Markdown
Author

@jasnell PTAL

@danlapid

Copy link
Copy Markdown
Collaborator

@fhanau you had opinions on this in the past

@fhanau

fhanau commented Sep 16, 2026

Copy link
Copy Markdown
Contributor

This won't do what you want it to do: build:v8-codegen-opt --per_file_copt=v8/src@-O3 means that we're optimizing all of V8 anyway.
Edit: Well, this was likely not intended to be a no-op change, but if it is a no-op change and the underlying issue can't happen anymore based on how we use perfetto it's probably safe to drop this.

@fhanau

fhanau commented Sep 16, 2026

Copy link
Copy Markdown
Contributor

I think building workerd without perfetto ought to still be supported – but if I understand what you're saying correctly the issue only happens if we compile workerd with perfetto and V8 without it? In that case we're probably fine, the perfetto config in .bazelrc should ensure that perfetto is enabled on V8 iff enabled elsewhere too.

@dbezhetskov

dbezhetskov commented Sep 16, 2026

Copy link
Copy Markdown
Author

This won't do what you want it to do: build:v8-codegen-opt --per_file_copt=v8/src@-O3 means that we're optimizing all of V8.

Yes, I know, it doesn't enable debug build for V8, but still we don't need special case for heap.cc.
Though, we can enable full debug if it is useful:

build:v8-dbg -c dbg
build:v8-dbg --per_file_copt=v8/src@-O0

I find it useful because it enables debug checks in V8.

I think building workerd without perfetto ought to still be supported – but if I understand what you're saying correctly the issue only happens if we compile workerd with perfetto and V8 without it? In that case we're probably fine, the perfetto config in .bazelrc should ensure that perfetto is enabled on V8 iff enabled elsewhere too.

Yes, the issue happens only for configuration = no inlining (debug) x WD_USES_PERFETTO x V8_USE_PERFETTO = false
After the CL lands in V8 any possible combination works - {V8_NO_PERFETTO, V8_YES_PERFETTO} x {WD_NO_PERFETTO, WD_YES_PERFETTO} and we don't need special case for heap.cc anyway and we can add full debug.

@fhanau

fhanau commented Sep 16, 2026

Copy link
Copy Markdown
Contributor

Sounds good, Dan or James should be able to merge then

@dbezhetskov

Copy link
Copy Markdown
Author

since https://chromium-review.googlesource.com/c/v8/v8/+/8418430 already landed and there is no objections, could you please land this @jasnell ?

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.

4 participants