[prev in list] [next in list] [prev in thread] [next in thread] 

List:       wine-devel
Subject:    Re: richedit: Fixed Valgrind error related to undoing
From:       "Dylan Smith" <dylan.ah.smith () gmail ! com>
Date:       2008-06-29 17:50:20
Message-ID: 5c6ee3b70806291050o6704089dnde5de48d2126110a () mail ! gmail ! com
[Download RAW message or body]

Ignore this patch, I still need to work on it.

I ran the test again under valgrind the key events were not getting sent
at first in test_EM_AUTOURLDETECT, and then started working after
some point.  I'll resubmit it when it is done properly.

On Sat, Jun 28, 2008 at 11:36 AM, Dylan Smith <dylan.ah.smith@gmail.com> wrote:
> The error was a memory access of a freed object.  In ME_AddUndoItem I
> checked the top of the undo stack to end a coalescing undo transaction,
> assuming that this should be either a valid undo item, or NULL, instead
> it was already freed.
>
> The undo item being added was actually being added to the redo stack by
> ME_Undo, and before this was done the top of the undo stack was
> destroyed by not set to NULL, thus causing the valgrind error.
>
> I fixed this in two places. First of all I moved my code to
> conditionally turn a coalescing end transaction into an actual end
> transaction, since it doesn't need to be done when adding to the redo
> stack.  Second of all, I made sure the undo and redo stack are in
> valid states for ME_Undo and ME_Redo before calling ME_AddUndoItem or
> ME_PlayItem since I could see someone else making the same assumption.
> This should fix the error and make it harder for a regression to occur.
> ---
>  dlls/riched20/undo.c |   37 +++++++++++++++++++------------------
>  1 files changed, 19 insertions(+), 18 deletions(-)
>


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic