Closed Bug 559592 Opened 15 years ago Closed 15 years ago

pointer mayhem in ARM platform detection

Categories

(Core :: JavaScript Engine, defect)

ARM
All
defect
Not set
major

Tracking

()

RESOLVED FIXED
Tracking Status
status1.9.2 --- .7-fixed

People

(Reporter: crowderbt, Assigned: crowderbt)

Details

Attachments

(1 file, 3 obsolete files)

The patch says it all. 1.9.2 is also affected by this issue.
Attached patch The fix (obsolete) — Splinter Review
Assignee: general → crowderbt
Attachment #439270 - Flags: review?(jorendorff)
Comment on attachment 439270 [details] [diff] [review] The fix Moving review to vlad since it's vlad's code and jorendorff wrote the patch.
Attachment #439270 - Flags: review?(jorendorff) → review?(vladimir)
Comment on attachment 439270 [details] [diff] [review] The fix Pretty sure this isn't correct -- the a_un union used to contain a_ptr, but that doesn't work due to 32-bit/64-bit issues, so casting a_val to a pointer should be the right thing. Taking its address implies that the string is encoded directly in the structure, which would mean that sizeof(Elf32_auxv_t) isn't constant.
Attachment #439270 - Flags: review?(vladimir) → review-
No, the sizeof(Elf32_auxv_t) remains constant as long as the strings aren't expected to be null-terminated and are 4-bytes-or-less. In this case, according to the comment here: http://mxr.mozilla.org/mozilla-central/source/js/src/jstracer.cpp#7337 they could even be null-terminated, since only 3 bytes seem to be necessary for the platform encoding.
Attached patch the REAL fix (obsolete) — Splinter Review
Okay, we're already ignoring this string in scratchbox. Let's do a BETTER job of ignoring it.
Attachment #439270 - Attachment is obsolete: true
Attachment #439328 - Flags: review?(vladimir)
Comment on attachment 439328 [details] [diff] [review] the REAL fix Needs to be broader than this.. none of auxv is valid when running under qemu. So should be something like: if (!scratchbox) { open & read auxv } else { if (getenv("ARM_FORCE_HWCAP")) { ... } else { neon = false; ...; } }
Attachment #439328 - Flags: review?(vladimir) → review-
er actually, could simplify a bit more and check the ARM_FORCE_HWCAP and ARM_FORCE_PLATFORM env vars at the end, after we've initialized either from auxv or just hardcoded scratchbox values for armv4.
Attached patch ignore auxv values in scratchbox (obsolete) — Splinter Review
I think this is the cleanest way to do this without duplicating code or refactoring this function more than it deserves.
Attachment #439328 - Attachment is obsolete: true
Attachment #439337 - Flags: review?(vladimir)
Attachment #439337 - Attachment is obsolete: true
Attachment #439339 - Flags: review?(vladimir)
Attachment #439337 - Flags: review?(vladimir)
Comment on attachment 439339 [details] [diff] [review] with better comments. Yep, looks fine -- thanks!
Comment on attachment 439339 [details] [diff] [review] with better comments. We need this on 1.9.2 also
Attachment #439339 - Flags: approval1.9.2.4?
Status: NEW → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
Comment on attachment 439339 [details] [diff] [review] with better comments. a=LegNeato for 1.9.2.5. Please *only* land it on mozilla-1.9.2 default, as we are still working on the 3.6.4 relbranch and do not want this landed there
Attachment #439339 - Flags: approval1.9.2.5+
Attachment #439339 - Flags: approval1.9.2.4?
Attachment #439339 - Flags: approval1.9.2.4-
Keywords: checkin-needed
Attachment #439339 - Flags: approval1.9.2.5+ → approval1.9.2.6+
Keywords: checkin-needed
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: