From 7767b03bae50653c01b41063d9cbc293f9c37a8a Mon Sep 17 00:00:00 2001 From: fros4943 Date: Wed, 3 Dec 2008 15:38:01 +0000 Subject: [PATCH] parsing currently used exception for bad memory access by MSPSim --- tools/cooja/java/se/sics/cooja/Simulation.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/tools/cooja/java/se/sics/cooja/Simulation.java b/tools/cooja/java/se/sics/cooja/Simulation.java index 6e3ee1f8a..3d7edc9f9 100644 --- a/tools/cooja/java/se/sics/cooja/Simulation.java +++ b/tools/cooja/java/se/sics/cooja/Simulation.java @@ -24,7 +24,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $Id: Simulation.java,v 1.29 2008/11/03 18:09:43 fros4943 Exp $ + * $Id: Simulation.java,v 1.30 2008/12/03 15:38:01 fros4943 Exp $ */ package se.sics.cooja; @@ -221,7 +221,13 @@ public class Simulation extends Observable implements Runnable { } catch (IllegalMonitorStateException e) { logger.warn("IllegalMonitorStateException:" + e); } catch (RuntimeException e) { - logger.warn("Simulation stop requested: " + e); + if (e.getClass().getName().contains("IllegalStateException")) { /* XXX Change exception type */ + /* MSPSim memory alignment exception */ + logger.fatal("MSPSim detected memory alignment error: " + e); + } else { + logger.warn("Simulation stopped for unknown reason: " + e); + e.printStackTrace(); + } } isRunning = false; thread = null;