Closed Bug 507395 Opened 16 years ago Closed 16 years ago

Incorrect check for atoms in Sampler::presweep

Categories

(Tamarin Graveyard :: Tools, defect)

x86
Windows Vista
defect
Not set
normal

Tracking

(Not tracked)

VERIFIED FIXED

People

(Reporter: rhudea, Unassigned)

Details

Attachments

(1 file, 1 obsolete file)

User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US) AppleWebKit/532.0 (KHTML, like Gecko) Chrome/3.0.195.3 Safari/532.0 Build Identifier: In Sampler::presweep, there is the following check needed to keep the object's type alive: if (s.typeOrVTable > 7 && !GC::GetMark((void*)s.typeOrVTable)) { GCWorkItem item((void*)s.typeOrVTable, (uint32)GC::Size((void*)s.typeOrVTable), true); core->gc->PushWorkItem(item); } But "s.typeOrVTable > 7" is not enough to differentiate between basic types and atoms, because in recordAllocationInfo there is this code: if(typeOrVTable < 7 && core->codeContext() && core->codeContext()->domainEnv()) { typeOrVTable |= (uintptr)core->codeContext()->domainEnv()->toplevel(); } Example: For an allocated String object, typeOrVTable = 2 (kStringType), but after executing the code above, typeOrVTable becomes greater than 7. When Sampler::presweep is executed and the String object is found, GCWorkItem will assert because typeOrVTable is not 8-byte aligned. Reproducible: Always
Attached patch Use atomPtr on typeOrVTable (obsolete) — Splinter Review
Use atomPtr for typeOrVTable. Suggestion from treilly.
Attachment #391619 - Flags: superreview?(stejohns)
Attachment #391619 - Flags: review?(treilly)
Comment on attachment 391619 [details] [diff] [review] Use atomPtr on typeOrVTable naming nit, ptr would be a better name, since after the call to atomPtr its no longer an atom. Shouldn't the first test be atom != NULL instead of !atom?
Attachment #391619 - Flags: review?(treilly) → review-
Attachment #391619 - Attachment is obsolete: true
Attachment #391627 - Flags: superreview?(stejohns)
Attachment #391627 - Flags: review?(treilly)
Attachment #391619 - Flags: superreview?(stejohns)
Attachment #391627 - Flags: superreview?(stejohns) → superreview+
Attachment #391627 - Flags: review?(treilly) → review+
changeset: 2289:361724188074
Status: UNCONFIRMED → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: