Skip to content

Commit

Permalink
Update vm recursion error logs and defaults to match current env (#1147)
Browse files Browse the repository at this point in the history
* Update vm recursion error logs and defaults to match current env

* Revert to Xss2m for default run

* Update xss recommendations
  • Loading branch information
zilm13 authored and mkalinin committed Aug 6, 2018
1 parent 7f341b0 commit baf1c7d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion ethereumj-core/src/main/java/org/ethereum/vm/VM.java
Original file line number Diff line number Diff line change
Expand Up @@ -1326,7 +1326,7 @@ public void play(Program program) {
} catch (RuntimeException e) {
program.setRuntimeFailure(e);
} catch (StackOverflowError soe){
logger.error("\n !!! StackOverflowError: update your java run command with -Xss2M !!!\n", soe);
logger.error("\n !!! StackOverflowError: update your java run command with -Xss2M (-Xss4M for tests) !!!\n", soe);
System.exit(-1);
} finally {
callVmHookAction(program, VMHook::stopPlay);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,8 +154,13 @@ private static List<DataWord> randomDataWords(int count) {
}

private static InternalTransaction randomInternalTransaction(Transaction parent, int deep, int index) {
return new InternalTransaction(parent.getHash(), deep, index, randomBytes(1), DataWord.ZERO, DataWord.ZERO,
parent.getReceiveAddress(), randomBytes(20), randomBytes(2), randomBytes(64), "test note");
try {
return new InternalTransaction(parent.getHash(), deep, index, randomBytes(1), DataWord.ZERO, DataWord.ZERO,
parent.getReceiveAddress(), randomBytes(20), randomBytes(2), randomBytes(64), "test note");
} catch (StackOverflowError e) {
System.out.println("\n !!! StackOverflowError: update your java run command with -Xss8M !!!\n");
throw e;
}
}

private static List<InternalTransaction> randomInternalTransactions(Transaction parent, int nestedLevelCount, int countByLevel) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ protected ProgramResult executeTransaction(Transaction tx) {
executor.go();
executor.finalization();
} catch (StackOverflowError soe){
logger.error(" !!! StackOverflowError: update your java run command with -Xss2M !!!");
logger.error(" !!! StackOverflowError: update your java run command with -Xss4M !!!");
System.exit(-1);
}

Expand Down

0 comments on commit baf1c7d

Please sign in to comment.