Re: [v8-users] GC tracing changes in V8 7.2?

2019-02-08 Thread 'Kenton Varda' via v8-users
We've fixed this issue. I believe the problem was due to not correctly handling wrapper objects allocated white after their parent had already been traced. (In the past I had had a bug that occurred due to objects allocated black, and I had been left with the impression that objects were always

Re: [v8-users] GC tracing changes in V8 7.2?

2019-01-30 Thread 'Kenton Varda' via v8-users
t 11:35 AM Kenton Varda wrote: > Hi Michael, > > Thanks, I think I now see the problem: I had assumed that newly-allocated > objects were always marked immediately on allocation, since they are > clearly reachable at that time. But, now that I think about it, I suppose > that w

Re: [v8-users] GC tracing changes in V8 7.2?

2019-01-28 Thread 'Kenton Varda' via v8-users
I'm still working on this off-and-on. The issue is not as urgent as it sounds because in the case that a wrapper object is collected prematurely, we simply remake it as needed. Still, this could cause issues if scripts add JS properties on native objects and expect them to stay there, but the

Re: [v8-users] GC tracing changes in V8 7.2?

2019-01-15 Thread 'Kenton Varda' via v8-users
m. > > The CL landed <https://chromium-review.googlesource.com/c/v8/v8/+/1350992> > here. > > -Michael > > On Tue, Jan 15, 2019 at 3:01 AM 'Kenton Varda' via v8-users < > v8-u...@googlegroups.com > wrote: > >> Hi v8-users, >> >> Upon upgra

[v8-users] GC tracing changes in V8 7.2?

2019-01-14 Thread 'Kenton Varda' via v8-users
Hi v8-users, Upon upgrading to V8 7.2, we're seeing GC collecting objects more aggressively than before. It looks like we have another bug with our GC integration, as we're occasionally seeing objects collected that should be reachable using EmbedderHeapTracer. I'm trying to isolate the issue

Re: [v8-users] How do I not abort on OOM?

2018-12-30 Thread 'Kenton Varda' via v8-users
> worst renders v8 unusable for many situations. > > On Tuesday, December 4, 2018 at 1:01:36 PM UTC-8, Kenton Varda wrote: >> >> On Tue, Dec 4, 2018 at 12:40 PM markt via v8-users < >> v8-u...@googlegroups.com> wrote: >> >>> To be perfectly honest, t

Re: [v8-users] Re: Fatal error in ScavengerCollector::CollectGarbage(), what did I do wrong?

2018-12-12 Thread 'Kenton Varda' via v8-users
On Tue, Dec 11, 2018 at 1:02 PM Kenton Varda wrote: > On Tue, Dec 11, 2018 at 11:13 AM Michael Lippautz > wrote: > >> I really hope that handles are only access from the same thread the GC is >> running on. Otherwise, you would need a v8::Locker to synchronize that &g

Re: [v8-users] Re: Fatal error in ScavengerCollector::CollectGarbage(), what did I do wrong?

2018-12-11 Thread 'Kenton Varda' via v8-users
On Tue, Dec 11, 2018 at 11:13 AM Michael Lippautz wrote: > I really hope that handles are only access from the same thread the GC is > running on. Otherwise, you would need a v8::Locker to synchronize that > access. > Right, the isolate mutex is locked any time we're manipulating handles. >

Re: [v8-users] Re: Fatal error in ScavengerCollector::CollectGarbage(), what did I do wrong?

2018-12-11 Thread 'Kenton Varda' via v8-users
ted) or that we need another processing phase after iterating those >> roots. >> >> I've opened https://crbug.com/v8/8571 to track this. Will investigate >> and report back there. >> >> -Michael >> >> On Thu, Dec 6, 2018 at 10:43 PM 'Kenton Varda' via v8

Re: [v8-users] Re: Fatal error in ScavengerCollector::CollectGarbage(), what did I do wrong?

2018-12-06 Thread 'Kenton Varda' via v8-users
AFAICT, the only callbacks into into my application code that happen during scavenging are the weak callbacks, but I've verified they aren't doing anything with handles other than resetting the handle they were called on. Any ideas? -Kenton On Wed, Dec 5, 2018 at 5:23 PM 'Kenton Varda' via v8-users

[v8-users] Re: Fatal error in ScavengerCollector::CollectGarbage(), what did I do wrong?

2018-12-05 Thread 'Kenton Varda' via v8-users
Whoops, correction: It's actually copied_list that has work left, not promotion_list. On Wednesday, December 5, 2018 at 3:37:20 PM UTC-8, Kenton Varda wrote: > > Hi v8-users, > > I recently refactored the way that I integrate with V8's garbage > collection in my applica

[v8-users] Fatal error in ScavengerCollector::CollectGarbage(), what did I do wrong?

2018-12-05 Thread 'Kenton Varda' via v8-users
Hi v8-users, I recently refactored the way that I integrate with V8's garbage collection in my application, and after the refactor I am (very rarely) hitting a fatal error that I don't understand: # # Fatal error in , line 0 # Check failed: IsEmpty(). # stack:

Re: [v8-users] How do I not abort on OOM?

2018-12-04 Thread 'Kenton Varda' via v8-users
d be totally wasted for Chrome's use case since Chrome will just terminate the process anyway. Personally I would much prefer if V8 did handle these cases but it makes plenty of sense why they don't. -Kenton > > > > On Tuesday, October 24, 2017 at 1:44:59 PM UTC-7, Ben Noordhuis wrote:

Re: [v8-users] What are the threading considerations for EmbedderHeapTracer?

2018-10-03 Thread 'Kenton Varda' via v8-users
On Wed, Oct 3, 2018 at 1:49 AM Michael Lippautz wrote: > It appears that it's possible that an object registered with >> EmbedderHeapTracer::RegisterV8References() can actually be collected (i.e. >> its weak callback is called) between then and >> EmbedderHeapTracer::AdvanceTracing(). So, in

Re: [v8-users] What are the threading considerations for EmbedderHeapTracer?

2018-10-02 Thread 'Kenton Varda' via v8-users
On Tue, Oct 2, 2018 at 11:10 AM Michael Lippautz wrote: > Glad that your setup works for you now. Is your project open source? In > any case, let us know if you encounter any further issues. > This is all for the Cloudflare Workers runtime. https://developers.cloudflare.com/workers/about/ At

Re: [v8-users] What are the threading considerations for EmbedderHeapTracer?

2018-10-02 Thread 'Kenton Varda' via v8-users
=incremental_marking_wrappers=package:chromium=0=712> > to false. You could try disabling that flag but also dropping predictable. > > On Tue, Sep 25, 2018 at 6:36 PM 'Kenton Varda' via v8-users < > v8-users@googlegroups.com> wrote: > >> Hi Michael, >> >>

Re: [v8-users] What are the threading considerations for EmbedderHeapTracer?

2018-09-25 Thread 'Kenton Varda' via v8-users
Hi Michael, Thanks for commenting! On Tue, Sep 25, 2018 at 6:37 AM Michael Lippautz wrote: > Looks like Isolate::VisitWeakHandles > > only iterates over weak handles with a non-zero class

Re: [v8-users] What are the threading considerations for EmbedderHeapTracer?

2018-09-23 Thread 'Kenton Varda' via v8-users
Hi Daryl, On Sun, Sep 23, 2018 at 4:15 PM 'Daryl Haresign' via v8-users < v8-users@googlegroups.com> wrote: > What kind of handles are you using? We have seen similar issues (v8 > reporting objects that have already been collected) when using kFinalizer > weak persistent handles. For us we were

[v8-users] What are the threading considerations for EmbedderHeapTracer?

2018-09-23 Thread 'Kenton Varda' via v8-users
Hi v8-users, I'm trying to understand how to correctly instrument my wrappers for multi-threaded garbage collection, and it seems I'm doing something wrong. Currently, my code seems to work only in --predictable mode (single-threaded), but I'd like to take advantage of GC in a background

Re: [v8-users] Limiting WASM memory allocation as an embedder?

2018-09-16 Thread 'Kenton Varda' via v8-users
Hi Deepti, Thanks for your response. On Wed, Sep 12, 2018 at 7:32 PM, 'Deepti Gandluri' via v8-users < v8-users@googlegroups.com> wrote: > If you are looking to track Wasm allocations, there is a counter on the > Isolate that wasm memory allocations are registered >

[v8-users] Limiting WASM memory allocation as an embedder?

2018-09-11 Thread 'Kenton Varda' via v8-users
Hi v8-users, I noticed that WASM seems to ignore the ResourceConstraints I've set on my isolate -- a WebAssembly.Memory object can grow to far beyond the heap constraint I've set, and I don't see any constraint specific to WASM. The JS code can, of course, specify a maximum memory limit when

Re: [v8-users] How do I not abort on OOM?

2018-06-08 Thread 'Kenton Varda' via v8-users
y, how much does that matter? Small memory leaks >> would not be a big deal here, since I can periodically drain the process >> and start a new one to "fix" them. >> >> -Kenton >> >> On Wednesday, October 25, 2017 at 12:13:22 AM UTC-7, Andreas Rossberg >> wrote: >>

[v8-users] ArrayBuffer::Allocator::Free() length differing from Allocate() length?

2018-03-14 Thread 'Kenton Varda' via v8-users
Hi v8-users, We have an ArrayBufferAllocator implementation that counts how much memory has been allocated. It basically looks like this: class AllocatorImpl final: public v8::ArrayBuffer::Allocator { public: AllocatorImpl(): allocated(0) {} ~AllocatorImpl(); inline size_t

[v8-users] How do I not abort on OOM?

2017-10-24 Thread 'Kenton Varda' via v8-users
Hi v8-users, It appears that in some cases V8 will abort the process when it runs out of heap space rather than throw a JS exception. The behavior can be overridden by registering an OOM callback, but if that callback returns without aborting, it seems V8 promptly crashes. It seems like some

Re: [v8-users] Re: Static library depends on self-built libc++, no longer compatible with libstdc++?

2017-09-28 Thread 'Kenton Varda' via v8-users
Thanks for the hint about use_sysroot! From there I was able to figure out a set of flags that make my build work again: tools/dev/v8gen.py x64.release -- v8_static_library=true use_sysroot=false use_glib=false use_custom_libcxx=false -Kenton On Thu, Sep 28, 2017 at 12:48 PM, Fabio Kaminski

[v8-users] Static library depends on self-built libc++, no longer compatible with libstdc++?

2017-09-08 Thread 'Kenton Varda' via v8-users
Hi v8-users, My C++ server app statically links against v8. My build broke when updating from 6.0 to 6.1. It looks like V8 now pulls in and builds libc++ as part of its own build. However, no libc++.a is generated, nor are the libc++ objects included in the regular static library outputs. So,

[v8-users] Re: Is there a way to enable RTTI without editing build files?

2017-07-11 Thread 'Kenton Varda' via v8-users
itself is obviously easier. -Kenton On Tue, Jul 11, 2017 at 12:24 PM, Kenton Varda <ken...@cloudflare.com> wrote: > Hi v8-users, > > My code which embeds V8 uses RTTI. My code also defines a custom subclass > of v8::ArrayBuffer::Allocator. Since this subclass is defined in my code

Re: [v8-users] info.This().GetAlignedPointerFromInternalField() crashes in property callbacks when applied to global object?

2017-04-20 Thread 'Kenton Varda' via v8-users
ecial-case that needs to be copied over? -Kenton On Thu, Apr 20, 2017 at 12:57 PM, Kenton Varda <ken...@cloudflare.com> wrote: > Oh I see, somehow I missed your CL link. > > Thanks! :) > > -Kenton > > On Thu, Apr 20, 2017 at 12:09 PM, Toon Verwaest <verwa...@chromium.o

Re: [v8-users] info.This().GetAlignedPointerFromInternalField() crashes in property callbacks when applied to global object?

2017-04-20 Thread 'Kenton Varda' via v8-users
tions change, > and that takes a while to sync; but you can try with the CL I linked above. > > On Thu, Apr 20, 2017 at 6:40 PM 'Kenton Varda' via v8-users < > v8-users@googlegroups.com> wrote: > >> Thanks, but what if I don't control the scripts and can't force t

Re: [v8-users] info.This().GetAlignedPointerFromInternalField() crashes in property callbacks when applied to global object?

2017-04-20 Thread 'Kenton Varda' via v8-users
Thanks, but what if I don't control the scripts and can't force them to prefix global property access with "this."? -Kenton On Thu, Apr 20, 2017 at 1:39 AM, Toon Verwaest wrote: > The problem is that since you're accessing the global property via > 'contextual access',

[v8-users] C++ API: Making a function with captured state

2014-01-23 Thread Kenton Varda
Hi v8-users, I'm trying to figure out how, from the C++ API, I can create a function that effectively has some dynamically-captured state, as a closure might have in pure Javascript. I need to generate many different instances of the same function but with different captured values. In