[RFA] Avoid write queue overflow in mep.cxx

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[RFA] Avoid write queue overflow in mep.cxx

Kevin Buettner
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);

Reply | Threaded
Open this post in threaded view
|

Re: [RFA] Avoid write queue overflow in mep.cxx

Kevin Buettner
On Fri, 15 May 2009 17:33:29 -0700
Kevin Buettner <[hidden email]> wrote:

> * mep.cxx (mep_cpu::reset): Call `h_regs_flush_write_queue'.

Committed.  (FChE approved it off-list.)

Kevin