Status: New
Owner: ----

New issue 3922 by [email protected]: dynamic array not deleted on InitializeFastElementsKindSequence::Construct()
https://code.google.com/p/v8/issues/detail?id=3922

Version: <f0c9cc0bbfd461c7f516799d9a58e9a7395f737e>
OS: <Windows, Ubuntu, CentOS>
Architecture: <x86, x64,>

What steps will reproduce the problem?
1. build sample HelloWorld from Embedder's Guide
2. run with memory heap checking tool

What is the expected output?
no leaks

What do you see instead?
3. expect "still reachable" leak report pointing to:

   file: elements-kind.cc
   struct InitializeFastElementsKindSequence {
   static void Construct(
      ElementsKind** fast_elements_kind_sequence_ptr) {
      ElementsKind* fast_elements_kind_sequence =
        new ElementsKind[kFastElementsKindCount];
      ...
      ...
}
although it is not a true memory leak, some automated build processes will mark
client build as failed.

Here is the code and stack:
int main()
{
  V8::Initialize();
  Isolate* isolate = Isolate::New();
  {
    Isolate::Scope isolate_scope(isolate);
    HandleScope handle_scope(isolate);
Local<Context> context = Context::New(isolate); // LEAK HERE (see source from elements-kind.cc)
    Context::Scope context_scope(context);

Local<String> source = String::NewFromUtf8(isolate, "'Hello' + ', World!'");
    Local<Script> script = Script::Compile(source);
    Local<Value> result = script->Run();

    String::Utf8Value utf8(result);
    cout << "Result: " << *utf8;
    context.Clear();
  }
  isolate->Dispose();
  V8::Dispose();
}

v8::internal::InitializeFastElementsKindSequence::Construct(v8::internal::ElementsKind * * fast_elements_kind_sequence_ptr) Line 72 v8::base::StaticallyAllocatedInstanceTrait<enum v8::internal::ElementsKind *>::InitStorageUsingTrait<v8::internal::InitializeFastElementsKindSequence>(v8::base::StaticallyAllocatedInstanceTrait<enum v8::internal::ElementsKind *>::StorageType * storage) Line 108 v8::base::LazyInstanceImpl<enum v8::internal::ElementsKind *,v8::base::StaticallyAllocatedInstanceTrait<enum v8::internal::ElementsKind *>,v8::internal::InitializeFastElementsKindSequence,v8::base::ThreadSafeInitOnceTrait,v8::base::LeakyInstanceTrait<enum v8::internal::ElementsKind *>
::InitInstance(v8::base::StaticallyAllocatedInstanceTrait<enum
v8::internal::ElementsKind *>::StorageType * storage) Line 174
v8::base::CallOnceImpl(int * once, void (void *) * init_func, void * arg) Line 37 v8::base::CallOnce<void>(int * once, void (void *) * init_func, void * arg) Line 94 v8::base::ThreadSafeInitOnceTrait::Init<void (__cdecl*)(void *),void *>(int * once, void (void *) * function, void * storage) Line 148 v8::base::LazyInstanceImpl<enum v8::internal::ElementsKind *,v8::base::StaticallyAllocatedInstanceTrait<enum v8::internal::ElementsKind *>,v8::internal::InitializeFastElementsKindSequence,v8::base::ThreadSafeInitOnceTrait,v8::base::LeakyInstanceTrait<enum v8::internal::ElementsKind *> >::Init() Line 183 v8::base::LazyInstanceImpl<enum v8::internal::ElementsKind *,v8::base::StaticallyAllocatedInstanceTrait<enum v8::internal::ElementsKind *>,v8::internal::InitializeFastElementsKindSequence,v8::base::ThreadSafeInitOnceTrait,v8::base::LeakyInstanceTrait<enum v8::internal::ElementsKind *> >::Get() Line 194 v8::internal::GetSequenceIndexFromFastElementsKind(v8::internal::ElementsKind elements_kind) Line 107 v8::internal::ArrayConstructorStubAheadOfTimeHelper<v8::internal::ArrayNoArgumentConstructorStub>(v8::internal::Isolate * isolate) Line 4315 v8::internal::ArrayConstructorStubBase::GenerateStubsAheadOfTime(v8::internal::Isolate * isolate) Line 4330 v8::internal::CodeStub::GenerateStubsAheadOfTime(v8::internal::Isolate * isolate) Line 2268
v8::internal::Heap::CreateFixedStubs() Line 2719
v8::internal::Heap::CreateInitialObjects() Line 2832
v8::internal::Heap::CreateHeapObjects() Line 5139
v8::internal::Isolate::Init(v8::internal::Deserializer * des) Line 1915
v8::internal::V8::Initialize(v8::internal::Deserializer * des) Line 44
v8::InitializeHelper(v8::internal::Isolate * isolate) Line 214
v8::EnsureInitializedForIsolate(v8::internal::Isolate * isolate, const char * location) Line 223 !v8::Context::New(v8::Isolate * external_isolate, v8::ExtensionConfiguration * extensions, v8::Handle<v8::ObjectTemplate> global_template, v8::Handle<v8::Value> global_object) Line 5184


--
You received this message because this project is configured to send all issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings

--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to