From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10370 invoked by alias); 3 Aug 2009 03:51:23 -0000 Received: (qmail 10322 invoked by uid 22791); 3 Aug 2009 03:51:21 -0000 X-SWARE-Spam-Status: No, hits=-1.7 required=5.0 tests=AWL,BAYES_00,SARE_MSGID_LONG40,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mail-pz0-f197.google.com (HELO mail-pz0-f197.google.com) (209.85.222.197) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 03 Aug 2009 03:51:14 +0000 Received: by pzk35 with SMTP id 35so2520735pzk.24 for ; Sun, 02 Aug 2009 20:51:12 -0700 (PDT) MIME-Version: 1.0 Received: by 10.142.114.20 with SMTP id m20mr495403wfc.48.1249271472083; Sun, 02 Aug 2009 20:51:12 -0700 (PDT) In-Reply-To: References: <4A69182D.9090004@vmware.com> <4A6B6E02.5080702@vmware.com> <4A74C90D.4040004@vmware.com> From: Hui Zhu Date: Mon, 03 Aug 2009 03:51:00 -0000 Message-ID: Subject: Re: [PREC/RFA] Add not_replay to make precord support release memory better To: Michael Snyder Cc: gdb-patches ml Content-Type: multipart/mixed; boundary=00504502cb97525404047034aed1 X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2009-08/txt/msg00015.txt.bz2 --00504502cb97525404047034aed1 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-length: 17704 On Sun, Aug 2, 2009 at 12:10, Hui Zhu wrote: > I think this patch is very good. > > I a new changelog for it: > 2009-08-02 =A0Michael Snyder > =A0 =A0 =A0 =A0 =A0 =A0Hui Zhu =A0 > > =A0 =A0 =A0 =A0* record.c (record_mem_entry): New field > =A0 =A0 =A0 =A0'mem_entry_not_accessible'. > =A0 =A0 =A0 =A0(record_arch_list_add_mem): Initialize > =A0 =A0 =A0 =A0'mem_entry_not_accessible' to 0. > =A0 =A0 =A0 =A0(record_wait): Set 'mem_entry_not_accessible' flag if targ= et > =A0 =A0 =A0 =A0memory not readable. =A0Don't try to change target memory = if > =A0 =A0 =A0 =A0'mem_entry_not_accessible' is set. > > Do you think it's ok? > > Thanks, > Hui > > On Sun, Aug 2, 2009 at 07:00, Michael Snyder wrote: >> Hui Zhu wrote: >>> >>> On Sun, Jul 26, 2009 at 04:41, Michael Snyder wrote: >>>> >>>> Hui Zhu wrote: >>>>> >>>>> On Fri, Jul 24, 2009 at 10:10, Michael Snyder wro= te: >>>>>> >>>>>> 1) During the recording "pass", there's no change. >>>>>> 2) During the reverse-replay pass, if the memory is >>>>>> not readable or writable, we will set this flag to TRUE. >>>>>> 3) Finally, during the forward-replay pass, if the flag >>>>>> has previously been set to TRUE, we will skip this entry >>>>>> (and set the flag to FALSE.) >>>>>> >>>>>> So my question is -- is there any reason to set it to FALSE here? >>>>>> Is there any way that the memory can ever become readable again? >>>>>> >>>>>> Seems to me, once it is set TRUE, we might as well just leave it TRU= E. >>>>>> Am I right? >>>>> >>>>> I thought about it too. =A0I think if we don't need this entry. =A0We= can >>>>> delete it directly. >>>>> But there is a special status, after release memory, inferior alloc >>>>> some memory and its address is same with the memory that released >>>>> memory. =A0Then the memory entry will can be use in this status. =A0U= ser >>>>> can get the right value of memory before this entry. =A0So I think ma= ybe >>>>> we can keep it. >>>>> >>>>> What do you think about it? >>>> >>>> Let's say a program does something like this: >>>> >>>> buf =3D mmap (...); >>>> munmap (...); >>>> buf =3D mmap (...); >>>> munmap (...); >>>> buf =3D mmap (...); >>>> >>>> and so on. =A0And suppose that, for whatever reason, mmap always >>>> returns the same address. >>>> >>>> Then it seems to me (and please correct me if I am wrong), that >>>> it all depends on where we stop the recording. >>>> >>>> If we stop the recording after mmap, but before munmap, then >>>> the memory will be readable throughout the ENTIRE recording. >>>> >>>> But if we stop the recording after munmap, but before mmap, then >>>> the memory will NOT be readable (again for the entire recording). >>>> >>>> So as you replay backward and forward through the recording, the >>>> readability state of the memory location will never change -- it >>>> will remain either readable, or unreadable, depending only on >>>> the mapped-state when the recording ended. >>>> >>>> The only way for it to change, I think, would be if we could >>>> resume the process and add some more execution to the end of >>>> the existing recording. >>>> >>> >>> Agree with you. =A0We can do more thing around release memory. >>> >>> But this patch make prec work OK even if inferior release some memory. >>> =A0Of course, the released memory we still can not access. =A0But other >>> memory is OK. >>> >>> This is a low cost idea for release memory. =A0And we still can add >>> other thing about =A0release memory. >> >> Yes, I like the patch, and I want to see it go in, but >> you haven't really answered my question: >> >> Once we have set this flag to TRUE in a recording entry, >> why would we ever need to set it to FALSE? >> >> The patch is simpler and easier to understand if we simply >> leave the flag TRUE. =A0It worries me to see it toggling back >> and forth between TRUE and FALSE every time we play through >> the recording, if there is no benefit to doing that. =A0Plus >> it means that we keep trying to read the target memory even >> though we know it will fail. >> >> I'm attaching a diff to show what I mean, in case it isn't clear. >> This diff gives me the same behavior with your munmap test case >> as your diff does. >> >> >> >> >> Index: record.c >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >> RCS file: /cvs/src/src/gdb/record.c,v >> retrieving revision 1.9 >> diff -u -p -r1.9 record.c >> --- record.c =A0 =A022 Jul 2009 05:31:26 -0000 =A0 =A0 =A01.9 >> +++ record.c =A0 =A01 Aug 2009 22:59:55 -0000 >> @@ -51,6 +51,7 @@ struct record_mem_entry >> =A0{ >> =A0 CORE_ADDR addr; >> =A0 int len; >> + =A0int mem_entry_not_accessible; >> =A0 gdb_byte *val; >> =A0}; >> >> @@ -275,6 +276,7 @@ record_arch_list_add_mem (CORE_ADDR addr >> =A0 rec->type =3D record_mem; >> =A0 rec->u.mem.addr =3D addr; >> =A0 rec->u.mem.len =3D len; >> + =A0rec->u.mem.mem_entry_not_accessible =3D 0; >> >> =A0 if (target_read_memory (addr, rec->u.mem.val, len)) >> =A0 =A0 { >> @@ -727,32 +729,52 @@ record_wait (struct target_ops *ops, >> =A0 =A0 =A0 =A0 =A0else if (record_list->type =3D=3D record_mem) >> =A0 =A0 =A0 =A0 =A0 =A0{ >> =A0 =A0 =A0 =A0 =A0 =A0 =A0/* mem */ >> - =A0 =A0 =A0 =A0 =A0 =A0 gdb_byte *mem =3D alloca (record_list->u.mem.l= en); >> - =A0 =A0 =A0 =A0 =A0 =A0 if (record_debug > 1) >> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 fprintf_unfiltered (gdb_stdlog, >> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 "P= rocess record: record_mem %s to " >> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 "i= nferior addr =3D %s len =3D %d.\n", >> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 ho= st_address_to_string (record_list), >> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 pa= ddress (gdbarch, >> record_list->u.mem.addr), >> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 re= cord_list->u.mem.len); >> - >> - =A0 =A0 =A0 =A0 =A0 =A0 if (target_read_memory >> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 (record_list->u.mem.addr, mem, record_= list->u.mem.len)) >> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 error (_("Process record: error reading me= mory at " >> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0"addr =3D %s len =3D %d= ."), >> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0paddress (gdbarch, record_l= ist->u.mem.addr), >> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0record_list->u.mem.len); >> - >> - =A0 =A0 =A0 =A0 =A0 =A0 if (target_write_memory >> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 (record_list->u.mem.addr, record_list-= >u.mem.val, >> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0record_list->u.mem.len)) >> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 error (_ >> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0("Process record: error wri= ting memory at " >> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 "addr =3D %s len =3D %d."), >> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0paddress (gdbarch, record_l= ist->u.mem.addr), >> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0record_list->u.mem.len); >> - >> - =A0 =A0 =A0 =A0 =A0 =A0 memcpy (record_list->u.mem.val, mem, record_li= st->u.mem.len); >> + =A0 =A0 =A0 =A0 =A0 =A0 if (record_list->u.mem.mem_entry_not_accessibl= e =3D=3D 0) >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 { >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 gdb_byte *mem =3D alloca (record_list-= >u.mem.len); >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (record_debug > 1) >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 fprintf_unfiltered (gdb_stdlog, >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 "Process record: record_mem %s to " >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 "inferior addr =3D %s len =3D %d.\n", >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 host_address_to_string >> (record_list), >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 paddress (gdbarch, >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 =A0 =A0 =A0 =A0 record_list->u.mem.addr), >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 record_list->u.mem.len); >> + >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (target_read_memory (record_list->u= .mem.addr, mem, >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 record_list->u.mem.len)) >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 { >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (execution_direction !=3D E= XEC_REVERSE) >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 error (_("Process record: = error reading memory at " >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0"addr = =3D %s len =3D %d."), >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0paddress (g= dbarch, record_list->u.mem.addr), >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0record_list= ->u.mem.len); >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 else >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 record_list->u.mem.mem_ent= ry_not_accessible =3D 1; >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 } >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 else >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 { >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (target_write_memory (recor= d_list->u.mem.addr, >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 =A0 =A0 =A0record_list->u.mem.val, >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 =A0 =A0 =A0record_list->u.mem.len)) >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 { >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (execution_directio= n !=3D EXEC_REVERSE) >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 error (_("Process = record: error writing memory >> at " >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0"addr =3D %s len =3D %d."), >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0pad= dress (gdbarch, >> record_list->u.mem.addr), >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0rec= ord_list->u.mem.len); >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 else >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 { >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 record_list->u= .mem.mem_entry_not_accessible =3D >> 1; >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 } >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 } >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 else >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 { >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 memcpy (record_list->u= .mem.val, mem, >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 record= _list->u.mem.len); >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 } >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 } >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 } >> =A0 =A0 =A0 =A0 =A0 =A0} >> =A0 =A0 =A0 =A0 =A0else >> =A0 =A0 =A0 =A0 =A0 =A0{ >> >> > Hi Michael, I make a new patch for this function. Please help me review it. Thanks, Hui 2009-08-03 Michael Snyder Hui Zhu * record.c (record_mem_entry): New field 'mem_entry_not_accessible'. (record_arch_list_add_mem): Initialize 'mem_entry_not_accessible' to 0. (record_exec_entry): New function. (record_wait): Call 'record_exec_entry'. --- record.c | 133 +++++++++++++++++++++++++++++++++++++++++-----------------= ----- 1 file changed, 87 insertions(+), 46 deletions(-) --- a/record.c +++ b/record.c @@ -51,6 +51,7 @@ struct record_mem_entry { CORE_ADDR addr; int len; + int mem_entry_not_accessible; gdb_byte *val; }; @@ -275,6 +276,7 @@ record_arch_list_add_mem (CORE_ADDR addr rec->type =3D record_mem; rec->u.mem.addr =3D addr; rec->u.mem.len =3D len; + rec->u.mem.mem_entry_not_accessible =3D 0; if (target_read_memory (addr, rec->u.mem.val, len)) { @@ -412,6 +414,89 @@ record_gdb_operation_disable_set (void) return old_cleanups; } +static inline void +record_exec_entry (struct regcache *regcache, struct gdbarch *gdbarch, + struct record_entry *entry) +{ + switch (entry->type) + { + case record_reg: /* reg */ + { + gdb_byte reg[MAX_REGISTER_SIZE]; + + if (record_debug > 1) + fprintf_unfiltered (gdb_stdlog, + "Process record: record_reg %s to " + "inferior num =3D %d.\n", + host_address_to_string (entry), + entry->u.reg.num); + + regcache_cooked_read (regcache, entry->u.reg.num, reg); + regcache_cooked_write (regcache, entry->u.reg.num, entry->u.reg.va= l); + memcpy (entry->u.reg.val, reg, MAX_REGISTER_SIZE); + } + break; + + case record_mem: /* mem */ + { + if (!record_list->u.mem.mem_entry_not_accessible) + { + gdb_byte *mem =3D alloca (entry->u.mem.len); + + if (record_debug > 1) + fprintf_unfiltered (gdb_stdlog, + "Process record: record_mem %s to " + "inferior addr =3D %s len =3D %d.\n", + host_address_to_string (entry), + paddress (gdbarch, entry->u.mem.addr), + record_list->u.mem.len); + + if (target_read_memory (entry->u.mem.addr, mem, entry->u.mem.l= en)) + { + if (execution_direction =3D=3D EXEC_REVERSE) + { + record_list->u.mem.mem_entry_not_accessible =3D 1; + if (record_debug) + warning (_("Process record: error reading memory at " + "addr =3D %s len =3D %d."), + paddress (gdbarch, entry->u.mem.addr), + entry->u.mem.len); + } + else + error (_("Process record: error reading memory at " + "addr =3D %s len =3D %d."), + paddress (gdbarch, entry->u.mem.addr), + entry->u.mem.len); + } + else + { + if (target_write_memory (entry->u.mem.addr, entry->u.mem.v= al, + entry->u.mem.len)) + { + if (execution_direction =3D=3D EXEC_REVERSE) + { + record_list->u.mem.mem_entry_not_accessible =3D 1; + if (record_debug) + warning (_("Process record: error writing memory= at " + "addr =3D %s len =3D %d."), + paddress (gdbarch, entry->u.mem.addr), + entry->u.mem.len); + } + else + error (_("Process record: error writing memory at " + "addr =3D %s len =3D %d."), + paddress (gdbarch, entry->u.mem.addr), + entry->u.mem.len); + } + } + + memcpy (entry->u.mem.val, mem, entry->u.mem.len); + } + } + break; + } +} + static void record_open (char *name, int from_tty) { @@ -708,53 +793,9 @@ record_wait (struct target_ops *ops, break; } - /* Set ptid, register and memory according to record_list. */ - if (record_list->type =3D=3D record_reg) - { - /* reg */ - gdb_byte reg[MAX_REGISTER_SIZE]; - if (record_debug > 1) - fprintf_unfiltered (gdb_stdlog, - "Process record: record_reg %s to " - "inferior num =3D %d.\n", - host_address_to_string (record_list), - record_list->u.reg.num); - regcache_cooked_read (regcache, record_list->u.reg.num, reg); - regcache_cooked_write (regcache, record_list->u.reg.num, - record_list->u.reg.val); - memcpy (record_list->u.reg.val, reg, MAX_REGISTER_SIZE); - } - else if (record_list->type =3D=3D record_mem) - { - /* mem */ - gdb_byte *mem =3D alloca (record_list->u.mem.len); - if (record_debug > 1) - fprintf_unfiltered (gdb_stdlog, - "Process record: record_mem %s to " - "inferior addr =3D %s len =3D %d.\n", - host_address_to_string (record_list), - paddress (gdbarch, record_list->u.mem.addr), - record_list->u.mem.len); - - if (target_read_memory - (record_list->u.mem.addr, mem, record_list->u.mem.len)) - error (_("Process record: error reading memory at " - "addr =3D %s len =3D %d."), - paddress (gdbarch, record_list->u.mem.addr), - record_list->u.mem.len); - - if (target_write_memory - (record_list->u.mem.addr, record_list->u.mem.val, - record_list->u.mem.len)) - error (_ - ("Process record: error writing memory at " - "addr =3D %s len =3D %d."), - paddress (gdbarch, record_list->u.mem.addr), - record_list->u.mem.len); + record_exec_entry (regcache, gdbarch, record_list); - memcpy (record_list->u.mem.val, mem, record_list->u.mem.len); - } - else + if (record_list->type =3D=3D record_end) { if (record_debug > 1) fprintf_unfiltered (gdb_stdlog, --00504502cb97525404047034aed1 Content-Type: text/plain; charset=US-ASCII; name="prec-mem-not-replay.txt" Content-Disposition: attachment; filename="prec-mem-not-replay.txt" Content-Transfer-Encoding: base64 X-Attachment-Id: f_fxwo1g7b0 Content-length: 8170 LS0tCiByZWNvcmQuYyB8ICAxMzMgKysrKysrKysrKysrKysrKysrKysrKysr KysrKysrKysrKysrKysrKystLS0tLS0tLS0tLS0tLS0tLS0tLS0tCiAxIGZp bGUgY2hhbmdlZCwgODcgaW5zZXJ0aW9ucygrKSwgNDYgZGVsZXRpb25zKC0p CgotLS0gYS9yZWNvcmQuYworKysgYi9yZWNvcmQuYwpAQCAtNTEsNiArNTEs NyBAQCBzdHJ1Y3QgcmVjb3JkX21lbV9lbnRyeQogewogICBDT1JFX0FERFIg YWRkcjsKICAgaW50IGxlbjsKKyAgaW50IG1lbV9lbnRyeV9ub3RfYWNjZXNz aWJsZTsKICAgZ2RiX2J5dGUgKnZhbDsKIH07CiAKQEAgLTI3NSw2ICsyNzYs NyBAQCByZWNvcmRfYXJjaF9saXN0X2FkZF9tZW0gKENPUkVfQUREUiBhZGRy CiAgIHJlYy0+dHlwZSA9IHJlY29yZF9tZW07CiAgIHJlYy0+dS5tZW0uYWRk ciA9IGFkZHI7CiAgIHJlYy0+dS5tZW0ubGVuID0gbGVuOworICByZWMtPnUu bWVtLm1lbV9lbnRyeV9ub3RfYWNjZXNzaWJsZSA9IDA7CiAKICAgaWYgKHRh cmdldF9yZWFkX21lbW9yeSAoYWRkciwgcmVjLT51Lm1lbS52YWwsIGxlbikp CiAgICAgewpAQCAtNDEyLDYgKzQxNCw4OSBAQCByZWNvcmRfZ2RiX29wZXJh dGlvbl9kaXNhYmxlX3NldCAodm9pZCkKICAgcmV0dXJuIG9sZF9jbGVhbnVw czsKIH0KIAorc3RhdGljIGlubGluZSB2b2lkCityZWNvcmRfZXhlY19lbnRy eSAoc3RydWN0IHJlZ2NhY2hlICpyZWdjYWNoZSwgc3RydWN0IGdkYmFyY2gg KmdkYmFyY2gsCisgICAgICAgICAgICAgICAgICAgc3RydWN0IHJlY29yZF9l bnRyeSAqZW50cnkpCit7CisgIHN3aXRjaCAoZW50cnktPnR5cGUpCisgICAg eworICAgIGNhc2UgcmVjb3JkX3JlZzogLyogcmVnICovCisgICAgICB7Cisg ICAgICAgIGdkYl9ieXRlIHJlZ1tNQVhfUkVHSVNURVJfU0laRV07CisKKyAg ICAgICAgaWYgKHJlY29yZF9kZWJ1ZyA+IDEpCisgICAgICAgICAgZnByaW50 Zl91bmZpbHRlcmVkIChnZGJfc3RkbG9nLAorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgIlByb2Nlc3MgcmVjb3JkOiByZWNvcmRfcmVnICVzIHRv ICIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJpbmZlcmlvciBu dW0gPSAlZC5cbiIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBo b3N0X2FkZHJlc3NfdG9fc3RyaW5nIChlbnRyeSksCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICBlbnRyeS0+dS5yZWcubnVtKTsKKworICAgICAg ICByZWdjYWNoZV9jb29rZWRfcmVhZCAocmVnY2FjaGUsIGVudHJ5LT51LnJl Zy5udW0sIHJlZyk7CisgICAgICAgIHJlZ2NhY2hlX2Nvb2tlZF93cml0ZSAo cmVnY2FjaGUsIGVudHJ5LT51LnJlZy5udW0sIGVudHJ5LT51LnJlZy52YWwp OworICAgICAgICBtZW1jcHkgKGVudHJ5LT51LnJlZy52YWwsIHJlZywgTUFY X1JFR0lTVEVSX1NJWkUpOworICAgICAgfQorICAgICAgYnJlYWs7CisKKyAg ICBjYXNlIHJlY29yZF9tZW06IC8qIG1lbSAqLworICAgICAgeworICAgICAg ICBpZiAoIXJlY29yZF9saXN0LT51Lm1lbS5tZW1fZW50cnlfbm90X2FjY2Vz c2libGUpCisgICAgICAgICAgeworICAgICAgICAgICAgZ2RiX2J5dGUgKm1l bSA9IGFsbG9jYSAoZW50cnktPnUubWVtLmxlbik7CisKKyAgICAgICAgICAg IGlmIChyZWNvcmRfZGVidWcgPiAxKQorICAgICAgICAgICAgICBmcHJpbnRm X3VuZmlsdGVyZWQgKGdkYl9zdGRsb2csCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgIlByb2Nlc3MgcmVjb3JkOiByZWNvcmRfbWVtICVz IHRvICIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiaW5m ZXJpb3IgYWRkciA9ICVzIGxlbiA9ICVkLlxuIiwKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICBob3N0X2FkZHJlc3NfdG9fc3RyaW5nIChl bnRyeSksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGFk ZHJlc3MgKGdkYmFyY2gsIGVudHJ5LT51Lm1lbS5hZGRyKSwKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICByZWNvcmRfbGlzdC0+dS5tZW0u bGVuKTsKKworICAgICAgICAgICAgaWYgKHRhcmdldF9yZWFkX21lbW9yeSAo ZW50cnktPnUubWVtLmFkZHIsIG1lbSwgZW50cnktPnUubWVtLmxlbikpCisg ICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBpZiAoZXhlY3V0aW9u X2RpcmVjdGlvbiA9PSBFWEVDX1JFVkVSU0UpCisgICAgICAgICAgICAgICAg ICB7CisgICAgICAgICAgICAgICAgICAgIHJlY29yZF9saXN0LT51Lm1lbS5t ZW1fZW50cnlfbm90X2FjY2Vzc2libGUgPSAxOworICAgICAgICAgICAgICAg ICAgICBpZiAocmVjb3JkX2RlYnVnKQorICAgICAgICAgICAgICAgICAgICAg IHdhcm5pbmcgKF8oIlByb2Nlc3MgcmVjb3JkOiBlcnJvciByZWFkaW5nIG1l bW9yeSBhdCAiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAi YWRkciA9ICVzIGxlbiA9ICVkLiIpLAorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgIHBhZGRyZXNzIChnZGJhcmNoLCBlbnRyeS0+dS5tZW0uYWRk ciksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZW50cnktPnUu bWVtLmxlbik7CisgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAg ICAgZWxzZQorICAgICAgICAgICAgICAgICAgZXJyb3IgKF8oIlByb2Nlc3Mg cmVjb3JkOiBlcnJvciByZWFkaW5nIG1lbW9yeSBhdCAiCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAiYWRkciA9ICVzIGxlbiA9ICVkLiIpLAorICAg ICAgICAgICAgICAgICAgICAgICAgIHBhZGRyZXNzIChnZGJhcmNoLCBlbnRy eS0+dS5tZW0uYWRkciksCisgICAgICAgICAgICAgICAgICAgICAgICBlbnRy eS0+dS5tZW0ubGVuKTsKKyAgICAgICAgICAgICAgfQorICAgICAgICAgICAg ZWxzZQorICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgaWYgKHRh cmdldF93cml0ZV9tZW1vcnkgKGVudHJ5LT51Lm1lbS5hZGRyLCBlbnRyeS0+ dS5tZW0udmFsLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICBlbnRyeS0+dS5tZW0ubGVuKSkKKyAgICAgICAgICAgICAgICAg IHsKKyAgICAgICAgICAgICAgICAgICAgaWYgKGV4ZWN1dGlvbl9kaXJlY3Rp b24gPT0gRVhFQ19SRVZFUlNFKQorICAgICAgICAgICAgICAgICAgICAgIHsK KyAgICAgICAgICAgICAgICAgICAgICAgIHJlY29yZF9saXN0LT51Lm1lbS5t ZW1fZW50cnlfbm90X2FjY2Vzc2libGUgPSAxOworICAgICAgICAgICAgICAg ICAgICAgICAgaWYgKHJlY29yZF9kZWJ1ZykKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgd2FybmluZyAoXygiUHJvY2VzcyByZWNvcmQ6IGVycm9yIHdy aXRpbmcgbWVtb3J5IGF0ICIKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAiYWRkciA9ICVzIGxlbiA9ICVkLiIpLAorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICBwYWRkcmVzcyAoZ2RiYXJjaCwg ZW50cnktPnUubWVtLmFkZHIpLAorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICBlbnRyeS0+dS5tZW0ubGVuKTsKKyAgICAgICAgICAgICAg ICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAg ICAgICAgICAgICAgICBlcnJvciAoXygiUHJvY2VzcyByZWNvcmQ6IGVycm9y IHdyaXRpbmcgbWVtb3J5IGF0ICIKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAiYWRkciA9ICVzIGxlbiA9ICVkLiIpLAorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICBwYWRkcmVzcyAoZ2RiYXJjaCwgZW50cnktPnUu bWVtLmFkZHIpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVudHJ5 LT51Lm1lbS5sZW4pOworICAgICAgICAgICAgICAgICAgfQorICAgICAgICAg ICAgICB9CisKKyAgICAgICAgICAgIG1lbWNweSAoZW50cnktPnUubWVtLnZh bCwgbWVtLCBlbnRyeS0+dS5tZW0ubGVuKTsKKyAgICAgICAgICB9CisgICAg ICB9CisgICAgICBicmVhazsKKyAgICB9Cit9CisKIHN0YXRpYyB2b2lkCiBy ZWNvcmRfb3BlbiAoY2hhciAqbmFtZSwgaW50IGZyb21fdHR5KQogewpAQCAt NzA4LDUzICs3OTMsOSBAQCByZWNvcmRfd2FpdCAoc3RydWN0IHRhcmdldF9v cHMgKm9wcywKIAkgICAgICBicmVhazsKIAkgICAgfQogCi0JICAvKiBTZXQg cHRpZCwgcmVnaXN0ZXIgYW5kIG1lbW9yeSBhY2NvcmRpbmcgdG8gcmVjb3Jk X2xpc3QuICAqLwotCSAgaWYgKHJlY29yZF9saXN0LT50eXBlID09IHJlY29y ZF9yZWcpCi0JICAgIHsKLQkgICAgICAvKiByZW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VuKTsK LQkgICAgfQotCSAgZWxzZQorCSAgaWYgKHJlY29yZF9saXN0LT50eXBlID09 IHJlY29yZF9lbmQpCiAJICAgIHsKIAkgICAgICBpZiAocmVjb3JkX2RlYnVn ID4gMSkKIAkJZnByaW50Zl91bmZpbHRlcmVkIChnZGJfc3RkbG9nLAo= --00504502cb97525404047034aed1--