Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not crash when encountering empty stack traces #10

Merged
merged 1 commit into from
Jan 3, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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 = "<undefined>";
}
ErrorStatistics errorStatistics = session.getErrorStatistics();
HashMap<String, String> stackTraceAndTargets = errorStatistics.getStackTraceAndTargets();
synchronized (stackTraceAndTargets) {
Expand Down
2 changes: 1 addition & 1 deletion release/cosbench-start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down