This is the mail archive of the sid@sourceware.org mailing list for the SID project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[RFA] Avoid write queue overflow in mep.cxx


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]