[RFA] Avoid write queue overflow in mep.cxx

Kevin Buettner kevinb@redhat.com
Sat May 16 00:33:00 GMT 2009


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



More information about the Sid mailing list