If you know of a way to find more information on what the global handles may be, it may be helpful. Otherwise, I will have to scrub everything until I find something that works. For instance:
(gdb) print isolate->global_handles()->Print() Global handles: handle 0x7ffe3af84008 to 0x367b6c023fa9 handle 0x7ffe3af84028 to 0x7e1669936c1 I would like to know what those 2 handles are that are causing the serialization to fail. On Wednesday, September 6, 2017 at 3:26:36 PM UTC-4, Zac Hansen wrote: > > If that doesn't do it, again try to come up with a self contained example > and post it. Like I said before often v8 errors mean nothing more than > "you screwed up somewhere" so just the error message is rather > meaningless--at least to me. > > On Wed, Sep 6, 2017 at 12:00 PM Zac Hansen <xax...@gmail.com <javascript:>> > wrote: > >> As far as I know they are only the ones you explicitly make to hold on to >> things outside of the scope of JavaScript. Anything with the term >> "global" or "persistent" is a likely culprit. >> >> Again these are all guesses. I would try taking a snapshot that works >> creating a global handle and trying again to see that it causes the same >> assertion before pursuing down this path to make sure I'm not just >> completely wrong. >> >> On Wed, Sep 6, 2017 at 11:56 AM Francisco Moraes <francisc...@gmail.com >> <javascript:>> wrote: >> >>> What's the best way to find what the Global Handles actually are? I >>> found that I can print the handles but it still doesn't help me find what >>> they actually are. Once I know what they are, I can find the culprit and >>> eliminate it. >>> >>> >>> On Wednesday, September 6, 2017 at 2:32:49 PM UTC-4, Zac Hansen wrote: >>> >>>> Just a guess but how would he system know how to deal with objects held >>>> by global handles when making a snapshot? You can't serialize the global >>>> handles in such a way that they would be useful in any way? >>>> >>>> I'm guessing this is just a sanity check to make sure you aren't doing >>>> something unintended. >>>> >>>> I could be completely wrong but I'd say just free up your globals and >>>> if that changes the behavior then you weren't ready to make a snapshot >>>> anyhow. >>>> >>>> On Wed, Sep 6, 2017 at 11:27 AM Francisco Moraes <francisc...@gmail.com> >>>> wrote: >>>> >>>>> After fixing the issue about the handle scope, I can successfully >>>>> create the snapshot for the test code, but when I tried something more >>>>> complicated, I ran into this now: >>>>> >>>>> Check failed: 0 == isolate->global_handles()->global_handles_count() >>>>> (0 vs. 4). >>>>> >>>>> >>>>> On Wednesday, September 6, 2017 at 12:27:35 PM UTC-4, Zac Hansen wrote: >>>>>> >>>>>> >>>>>> https://v8.paulfryzel.com/docs/master/classv8_1_1_snapshot_creator.html#a86b2023acdb88a9bd6eae2695f2b0a8a >>>>>> >>>>>> Created a snapshot data blob. This must not be called from within a >>>>>> handle scope. >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> On Wednesday, September 6, 2017 at 7:20:33 AM UTC-7, Francisco Moraes >>>>>> wrote: >>>>>>> >>>>>>> Here's a simple recreate that I managed to create: >>>>>>> >>>>>>> #include <string.h> >>>>>>> >>>>>>> #include "v8.h" >>>>>>> #include "libplatform/libplatform.h" >>>>>>> >>>>>>> int main(int argv, char **argc) >>>>>>> { >>>>>>> const char *v8flags = ""; >>>>>>> v8::Platform *platform = v8::platform::CreateDefaultPlatform(); >>>>>>> v8::V8::SetFlagsFromString (v8flags, strlen (v8flags)); >>>>>>> v8::V8::InitializePlatform(platform); >>>>>>> v8::V8::Initialize(); >>>>>>> >>>>>>> v8::SnapshotCreator creator; >>>>>>> v8::Isolate *isolate = creator.GetIsolate(); >>>>>>> >>>>>>> v8::HandleScope handle_scope(isolate); >>>>>>> v8::Local<v8::Context> context = v8::Context::New(isolate); >>>>>>> const char* source = "function initialize(obj) { return true; }"; >>>>>>> v8::Context::Scope context_scope(context); >>>>>>> v8::TryCatch try_catch(isolate); >>>>>>> v8::Local<v8::String> source_string; >>>>>>> v8::String::NewFromUtf8(isolate, source, >>>>>>> v8::NewStringType::kNormal) >>>>>>> .ToLocal(&source_string); >>>>>>> v8::ScriptOrigin origin = >>>>>>> v8::ScriptOrigin(v8::String::NewFromUtf8(isolate, "testscript")); >>>>>>> v8::ScriptCompiler::Source sourcecode(source_string, origin); >>>>>>> v8::Local<v8::Script> script; >>>>>>> bool success = v8::ScriptCompiler::Compile(context, >>>>>>> &sourcecode).ToLocal(&script); >>>>>>> >>>>>>> script->Run(context); >>>>>>> >>>>>>> creator.SetDefaultContext(context); >>>>>>> v8::StartupData blob = >>>>>>> creator.CreateBlob(v8::SnapshotCreator::FunctionCodeHandling::kClear); >>>>>>> >>>>>>> return 1; >>>>>>> } >>>>>>> >>>>>>> The interesting thing is if I call v8::V8::CreateSnapshotDataBlob it >>>>>>> works as it does all the above work for me, so something in trying to >>>>>>> use >>>>>>> the SnapshotCreator is causing me some issue as I will need to handle >>>>>>> custom embedder fields, etc... >>>>>>> >>>>>>> On Tuesday, September 5, 2017 at 2:50:36 PM UTC-4, Zac Hansen wrote: >>>>>>>> >>>>>>>> That kind of error usually means you either haven't created a >>>>>>>> context or aren't in a context or haven't created an appropriate >>>>>>>> handle. >>>>>>>> Or... Something else :-/. Maybe a lock? V8 errors are very much a >>>>>>>> "you >>>>>>>> screwed up somewhere" notification and often nothing more >>>>>>>> >>>>>>>> On Tue, Sep 5, 2017 at 9:42 AM Francisco Moraes < >>>>>>>> francisc...@gmail.com> wrote: >>>>>>>> >>>>>>>>> I will give it a try sometime this week. I tried to remove our >>>>>>>>> initialization JS file but that caused a failure further down the >>>>>>>>> serialization as well, so still investigating. >>>>>>>>> >>>>>>>>> >>>>>>>>> On Saturday, September 2, 2017 at 1:07:28 AM UTC-4, Zac Hansen >>>>>>>>> wrote: >>>>>>>>>> >>>>>>>>>> Can you post a minimal complete example that reproduces your >>>>>>>>>> problem? >>>>>>>>>> >>>>>>>>>> On Friday, September 1, 2017 at 8:57:51 AM UTC-7, Francisco >>>>>>>>>> Moraes wrote: >>>>>>>>>>> >>>>>>>>>>> Hello, >>>>>>>>>>> >>>>>>>>>>> I am trying to create a snapshot that includes most of code but >>>>>>>>>>> I ran into the following assertion: >>>>>>>>>>> >>>>>>>>>>> >>>>>>>>>>> CHECK(isolate->handle_scope_implementer()->blocks()->is_empty()); >>>>>>>>>>> >>>>>>>>>>> Any clarifications about what would generate it that our JS code >>>>>>>>>>> is doing and is not legal? I found that creating Unsafe Arrays is >>>>>>>>>>> also not >>>>>>>>>>> permitted but that is relatively easy to work around. >>>>>>>>>>> >>>>>>>>>>> Francisco >>>>>>>>>>> >>>>>>>>>> -- >>>>>>>>> -- >>>>>>>>> v8-users mailing list >>>>>>>>> v8-u...@googlegroups.com >>>>>>>>> http://groups.google.com/group/v8-users >>>>>>>>> --- >>>>>>>>> You received this message because you are subscribed to a topic in >>>>>>>>> the Google Groups "v8-users" group. >>>>>>>>> To unsubscribe from this topic, visit >>>>>>>>> https://groups.google.com/d/topic/v8-users/kxtnaSSQL9c/unsubscribe >>>>>>>>> . >>>>>>>>> To unsubscribe from this group and all its topics, send an email >>>>>>>>> to v8-users+u...@googlegroups.com. >>>>>>>>> For more options, visit https://groups.google.com/d/optout. >>>>>>>>> >>>>>>>> >>>>>>> On Tuesday, September 5, 2017 at 2:50:36 PM UTC-4, Zac Hansen wrote: >>>>>>>> >>>>>>>> That kind of error usually means you either haven't created a >>>>>>>> context or aren't in a context or haven't created an appropriate >>>>>>>> handle. >>>>>>>> Or... Something else :-/. Maybe a lock? V8 errors are very much a >>>>>>>> "you >>>>>>>> screwed up somewhere" notification and often nothing more >>>>>>>> >>>>>>>> On Tue, Sep 5, 2017 at 9:42 AM Francisco Moraes < >>>>>>>> francisc...@gmail.com> wrote: >>>>>>>> >>>>>>>>> I will give it a try sometime this week. I tried to remove our >>>>>>>>> initialization JS file but that caused a failure further down the >>>>>>>>> serialization as well, so still investigating. >>>>>>>>> >>>>>>>>> >>>>>>>>> On Saturday, September 2, 2017 at 1:07:28 AM UTC-4, Zac Hansen >>>>>>>>> wrote: >>>>>>>>>> >>>>>>>>>> Can you post a minimal complete example that reproduces your >>>>>>>>>> problem? >>>>>>>>>> >>>>>>>>>> On Friday, September 1, 2017 at 8:57:51 AM UTC-7, Francisco >>>>>>>>>> Moraes wrote: >>>>>>>>>>> >>>>>>>>>>> Hello, >>>>>>>>>>> >>>>>>>>>>> I am trying to create a snapshot that includes most of code but >>>>>>>>>>> I ran into the following assertion: >>>>>>>>>>> >>>>>>>>>>> >>>>>>>>>>> CHECK(isolate->handle_scope_implementer()->blocks()->is_empty()); >>>>>>>>>>> >>>>>>>>>>> Any clarifications about what would generate it that our JS code >>>>>>>>>>> is doing and is not legal? I found that creating Unsafe Arrays is >>>>>>>>>>> also not >>>>>>>>>>> permitted but that is relatively easy to work around. >>>>>>>>>>> >>>>>>>>>>> Francisco >>>>>>>>>>> >>>>>>>>>> -- >>>>>>>>> -- >>>>>>>>> v8-users mailing list >>>>>>>>> v8-u...@googlegroups.com >>>>>>>>> http://groups.google.com/group/v8-users >>>>>>>>> --- >>>>>>>>> You received this message because you are subscribed to a topic in >>>>>>>>> the Google Groups "v8-users" group. >>>>>>>>> To unsubscribe from this topic, visit >>>>>>>>> https://groups.google.com/d/topic/v8-users/kxtnaSSQL9c/unsubscribe >>>>>>>>> . >>>>>>>>> To unsubscribe from this group and all its topics, send an email >>>>>>>>> to v8-users+u...@googlegroups.com. >>>>>>>>> For more options, visit https://groups.google.com/d/optout. >>>>>>>>> >>>>>>>> >>>>>>> On Tuesday, September 5, 2017 at 2:50:36 PM UTC-4, Zac Hansen wrote: >>>>>>>> >>>>>>>> That kind of error usually means you either haven't created a >>>>>>>> context or aren't in a context or haven't created an appropriate >>>>>>>> handle. >>>>>>>> Or... Something else :-/. Maybe a lock? V8 errors are very much a >>>>>>>> "you >>>>>>>> screwed up somewhere" notification and often nothing more >>>>>>>> >>>>>>>> On Tue, Sep 5, 2017 at 9:42 AM Francisco Moraes < >>>>>>>> francisc...@gmail.com> wrote: >>>>>>>> >>>>>>>>> I will give it a try sometime this week. I tried to remove our >>>>>>>>> initialization JS file but that caused a failure further down the >>>>>>>>> serialization as well, so still investigating. >>>>>>>>> >>>>>>>>> >>>>>>>>> On Saturday, September 2, 2017 at 1:07:28 AM UTC-4, Zac Hansen >>>>>>>>> wrote: >>>>>>>>>> >>>>>>>>>> Can you post a minimal complete example that reproduces your >>>>>>>>>> problem? >>>>>>>>>> >>>>>>>>>> On Friday, September 1, 2017 at 8:57:51 AM UTC-7, Francisco >>>>>>>>>> Moraes wrote: >>>>>>>>>>> >>>>>>>>>>> Hello, >>>>>>>>>>> >>>>>>>>>>> I am trying to create a snapshot that includes most of code but >>>>>>>>>>> I ran into the following assertion: >>>>>>>>>>> >>>>>>>>>>> >>>>>>>>>>> CHECK(isolate->handle_scope_implementer()->blocks()->is_empty()); >>>>>>>>>>> >>>>>>>>>>> Any clarifications about what would generate it that our JS code >>>>>>>>>>> is doing and is not legal? I found that creating Unsafe Arrays is >>>>>>>>>>> also not >>>>>>>>>>> permitted but that is relatively easy to work around. >>>>>>>>>>> >>>>>>>>>>> Francisco >>>>>>>>>>> >>>>>>>>>> -- >>>>>>>>> -- >>>>>>>>> v8-users mailing list >>>>>>>>> v8-u...@googlegroups.com >>>>>>>>> http://groups.google.com/group/v8-users >>>>>>>>> --- >>>>>>>>> You received this message because you are subscribed to a topic in >>>>>>>>> the Google Groups "v8-users" group. >>>>>>>>> To unsubscribe from this topic, visit >>>>>>>>> https://groups.google.com/d/topic/v8-users/kxtnaSSQL9c/unsubscribe >>>>>>>>> . >>>>>>>>> To unsubscribe from this group and all its topics, send an email >>>>>>>>> to v8-users+u...@googlegroups.com. >>>>>>>>> For more options, visit https://groups.google.com/d/optout. >>>>>>>>> >>>>>>>> -- >>>>> -- >>>>> v8-users mailing list >>>>> v8-u...@googlegroups.com >>>>> http://groups.google.com/group/v8-users >>>>> --- >>>>> You received this message because you are subscribed to a topic in the >>>>> Google Groups "v8-users" group. >>>>> To unsubscribe from this topic, visit >>>>> https://groups.google.com/d/topic/v8-users/kxtnaSSQL9c/unsubscribe. >>>>> To unsubscribe from this group and all its topics, send an email to >>>>> v8-users+u...@googlegroups.com. >>>>> For more options, visit https://groups.google.com/d/optout. >>>>> >>>> -- >>> -- >>> v8-users mailing list >>> v8-u...@googlegroups.com <javascript:> >>> http://groups.google.com/group/v8-users >>> --- >>> You received this message because you are subscribed to a topic in the >>> Google Groups "v8-users" group. >>> To unsubscribe from this topic, visit >>> https://groups.google.com/d/topic/v8-users/kxtnaSSQL9c/unsubscribe. >>> To unsubscribe from this group and all its topics, send an email to >>> v8-users+u...@googlegroups.com <javascript:>. >>> For more options, visit https://groups.google.com/d/optout. >>> >> -- -- v8-users mailing list v8-users@googlegroups.com http://groups.google.com/group/v8-users --- You received this message because you are subscribed to the Google Groups "v8-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to v8-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.