From mboxrd@z Thu Jan 1 00:00:00 1970 From: Yosuke Iwamatsu Subject: [PATCH] Xentrace: Avoid Crash on Debug Build Xen Date: Tue, 09 Oct 2007 10:47:30 +0900 Message-ID: <470ADDB2.3030008@ab.jp.nec.com> References: <47059954.8010009@ab.jp.nec.com> <200710051721.06604.mark.williamson@cl.cam.ac.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <200710051721.06604.mark.williamson@cl.cam.ac.uk> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Mark Williamson Cc: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org Mark Williamson wrote: > } > total_size += LOST_REC_SIZE; > } > - > - ASSERT(bytes_to_wrap == calc_bytes_to_wrap(buf)); > > if ( rec_size > bytes_to_wrap ) > { > @@ -484,8 +482,6 @@ void __trace_var(u32 event, int cycles, > insert_lost_records(buf); > } > > - ASSERT(bytes_to_wrap == calc_bytes_to_wrap(buf)); > - > >> Current xen-unstable (debug build) crashes when using xentrace command, >> due to assertion failures. It seems assertion failures occur whenever >> there exist lost records, and I don't see much reason to do this. >> (Could anyone explain about these ASSERT lines ?) > > These asserts appear to have originally been checking that bytes_to_wrap is > being calculated correctly... It looks to me that the first assert > isoutdated though, because it clearly will fail if a record is lost. > > Perhaps the second one ought to succed though, since the value of buf->prod > will have been appropriately updated by insert_lost_records()? Indeed the second assert seems to always succeed. > > Cheers, > Mark > >> The attached patch removes assertions to avoid system crashes, >> and also fixes a mistake of an assignment statement. >> >> Regards, >> ------------------- >> Yosuke Iwamatsu >> NEC Corporation > > >