Issue 127: CHECK(state_ == DESTROYED) failed
http://code.google.com/p/v8/issues/detail?id=127

New issue report by victor.grishchenko:
The last problem I ran into seems to be a genuine v8 internal glitch.  
(Still, glad if it is mine.) It is
reproducible both under Mac OS X and Linux, both "trunk" and "bleeding  
edge" versions.
The program fails at an innocent v8::Persistent<v8::Object>::New call in  
one of C-to-v8
bindings.

#
# Fatal error in src/global-handles.cc, line 79
# CHECK(state_ == DESTROYED) failed
#


Program received signal SIGABRT, Aborted.
0x90a0ab9e in __kill ()
(gdb) bt
#0  0x90a0ab9e in __kill ()
#1  0x90a0ab91 in kill$UNIX2003 ()
#2  0x90a81ec2 in raise ()
#3  0x90a9147f in abort ()
#4  0x004682a5 in v8::internal::OS::Abort () at src/platform-macos.cc:259
#5  0x003b27a1 in V8_Fatal (file=0x52a378 "src/global-handles.cc", line=79,
format=0x5204d8 "CHECK(%s) failed") at src/checks.cc:58
#6  0x003fc048 in CheckHelper (file=0x52a378 "src/global-handles.cc",  
line=79,
source=0x52a364 "state_ == DESTROYED", condition=false) at checks.h:62
#7  0x003fcb03 in v8::internal::GlobalHandles::Node::next_free  
(this=0x785d30) at src/global-
handles.cc:79
#8  0x003fc0e4 in v8::internal::GlobalHandles::Create (value=0x12fd1c5) at  
src/global-
handles.cc:201
#9  0x003756f2 in v8::V8::GlobalizeReference (obj=0x805d18) at  
src/api.cc:314
#10 0x00003a01 in v8::Persistent<v8::Object>::New (that={val_ = 0x805d18})  
at v8.h:2281
#11 0x00003e23 in BufferWrap (buf=0x190bbf0) at src/bitbuffer.cpp:65
.... 6 more lines ....
(gdb)


void BufferDestroy(Persistent<Value> self, void* parameter) {
        evbuffer_free((evbuffer*)parameter);
        self.ClearWeak();
}

Handle<Object> BufferWrap (evbuffer* buf) {
        HandleScope scope;
        Handle<ObjectTemplate> objt = buffer_template->InstanceTemplate();
        Handle<Object> result = objt->NewInstance();
        result->SetInternalField(0, External::New(buf));
        Persistent<Object> self = Persistent<Object>::New(result);
        self.MakeWeak(buf, BufferDestroy);
        return self;
}

Handle<Value> BufferCreate (const Arguments& args) {
        if (!args.IsConstructCall())
                jsthrow("cannot call constructor as function");
        HandleScope scope;
        evbuffer * buf = evbuffer_new();
        Persistent<Object> self = Persistent<Object>::New(args.Holder());
        self->SetInternalField(0,External::New(buf));
        self.MakeWeak(buf, BufferDestroy);
        return self;
}




Issue attributes:
        Status: New
        Owner: ----

-- 
You received this message because you are listed in the owner
or CC fields of this issue, or because you starred this issue.
You may adjust your issue notification preferences at:
http://code.google.com/hosting/settings

--~--~---------~--~----~------------~-------~--~----~
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
-~----------~----~----~----~------~----~------~--~---

Reply via email to