Unaligned memory access in nsCompressedCharMap::SetChars

RESOLVED DUPLICATE of bug 102113

Status

()

Core
Layout
--
critical
RESOLVED DUPLICATE of bug 102113
17 years ago
17 years ago

People

(Reporter: bobbell, Assigned: kill this account)

Tracking

Trunk
DEC
OSF/1
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

17 years ago
nsCompressedCharMap::SetChars accesses unaligned memory.  With the default
settings on Tru64 UNIX, Tru64 UNIX correctly detects this, corrects it, and
prints a warning message.  However, Tru64 UNIX can also be set to crash with
this behavior, and it is technically incorrect.

The problem was discovered using a recent nightly build.  Lines 298 and 299 of
nsCompressedCharMap.cpp are at fault.  They read:
    NS_ASSERTION(page[i]==0, "this page should be unused");
    page[i] = aPage[i];

page (from my crash dump) is a pointer on a four byte boundary.  This is because
is an offset into mCCMap, which is an array of 16-bit data types.  However, page
is a point to ALU_TYPE, which on Tru64 UNIX is a 64-bit data type.  Thus, page
is not properly aligned.
(Assignee)

Comment 1

17 years ago
This is a dup of bug 102133 (although the info is new so I will copy it over
to bug 102133).

Brendan indicates he knows a fix.


*** This bug has been marked as a duplicate of 102133 ***
Status: UNCONFIRMED → RESOLVED
Last Resolved: 17 years ago
Resolution: --- → DUPLICATE

Comment 2

17 years ago
You've dupped the wrong bug...
Status: RESOLVED → UNCONFIRMED
Resolution: DUPLICATE → ---
(Reporter)

Comment 3

17 years ago
This bug should have been marked as a duplicate of bug 102113, not bug 102133.  
I am correcting that.  The information was copied over to the correct bug, 
though.

*** This bug has been marked as a duplicate of 102113 ***
Status: UNCONFIRMED → RESOLVED
Last Resolved: 17 years ago17 years ago
Resolution: --- → DUPLICATE
(Assignee)

Comment 4

17 years ago
thanks
You need to log in before you can comment on or make changes to this bug.