Closed Bug 511768 Opened 16 years ago Closed 16 years ago

GCHashtable remove is called during Finalize which can rehash causing an alloc

Categories

(Tamarin Graveyard :: Garbage Collection (mmGC), defect)

x86
macOS
defect
Not set
normal

Tracking

(Not tracked)

VERIFIED FIXED

People

(Reporter: treilly, Assigned: treilly)

Details

Attachments

(2 files)

We should make the remove either not alloc or use CanFail so we don't trigger the cycle again. Problem call stack Flash.ocx!MMgc::GCHeap::AddrToBlock(const void* item = 0x68ae0008) Line: 678, Byte Offsets: 0xa0 C++ Flash.ocx!MMgc::GCHeap::Size(const void* item = 0x68ae0008) Line: 331, Byte Offsets: 0x30 C++ Flash.ocx!MMgc::FixedMalloc::LargeSize(const void* item = 0x68ae0008) Line: 287, Byte Offsets: 0x20 C++ Flash.ocx!MMgc::FixedMalloc::Size(const void* item = 0x68ae0008) Line: 99, Byte Offsets: 0x44 C++ Flash.ocx!MMgc::FixedMalloc::LargeAlloc(unsigned int size = 4112, bool canFail = true) Line: 261, Byte Offsets: 0x108 C++ Flash.ocx!MMgc::FixedMalloc::Alloc(unsigned int size = 4096, bool canFail = true) Line: 171, Byte Offsets: 0x74 C++ Flash.ocx!MMgc::FixedMalloc::PleaseAlloc(unsigned int size = 4096) Line: 78, Byte Offsets: 0x28 C++ Flash.ocx!MMgc::AllocStackSegment(unsigned int nbytes = 4096) Line: 62, Byte Offsets: 0x40 C++ Flash.ocx!MMgc::GCMarkStack::PushSegment(void) Line: 113, Byte Offsets: 0x7c C++ Flash.ocx!MMgc::GCMarkStack::Push(MMgc::GCWorkItem item = {...}) Line: 164, Byte Offsets: 0x64 C++ Flash.ocx!MMgc::GC::PushWorkItem(MMgc::GCWorkItem item = {...}) Line: 1038, Byte Offsets: 0x50 C++ Flash.ocx!MMgc::GC::MarkItem(MMgc::GCWorkItem& wi = {...}) Line: 2875, Byte Offsets: 0x388 C++ Flash.ocx!MMgc::GC::MarkAllRoots(void) Line: 2455, Byte Offsets: 0x68 C++ Flash.ocx!MMgc::GC::StartIncrementalMark(void) Line: 2432, Byte Offsets: 0x264 C++ Flash.ocx!MMgc::GC::Collect(bool scanStack = true) Line: 1014, Byte Offsets: 0xc4 C++ Flash.ocx!MMgc::GC::memoryStatusChange(MMgc::_MemoryStatus __formal = 0, MMgc::_MemoryStatus to = 1) Line: 3653, Byte Offsets: 0x40 C++ Flash.ocx!MMgc::GCHeap::StatusChangeNotify(MMgc::_MemoryStatus to = 1) Line: 1894, Byte Offsets: 0xb8 C++ Flash.ocx!MMgc::GCHeap::ExpandHeap(int askSize = 5, bool canFail = false) Line: 1108, Byte Offsets: 0x60 C++ Flash.ocx!MMgc::GCHeap::Alloc(int size = 5, int flags = 1) Line: 257, Byte Offsets: 0x104 C++ Flash.ocx!MMgc::FixedMalloc::LargeAlloc(unsigned int size = 16400, bool canFail = false) Line: 249, Byte Offsets: 0x94 C++ Flash.ocx!MMgc::FixedMalloc::Alloc(unsigned int size = 16384, bool canFail = false) Line: 171, Byte Offsets: 0x74 C++ Flash.ocx!MMgc::FixedMalloc::Alloc(unsigned int size = 16384) Line: 70, Byte Offsets: 0x28 C++ Flash.ocx!MMgc::FixedMalloc::OutOfLineAlloc(unsigned int size = 16384) Line: 169, Byte Offsets: 0x1c C++ Flash.ocx!operator new[](unsigned int size = 16384) Line: 72, Byte Offsets: 0x70 C++ Flash.ocx!MMgc::GCHashtable::grow(void) Line: 233, Byte Offsets: 0x18c C++ Flash.ocx!MMgc::GCHashtable::remove(const void* key = 0x5dc539c8) Line: 130, Byte Offsets: 0x138 C++ Flash.ocx!MMgc::GC::ClearWeakRef(const void* item = 0x5dc539c8) Line: 3350, Byte Offsets: 0x20 C++ Flash.ocx!MMgc::GCWeakRef::~GCWeakRef(void) Line: 60, Byte Offsets: 0x50 C++ Flash.ocx!MMgc::GCWeakRef::`scalar deleting destructor'(void) Line: 0, Byte Offsets: 0xffffffff C++ Flash.ocx!MMgc::GCAlloc::Finalize(void) Line: 447, Byte Offsets: 0x3bc C++ Flash.ocx!MMgc::GC::Finalize(void) Line: 1372, Byte Offsets: 0x98 C++ Flash.ocx!MMgc::GC::Sweep(bool force = false) Line: 1420, Byte Offsets: 0xe0 C++ Flash.ocx!MMgc::GC::FinishIncrementalMark(bool scanStack = true) Line: 3091, Byte Offsets: 0x248 C++ Flash.ocx!MMgc::GC::Collect(bool scanStack = true) Line: 1022, Byte Offsets: 0xe4 C++ Flash.ocx!MMgc::GC::memoryStatusChange(MMgc::_MemoryStatus __formal = 0, MMgc::_MemoryStatus to = 1) Line: 3656, Byte Offsets: 0x6c C++ Flash.ocx!MMgc::GCHeap::StatusChangeNotify(MMgc::_MemoryStatus to = 1) Line: 1894, Byte Offsets: 0xb8 C++ Flash.ocx!MMgc::GCHeap::ExpandHeap(int askSize = 1, bool canFail = false) Line: 1108, Byte Offsets: 0x60 C++ Flash.ocx!MMgc::GCHeap::Alloc(int size = 1, int flags = 3) Line: 257, Byte Offsets: 0x104 C++ Flash.ocx!MMgc::GC::heapAlloc(unsigned int siz = 1, int flags = 3) Line: 3443, Byte Offsets: 0x28 C++ Flash.ocx!MMgc::GC::AllocBlock(int size = 1, int pageType = 1, bool zero = true, bool canFail = false) Line: 1501, Byte Offsets: 0xe0 C++ Flash.ocx!MMgc::GCAlloc::CreateChunk(int flags = 0) Line: 126, Byte Offsets: 0xf0 C++ Flash.ocx!MMgc::GCAlloc::Alloc(unsigned int size = 128, int flags = 3) Line: 235, Byte Offsets: 0xfc C++ Flash.ocx!MMgc::GC::Alloc(unsigned int size = 144, int flags = 3) Line: 1247, Byte Offsets: 0x2a4 C++ Flash.ocx!MMgc::GC::Calloc(unsigned int num = 16, unsigned int elsize = 8, int flags = 3) Line: 1294, Byte Offsets: 0x40 C++
Attached file stack trace in a file
Attachment #395727 - Flags: superreview?(edwsmith)
Attachment #395727 - Flags: review?(stejohns)
Attachment #395727 - Flags: review?(stejohns) → review+
Comment on attachment 395727 [details] [diff] [review] fixes problem by avoiding rehash during Collection Was this a bug-waiting-to-happen, or did my recent GCHashtable rewrite introduce it?
introduced by recent change, we didn't used to rehash during remove so this brings us back to old behavior when collecting is true.
Attachment #395727 - Flags: superreview?(edwsmith) → superreview+
Status: NEW → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: