From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15906 invoked by alias); 16 May 2009 00:33:42 -0000 Received: (qmail 15894 invoked by uid 22791); 16 May 2009 00:33:40 -0000 X-SWARE-Spam-Status: No, hits=-2.2 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_33,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mx2.redhat.com (HELO mx2.redhat.com) (66.187.237.31) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sat, 16 May 2009 00:33:34 +0000 Received: from int-mx2.corp.redhat.com (int-mx2.corp.redhat.com [172.16.27.26]) by mx2.redhat.com (8.13.8/8.13.8) with ESMTP id n4G0XWrj032532 for ; Fri, 15 May 2009 20:33:32 -0400 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx2.corp.redhat.com (8.13.1/8.13.1) with ESMTP id n4G0XVZU023487; Fri, 15 May 2009 20:33:31 -0400 Received: from localhost.localdomain (vpn-12-130.rdu.redhat.com [10.11.12.130]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id n4G0XUmt004312; Fri, 15 May 2009 20:33:30 -0400 Date: Sat, 16 May 2009 00:33:00 -0000 From: Kevin Buettner To: sid@sourceware.org Subject: [RFA] Avoid write queue overflow in mep.cxx Message-ID: <20090515173329.750f156b@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Mailing-List: contact sid-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: sid-owner@sourceware.org X-SW-Source: 2009-q2/txt/msg00008.txt.bz2 It's not uncommon for certain test cases in the GDB test suite to connect to sid and then disconnect without executing anything. If this happens enough times in a row, the invocations of mep_cpu::reset will cause the write queues to overflow into some other data structure, eventually causing a SIGSEGV. The patch below fixes this problem. Okay? * mep.cxx (mep_cpu::reset): Call `h_regs_flush_write_queue'. Index: mep.cxx =================================================================== RCS file: /cvs/src/src/sid/component/cgen-cpu/mep/mep.cxx,v retrieving revision 1.3 diff -u -p -r1.3 mep.cxx --- mep.cxx 30 Apr 2009 21:18:37 -0000 1.3 +++ mep.cxx 16 May 2009 00:21:38 -0000 @@ -413,6 +413,8 @@ mep_cpu::reset () repeat_delayed_branch = false; bit_insn_p = false; + h_regs_flush_write_queue (); + // Clear general purpose registers. for (int i = 0; i < 16; i++) h_gpr_set (i, 0);