Closed Bug 544512 Opened 16 years ago Closed 15 years ago

Misaligned accesses in uconv causes Bus Error on sparc and word wrapping on arm

Categories

(Core :: Internationalization, defect)

1.9.1 Branch
Sun
Linux
defect
Not set
critical

Tracking

()

RESOLVED FIXED
mozilla1.9.3a3

People

(Reporter: glandium, Assigned: glandium)

Details

Attachments

(1 file, 1 obsolete file)

Attached patch Patch (obsolete) — Splinter Review
There are 2 places where misaligned accesses can happen and lead to bus errors on sparc. The attached patch addresses both issues. I think the same applies to trunk. With the patch and the one in bug 448658, xpcshell-tests and make check pass on a xulrunner build (i.e. the few tests that live in browser/ are not run) on sparc.
Attachment #425486 - Attachment is patch: true
Attachment #425486 - Attachment mime type: application/octet-stream → text/plain
Attachment #425486 - Flags: review?(smontagu)
Attachment #425486 - Flags: review?(smontagu) → review+
Assignee: smontagu → mh+mozilla
Status: NEW → ASSIGNED
Keywords: checkin-needed
Attached patch Patch v2Splinter Review
This is also a problem on ARM, because it wraps at word boundary. On a 16-bit word, that inverts endianness, and on 32-bit words, this can have very unpleasant side effects. These problems are detected by the current test suite, so they don't need new tests, but an additional fix is obviously necessary. Also note there could be problems when reading the BOM a few lines above, but as this is supposed to happen only at the beginning of the buffer, and I expect the buffer to be sufficiently aligned, it shouldn't be a problem. Or are there places feeding an unaligned buffer to convert ?
Attachment #425486 - Attachment is obsolete: true
Status: ASSIGNED → NEW
Attachment #426807 - Flags: review?(smontagu)
Status: NEW → ASSIGNED
Keywords: checkin-needed
Summary: Bus error on sparc due to misaligned accesses in uconv → Misaligned accesses in uconv causes Bus Error on sparc and word wrapping on arm
Attachment #426807 - Flags: review?(smontagu) → review+
(In reply to comment #1) > Also note there could be problems when reading the BOM a few lines above, but > as this is supposed to happen only at the beginning of the buffer, and I expect > the buffer to be sufficiently aligned, it shouldn't be a problem. Or are there > places feeding an unaligned buffer to convert ? Not as far as I know.
Keywords: checkin-needed
Status: ASSIGNED → RESOLVED
Closed: 15 years ago
Keywords: checkin-needed
Resolution: --- → FIXED
Target Milestone: --- → mozilla1.9.3a3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: