https://bugs.kde.org/show_bug.cgi?id=359871

Steven Smith <so...@archy.org.uk> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #97645|0                           |1
        is obsolete|                            |

--- Comment #12 from Steven Smith <so...@archy.org.uk> ---
Created attachment 97670
  --> https://bugs.kde.org/attachment.cgi?id=97670&action=edit
Second attempt at a linux fix

Okay, here's another variant which sets more sensible cost centers for
VG_(malloc), uses -q in the test case, and avoids playing with ARG7.

The ARG7 business was there to let the PRE hook communicate to the POST one
whether it had actually done the substitution, so that it knew whether it had
to call VG_(free). I didn't want to call ML_(safe_to_deref) again because I was
worried about racing with the guess calling mmap(), and I didn't want to do it
unconditionally because I wasn't sure how to build the substitution if some of
the calls to ML_(safe_to_deref) said no. Looking at getSyscallArgsFromState(),
it seemed like ARG7 was always initialised to zero on Linux, so it'd be a safe
place for an extra flag (and I figured that if I was wrong an assertion failure
would be easier to track down than a bad VG_(free)()), but I see now that mips
leaves it uninitialised, so that isn't going to work.

The new patch always allocates and releases the substitution whenever ARG6 is
non-NULL, and just VKI_EFAULTs any calls where it can't get the guest's desired
mask. I also converted the ppoll wrapper to the same model, just for symmetry.

Thank you for the review.

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to