diff --git a/dev/cosbench-driver/src/com/intel/cosbench/driver/operator/AbstractOperator.java b/dev/cosbench-driver/src/com/intel/cosbench/driver/operator/AbstractOperator.java index d985ca2c..4fb8b470 100644 --- a/dev/cosbench-driver/src/com/intel/cosbench/driver/operator/AbstractOperator.java +++ b/dev/cosbench-driver/src/com/intel/cosbench/driver/operator/AbstractOperator.java @@ -114,8 +114,15 @@ protected static void doLogErr(Logger logger, String message, Exception e) { protected abstract void operate(int idx, int all, Session session); public static void errorStatisticsHandle(Exception e, Session session, String target){ - String trace = e.getStackTrace()[0].toString(); - trace = e.getCause() == null ? trace : trace + e.getCause().getStackTrace()[0].toString(); + String trace = null; + try { + trace = e.getStackTrace()[0].toString(); + trace = e.getCause() == null ? trace : trace + e.getCause().getStackTrace()[0].toString(); + } catch (ArrayIndexOutOfBoundsException ignored) { + LOGGER.debug("Got an error with an empty stack trace. " + + "Run the driver with -XX:-OmitStackTraceInFastThrow to prevent this.", e); + trace = ""; + } ErrorStatistics errorStatistics = session.getErrorStatistics(); HashMap stackTraceAndTargets = errorStatistics.getStackTraceAndTargets(); synchronized (stackTraceAndTargets) { diff --git a/release/cosbench-start.sh b/release/cosbench-start.sh index c148f594..94e6c6d6 100755 --- a/release/cosbench-start.sh +++ b/release/cosbench-start.sh @@ -43,7 +43,7 @@ mkdir -p log echo "Launching osgi framwork ... " -/usr/bin/nohup java -Dcosbench.tomcat.config=$TOMCAT_CONFIG -server -cp main/* org.eclipse.equinox.launcher.Main -configuration $OSGI_CONFIG -console $OSGI_CONSOLE_PORT 1> $BOOT_LOG 2>&1 & +/usr/bin/nohup java -XX:-OmitStackTraceInFastThrow -Dcosbench.tomcat.config=$TOMCAT_CONFIG -server -cp main/* org.eclipse.equinox.launcher.Main -configuration $OSGI_CONFIG -console $OSGI_CONSOLE_PORT 1> $BOOT_LOG 2>&1 & if [ $? -ne 0 ]; then