Closed Bug 596608 Opened 14 years ago Closed 14 years ago

_to_method_handler copies uninitialized stack data into data segment

Categories

(Tamarin Graveyard :: Virtual Machine, defect)

x86
macOS
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: treilly, Unassigned)

References

Details

Attachments

(1 file)

Eventually this data finds its way into a MethodInfo, the GC scans it and valgrind flags the read there.

Interestingly only happens on 64 bit builds, release and debug.
Blocks: 509020
Attached patch naive fixSplinter Review
There's gotta be a way to fix this that does away with _to_method_handler function.   Apparently its only needed for MSVC (the AOT approach works everywhere but).
Attachment #475583 - Flags: feedback?(stejohns)
Comment on attachment 475583 [details] [diff] [review]
naive fix

Seems reasonable, but use NULL instead of 0 (gcc 4.5 will complain otherwise).
Attachment #475583 - Flags: feedback?(stejohns) → feedback+
http://hg.mozilla.org/users/treilly_adobe.com/tr-valgrind/rev/ccd6eabee566

I thought NULL too but Edwin seemed to prefer zero, I'll never understand the nuances of that debate (by choice)
Edwin prefers zero, but gcc4.5 is forcing the issue by spewing warnings if you use 0 for a pointer type
Although Edwin is technically correct he is morally in the wrong - NULL carries information to the reader, and 0 does not.  (Also good compilers define NULL as something other than "0" so that NULL can't be abused in non-pointer contexts.) The absence of "nil" or a similar null-pointer idiom from C is a botch, but matters more in some decades than in others.  Apparently we're on the upswing again after a decade of complacency.
Comment on attachment 475583 [details] [diff] [review]
naive fix

Couldn't think of an easy way to remove this hack so thinking we push this and create another bug to figure out how to do away with _to_method_handler?
Attachment #475583 - Flags: superreview?
Attachment #475583 - Flags: review?(edwsmith)
Attachment #475583 - Flags: superreview?
Comment on attachment 475583 [details] [diff] [review]
naive fix

sounds good. Create the bug and add a "fixme: bug XXX" comment before pushing.
Attachment #475583 - Flags: review?(edwsmith) → review+
new bug 599931
http://hg.mozilla.org/tamarin-redux/rev/05f2ed27e868
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: