fix(crash): JVM_32BIT pattern.

This commit is contained in:
huanghongxun 2021-10-10 21:18:19 +08:00
parent 5f98c8c8bb
commit fca78cf419
2 changed files with 9 additions and 9 deletions

View File

@ -430,16 +430,21 @@ public final class LauncherHelper {
} }
} }
if (javaVersion.getPlatform() != Architecture.CURRENT.getPlatform()) {
Controllers.dialog(i18n("launch.advice.different_platform"), i18n("message.warning"), MessageType.ERROR, continueAction);
suggested = true;
}
// 32-bit JVM cannot make use of too much memory. // 32-bit JVM cannot make use of too much memory.
if (javaVersion.getPlatform() == org.jackhuang.hmcl.util.platform.Platform.BIT_32 && if (javaVersion.getPlatform() == org.jackhuang.hmcl.util.platform.Platform.BIT_32 &&
setting.getMaxMemory() > 1.5 * 1024) { setting.getMaxMemory() > 1.5 * 1024) {
// 1.5 * 1024 is an inaccurate number. // 1.5 * 1024 is an inaccurate number.
// Actual memory limit depends on operating system and memory. // Actual memory limit depends on operating system and memory.
Controllers.confirm(i18n("launch.advice.too_large_memory_for_32bit"), i18n("message.error"), continueAction, null); Controllers.confirm(i18n("launch.advice.too_large_memory_for_32bit"), i18n("message.error"), continueAction, breakAction);
return null; suggested = true;
} }
if (violatedSuggestedConstraint != null) { if (!suggested && violatedSuggestedConstraint != null) {
suggested = true; suggested = true;
switch (violatedSuggestedConstraint) { switch (violatedSuggestedConstraint) {
case MODDED_JAVA_7: case MODDED_JAVA_7:
@ -454,11 +459,6 @@ public final class LauncherHelper {
} }
} }
if (!suggested && javaVersion.getPlatform() != Architecture.CURRENT.getPlatform()) {
Controllers.dialog(i18n("launch.advice.different_platform"), i18n("message.warning"), MessageType.ERROR, continueAction);
suggested = true;
}
// Cannot allocate too much memory exceeding free space. // Cannot allocate too much memory exceeding free space.
if (!suggested && OperatingSystem.TOTAL_MEMORY > 0 && OperatingSystem.TOTAL_MEMORY < setting.getMaxMemory()) { if (!suggested && OperatingSystem.TOTAL_MEMORY > 0 && OperatingSystem.TOTAL_MEMORY < setting.getMaxMemory()) {
Controllers.confirm(i18n("launch.advice.not_enough_space", OperatingSystem.TOTAL_MEMORY), i18n("message.error"), continueAction, null); Controllers.confirm(i18n("launch.advice.not_enough_space", OperatingSystem.TOTAL_MEMORY), i18n("message.error"), continueAction, null);

View File

@ -37,7 +37,7 @@ public final class CrashReportAnalyzer {
OPENJ9(Pattern.compile("(Open J9 is not supported|OpenJ9 is incompatible)")), OPENJ9(Pattern.compile("(Open J9 is not supported|OpenJ9 is incompatible)")),
TOO_OLD_JAVA(Pattern.compile("java\\.lang\\.UnsupportedClassVersionError: (.*?) version (?<expected>\\d+)\\.0"), "expected"), TOO_OLD_JAVA(Pattern.compile("java\\.lang\\.UnsupportedClassVersionError: (.*?) version (?<expected>\\d+)\\.0"), "expected"),
JVM_32BIT(Pattern.compile("Could not reserve enough space for 1048576KB object heap")), JVM_32BIT(Pattern.compile("Could not reserve enough space for (.*?) object heap")),
// Some mods/shader packs do incorrect GL operations. // Some mods/shader packs do incorrect GL operations.
GL_OPERATION_FAILURE(Pattern.compile("1282: Invalid operation")), GL_OPERATION_FAILURE(Pattern.compile("1282: Invalid operation")),