Closed Bug 490001 Opened 15 years ago Closed 14 years ago

WordcodeEmitter memory leak

Categories

(Tamarin Graveyard :: Interpreter, defect)

x86
Windows XP
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED WORKSFORME
Future

People

(Reporter: tharwood, Assigned: lhansen)

References

Details

Running sanity/class_ctor.as from the ASC test suite with a debug build.  Not sure if the verifier error is expected output or not:

caught exception: VerifyError: Error #1063: Argument count mismatch on A(). Expected 1, got 0.
Leaked 24 byte item.  Addr: 0x00CD7078


	MMgc::GCHeap::AllocHook(gcheap.cpp:1445) - 0x4dfa74
	MMgc::FixedAlloc::Alloc(fixedalloc.cpp:161) - 0x4dc799
	MMgc::FixedAllocSafe::Alloc(fixedalloc.h:143) - 0x403018
	MMgc::FixedMalloc::Alloc(fixedmalloc.h:66) - 0x402f65
	operator new[](gcglobalnew.h:70) - 0x408b3a
	avmplus::WordcodeEmitter::boot(wordcodeemitter.cpp:116) - 0x4ae126
	avmplus::WordcodeEmitter::WordcodeEmitter(wordcodeemitter.cpp:80) - 0x4ae077
	avmplus::MethodInfo::verify(methodinfo.cpp:229) - 0x44cce1
	avmplus::MethodInfo::verifyEnter(methodinfo.cpp:165) - 0x44cb02
	avmplus::MethodEnv::endCoerce(methodenv.cpp:251) - 0x45599b
	avmplus::MethodEnv::coerceUnboxEnter(methodenv.cpp:445) - 0x45119e
	avmplus::MethodEnv::coerceEnter(methodenv.cpp:429) - 0x451052
	avmplus::ClassClosure::construct(classclosure.cpp:121) - 0x41d06b
	avmplus::Toplevel::op_construct(toplevel.cpp:250) - 0x4207a5
	avmplus::Toplevel::constructprop(toplevel.cpp:615) - 0x42131f

Assertion failed: "((false))" (".\\FixedAlloc.cpp":91)
Looked at the test output again: the 1063 error is expected.
The leaked item is WordcodeEmitter::caches, which doesn't look leaky on a quick inspection.
There might be a problem in MethodInfo::verify.  If that throws an exception then the stack-allocated WordcodeEmitter will not be deleted properly, which means it will not clean up its heap-allocated memory.

One fix would presumably be to make the WordcodeEmitter a GCFinalizableObject so that its destructor is always run.
Blocks: Wordcode
Target Milestone: --- → Future
Assignee: nobody → lhansen
Assignee: lhansen → nobody
still valid?
Component: Virtual Machine → Interpreter
Assignee: nobody → lhansen
Tested and observed no leak.  Plus, WordcodeEmitter::caches is no longer there, and MethodInfo::verify is gone too.
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.