Closed
Bug 559592
Opened 15 years ago
Closed 15 years ago
pointer mayhem in ARM platform detection
Categories
(Core :: JavaScript Engine, defect)
Tracking
()
RESOLVED
FIXED
Tracking | Status | |
---|---|---|
status1.9.2 | --- | .7-fixed |
People
(Reporter: crowderbt, Assigned: crowderbt)
Details
Attachments
(1 file, 3 obsolete files)
1.81 KB,
patch
|
vlad
:
review+
christian
:
approval1.9.2.4-
dveditz
:
approval1.9.2.7+
|
Details | Diff | Splinter Review |
The patch says it all. 1.9.2 is also affected by this issue.
Assignee | ||
Comment 1•15 years ago
|
||
Assignee: general → crowderbt
Attachment #439270 -
Flags: review?(jorendorff)
Assignee | ||
Comment 2•15 years ago
|
||
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-
Assignee | ||
Comment 4•15 years ago
|
||
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.
Assignee | ||
Comment 5•15 years ago
|
||
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.
Assignee | ||
Comment 8•15 years ago
|
||
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)
Assignee | ||
Comment 9•15 years ago
|
||
Attachment #439337 -
Attachment is obsolete: true
Attachment #439339 -
Flags: review?(vladimir)
Attachment #439337 -
Flags: review?(vladimir)
Attachment #439339 -
Flags: review?(vladimir) → review+
Comment on attachment 439339 [details] [diff] [review]
with better comments.
Yep, looks fine -- thanks!
Assignee | ||
Comment 11•15 years ago
|
||
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?
Assignee | ||
Comment 12•15 years ago
|
||
Status: NEW → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
Comment 13•15 years ago
|
||
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-
Assignee | ||
Updated•15 years ago
|
Keywords: checkin-needed
Updated•15 years ago
|
Attachment #439339 -
Flags: approval1.9.2.5+ → approval1.9.2.6+
Comment 14•15 years ago
|
||
status1.9.2:
--- → .6-fixed
Updated•15 years ago
|
Keywords: checkin-needed
You need to log in
before you can comment on or make changes to this bug.
Description
•