Skip to content

导出崩溃日志时附带崩溃报告文件 - #4103

Closed
zkitefly wants to merge 9 commits into
HMCL-dev:mainfrom
zkitefly:input-box-fix
Closed

导出崩溃日志时附带崩溃报告文件#4103
zkitefly wants to merge 9 commits into
HMCL-dev:mainfrom
zkitefly:input-box-fix

Conversation

@zkitefly

@zkitefly zkitefly commented Jul 22, 2025

Copy link
Copy Markdown
Member

Close #4101

minecraft-exported-crash-info-2025-07-25T01-59-14.zip

=== HMCL Game Crash Report ===
Generation Time: 2025-07-25T01-59-14
Exit Type: APPLICATION_ERROR

== HMCL Information ==
HMCL Version: 3.6.SNAPSHOT
Current Directory: /media/zkitefly/500/github/HMCL
HMCL Global Directory: /home/zkitefly/.local/share/hmcl
HMCL Current Directory: /media/zkitefly/500/github/HMCL/.hmcl
HMCL Jar Path: /media/zkitefly/500/github/HMCL/HMCL/build/libs/HMCL-3.6.SNAPSHOT.jar
HMCL Log File: /media/zkitefly/500/github/HMCL/.hmcl/logs/2025-07-25T01-58-55.log
JVM Max Memory: 1970 MiB
Java Architecture: x86-64
Java Version: 24.0.2, BellSoft
Java VM Version: OpenJDK 64-Bit Server VM (mixed mode, sharing), BellSoft
Java Home: /usr/lib/jvm/bellsoft-java24-amd64

== System Information ==
Operating System: Ubuntu 24.04.2 LTS (Linux 6.14.0-24-generic)
System Architecture: x86-64
Native Encoding: UTF-8
JNU Encoding: UTF-8
XDG Session Type: x11
XDG Current Desktop: ubuntu:GNOME
Total Memory: 7873.54 MiB

== Hardware Information ==
CPU: Intel Core i5-6500 (4 Cores)
GPU: Intel HD Graphics 530 [Discrete]
Memory: 6.42 GiB / 7.69 GiB (83%)

== Java Information ==
Game Java Version: 1.8.0_462
Game Java Path: /home/zkitefly/.local/share/hmcl/java/linux-x86_64/zulu-8.0.462-jre/bin/java
Game Min Memory: null
Game Max Memory: 1920

== Game Information ==
Game Version: 1.4.2
IsModpack: false
Game RunDirectory: /media/zkitefly/500/minecraft/.minecraft
Game VersionJson: /media/zkitefly/500/minecraft/.minecraft/versions/1.4.2/1.4.2.json
Game VersionJar: /media/zkitefly/500/minecraft/.minecraft/versions/1.4.2/1.4.2.jar
Game AssetDirectory: /media/zkitefly/500/minecraft/.minecraft/assets/virtual/pre-1.6
Game AssetIndexUrl: https://launchermeta.mojang.com/v1/packages/3d8e55480977e32acd9844e545177e69a52f594b/pre-1.6.json
Game MainClass: net.minecraft.launchwrapper.Launch
ServerIP: 
EnvironmentVariables: {}
Fullscreen: false
WindowWidth: 854
WindowHeight: 480
PreLaunchCommand: 
PostExitCommand: 
isUseNativeOpenAL: false
isUseNativeGLFW: false

== Available Java Runtimes ==
JDK 24.0.2 (x86-64, BellSoft): /usr/lib/jvm/bellsoft-java24-amd64/bin/java
JDK 21.0.8 (x86-64, BellSoft): /usr/lib/jvm/bellsoft-java21-full-amd64/bin/java
JRE 1.8.0_462 (x86-64, Azul Systems, Inc.): /home/zkitefly/.local/share/hmcl/java/linux-x86_64/zulu-8.0.462-jre/bin/java
JRE 17.0.15 (x86-64, Ubuntu): /usr/lib/jvm/java-17-openjdk-amd64/bin/java

== Mod Loader Information ==
game: 1.4.2

== HMCL Crash Analysis ==
原因未知。请点击日志按钮查看详细信息。


== Game Mod Directory Structure ==
Filesystem structure of: /media/zkitefly/500/minecraft/.minecraft/mods
| <nonexistent path>


== Game Resourcepacks Directory Structure ==
Filesystem structure of: /media/zkitefly/500/minecraft/.minecraft/resourcepacks
| <nonexistent path>


== Game Shaderpacks Directory Structure ==
Filesystem structure of: /media/zkitefly/500/minecraft/.minecraft/shaderpacks
| <nonexistent path>


== Game Config Directory Structure ==
Filesystem structure of: /media/zkitefly/500/minecraft/.minecraft/config
| <nonexistent path>

@burningtnt

Copy link
Copy Markdown
Member

不要把这一内容塞入 String 中。未来我们将降低分配给 HMCL 的最低内存,这将非常容易 OOM

@zkitefly

Copy link
Copy Markdown
Member Author

不要把这一内容塞入 String 中。未来我们将降低分配给 HMCL 的最低内存,这将非常容易 OOM

换成 BufferedWriter 了

@burningtnt burningtnt left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

为什么要先把数据写进临时文件,再拷贝进入压缩包?完全可以直接将数据写入压缩包!

Glavo added 2 commits October 22, 2025 21:29
# Conflicts:
#	HMCL/src/main/java/org/jackhuang/hmcl/game/LogExporter.java
#	HMCL/src/main/java/org/jackhuang/hmcl/ui/GameCrashWindow.java
alert = new Alert(Alert.AlertType.INFORMATION, i18n("settings.launcher.launcher_log.export.success", logFile));
String time = LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH-mm-ss"));
Path logFile = Paths.get("minecraft-exported-crash-info-" + time + ".zip").toAbsolutePath();
Path crashReportFile;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

我没看懂这里到底在干什么,为什么不在 LogExporter 里直接生成日志到最终文件,而是在 GameCrashWindow 里实现,还要倒腾一个临时文件。

@zkitefly

Copy link
Copy Markdown
Member Author

介于写的实在太史,我先关了吧

@zkitefly zkitefly closed this Oct 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature] 导出崩溃信息时,将硬件和本次启动游戏的信息单独导出至一个文件

3 participants