Commit Graph
104 Commits
Author SHA1 Message Date
Karl Seguin 65f8a83585 v8: call v8__Platform__NotifyIsolateShutdown on isolate shutdown
The v8 documentation says this "Has to be called", and claude flagged it as a
potential leak.

Required a new zig-v8-fork build (v0.5.5) which I released.
2026-09-11 10:20:20 +08:00
Karl Seguin 5c0ed733d2 update v8 dep
Address various feedback, largely around potential uaf / double free  on error
cases
2026-08-31 22:45:15 +08:00
Karl Seguin ff5b791b7e wip: screenshot 2026-08-19 21:49:02 +08:00
Karl Seguin c95135b5c2 update v8 dep 2026-08-13 19:31:37 +08:00
Karl Seguin e2f80ace33 update v8 dep 2026-07-24 11:34:45 +08:00
Karl Seguin df7bde233d Fix linux build
Try to fix CI (this is what claude came up with, I have no idea why CI is
failing).
2026-07-22 13:26:06 +08:00
Thibaud-Vdb cca00c022e ci: pin github actions to commit shas
Mutable tags like @v6 can be re-pointed by whoever controls the action,
so the next run executes code nobody here reviewed, with the job's
token and secrets. Pinning to the full commit sha freezes what runs.
Version tags are kept as comments so renovate or dependabot can still
track updates.

dtolnay/rust-toolchain is pinned to a master commit with the toolchain
moved to an explicit input, as its readme recommends for sha pinning.
2026-07-20 14:56:59 +02:00
Karl Seguin 4253bd852d update v8 dep 2026-07-07 20:41:12 +08:00
Karl Seguin a082dc2b07 update v8 2026-07-04 07:29:40 +08:00
Karl Seguin d2f72dfd4b update v8 version 2026-06-30 13:39:13 +08:00
Karl Seguin 98157e18ab update zig-v8-fork dep 2026-06-30 13:36:02 +08:00
Karl Seguin 0b85904967 update v8 dep 2026-06-18 11:19:18 +08:00
Karl Seguin 0c1bb406c0 ci: Include v8 version in Snapshot cache key 2026-06-11 17:12:55 +08:00
Karl Seguin 80bf294e1c update v8 dep 2026-06-04 12:49:51 +08:00
Karl Seguin 79cdbd285d Improve forced terminate on CDP client disconnect.
Depends on https://github.com/lightpanda-io/zig-v8-fork/pull/179

An improvement to https://github.com/lightpanda-io/browser/pull/2515 to prevent
a v8 assertion if we terminate as an inspector dispatch is happening.

The problem is that if we just immediately terminate, we aren't sure what the
worker thread is doing, and, apparently, if we terminate then dispatch a message
to the inspector, we fail an assertion.

With the way the code was, the only safe solution would be to hold a mutex
over the session dispatch, but that could block the network thread.

So instead of terminating from the network thread, we now ask v8 to execute
a callback. This gets executed on the worker thread, which can then terminate
the execution.

The initial version of 2515 delayed the termination from the network thread.
It's possible that solution would "solve" the issue, simply because it's very
unlikely that a worker would be "stuck" for 5 seconds and then get unstuck.
More likely that it exits immediately, or is stuck in an endless loop. But
that would still leave a window where we could terminate in network and then
dispatch in the worker. Less likely, but still possible. Hopefully this new
mechanism eliminates this from being a problem in all circumstances.
2026-06-02 08:27:49 +08:00
Karl Seguin bcd94c4f9d Update v8 dep
https://github.com/lightpanda-io/browser/issues/2407
2026-05-12 14:06:17 +08:00
Karl Seguin bc081247e7 update v8 dep 2026-05-05 07:04:02 +08:00
Karl Seguin 560b15c9b2 update v8 dep 2026-05-01 09:11:16 +08:00
Muki Kiboigo ec0af94939 use rust cache in ci for html5ever 2026-04-28 10:15:14 -07:00
Karl Seguin 2f6ce92db2 update v8 dep 2026-04-28 08:56:22 +08:00
Karl Seguin 5ec7c660da update v8 dep 2026-04-25 09:51:58 +08:00
Karl Seguin 0adb482bae update v8 dep 2026-04-16 15:02:58 +08:00
Karl Seguin 60249f5e5d update v8 dep 2026-04-14 12:24:09 +08:00
Pierre Tachoire f7ef2be5cd ci: invalidate snapshot cache on src/browser/webapi change 2026-04-12 11:54:53 +02:00
Pierre Tachoire e53e4579ab ci: use v8 snapshot cache w/ wpt test 2026-04-10 11:35:40 +02:00
Pierre Tachoire bd4e88cec8 ci: typo fix 2026-04-10 10:13:27 +02:00
Pierre Tachoire 90069f6ab8 ci: use a dedicated action for v8 snapshot 2026-04-10 10:13:27 +02:00
Karl Seguin 0d75c00f85 update v8 dep 2026-04-04 07:00:26 +08:00
Adrià Arrufat a75c0cf08d build: bump zig-v8 to v0.3.7 2026-03-26 12:34:10 +09:00
Karl Seguin e2afbec29d update v8 dep 2026-03-26 09:17:32 +08:00
Karl Seguin c25f389e91 Merge pull request #1817 from lightpanda-io/frames_postMessage
window.postMessage across frames
2026-03-17 06:42:32 +08:00
Karl Seguin a8b147dfc0 update v8 2026-03-15 09:24:42 +08:00
Salman Muin Kayser Chishti bf6dbedbe4 Upgrade GitHub Actions for Node 24 compatibility
Signed-off-by: Salman Muin Kayser Chishti <13schishti@gmail.com>
2026-03-14 09:11:46 +00:00
Karl Seguin f09e66e1cc update action.yml to latest zig-v8 2026-03-13 07:15:23 +08:00
Karl Seguin 4cea9aba3c update v8 dep 2026-03-11 08:44:51 +08:00
Karl Seguin aedb823b4d update v8 dep 2026-02-26 10:55:02 +08:00
Karl Seguin 603e7d922e Improve Context shutdown
Under some conditions, a microtask would be executed for a context that was
already deinit'd, resulting in various use-after-free.

The culprit appears to be WASM compilation being placed in the microtask queue
(by a user-script) and then resolved at some point in the future. We guard the
microtask queue by a context.shutting_down boolean, but v8 doesn't know anything
about this flag. The fact is that, microtasks are tied to an isolate, not a
context.

This commit introduces a number of changes:

1 - It follows https://github.com/lightpanda-io/browser/commit/309f254c2c8c590a2655972aa1b31d020777634c and stores the zig Context inside of an embedder field. This
    ensures v8 doesn't consider this when GC'ing, which _could_ extend the
    lifetime of the v8::Context beyond what we expect

2 - Most significantly, it introduces per-context microtasks queues. Each
    context gets its own queue. This makes cleanup much simpler and reduces the
    chance of microtasks outliving the context

3 - pumpMessageLoop is called on context.deinit, this helps to ensure that any
    tasks v8 has for our context are processed (e.g. wasm compilation) before
    shtudown

4 - The order of context shutdown is important, we notify the isolate of the
    context destruction first, then pump the message loop and finally destroy
    the context's message loop.

Depends on https://github.com/lightpanda-io/zig-v8-fork/pull/151
2026-02-21 13:02:43 +08:00
Karl Seguin 729a6021ee update v8 dep 2026-02-14 14:06:03 +08:00
Karl Seguin 8d49515a3c Convert more comptime-getters to fast getters
Follow up to https://github.com/lightpanda-io/browser/pull/1495 which introduced
the concept of a fast getter. This commit expands the new behavior to all
comptime-known scalar getters.

It also leverages the new `v8__FunctionTemplate__New__Config` to
1 - flag fast getters as having no side effect
2 - set the length (arity) on all functions
2026-02-09 11:35:27 +08:00
Pierre Tachoire c590658f16 ci: use debug v8 with zig test 2026-02-04 12:08:12 +01:00
Nikolay Govorov eb8cac5980 Use asan/tsan for building v8 2026-02-03 16:01:18 +00:00
Pierre Tachoire 496c6905af update build from source deps 2026-01-29 08:42:58 +01:00
Pierre Tachoire 335e781d0c update required deps for build from sources 2026-01-28 15:37:58 +01:00
Pierre Tachoire 7eb026cc0d update zig-v8 deps 2026-01-28 10:38:04 +01:00
Karl Seguin b4759ae261 Ability to capture a V8 heap profile and a heap snapshot 2026-01-22 10:27:58 +08:00
Karl Seguin c5870353e3 update v8 dep 2026-01-19 07:17:45 +08:00
Karl Seguin 801c019150 update v8 2026-01-13 16:07:49 +08:00
Karl Seguin 2ea57ba979 update v8 dep 2026-01-06 18:30:25 +08:00
Pierre Tachoire 00d4ac6137 update ci scripts
* use checkout v6
* remove useless target from Makefile
2025-12-29 15:17:19 +01:00
Muki Kiboigo c9f6cb7520 fix single build with rust in ci 2025-12-22 10:41:22 -08:00