[Bug] 加载实例清单中 id 包含在当前环境下非法字符的实例时会导致启动器崩溃
Open
Nobody has claimed this yet.
bug
- Dominant language
- Java
- Stars
- 10.1k
- Forks
- 934
- Avg merge
- 1d 5h
- Merged PRs (30d)
- 82
Description
问题描述 | Bug Description
同 #6540
例如 “:” 在 Windows 下是非法字符,在 Windows 下加载实例清单中 id 带 ":" 的实例会导致启动器崩溃。理想状态应为跳过加载该实例,启动器正常运行。
https://github.com/HMCL-dev/HMCL/commit/116629743e87db0a1fcc6155d1d86e9a8738c31f 并没有解决此问题。
启动器崩溃报告 / 启动器日志文件 | Launcher Crash Report / Launcher Log File
---- Hello Minecraft! Crash Report ----
Version: 3.17.233
Time: 2026-08-20 21:37:47
Thread: Thread[#48,JavaFX Application Thread,5,main]
Content:
java.nio.file.InvalidPathException: Illegal char <:> at index 3: 1.3:1
at java.base/sun.nio.fs.WindowsPathParser.normalize(WindowsPathParser.java:186)
at java.base/sun.nio.fs.WindowsPathParser.parse(WindowsPathParser.java:142)
at java.base/sun.nio.fs.WindowsPathParser.parse(WindowsPathParser.java:46)
at java.base/sun.nio.fs.WindowsPath.parse(WindowsPath.java:95)
at java.base/sun.nio.fs.WindowsFileSystem.getPath(WindowsFileSystem.java:203)
at java.base/java.nio.file.Path.resolve(Path.java:513)
at org.jackhuang.hmcl.game.DefaultGameRepositoryLayout.getInstanceRoot(DefaultGameRepositoryLayout.java:54)
at org.jackhuang.hmcl.game.DefaultGameRepositoryLayout.getInstanceJarFile(DefaultGameRepositoryLayout.java:70)
at org.jackhuang.hmcl.game.DefaultGameInstance.getInstanceJarFile(DefaultGameInstance.java:271)
at org.jackhuang.hmcl.game.DefaultGameInstance.detectVersion(DefaultGameInstance.java:222)
at org.jackhuang.hmcl.game.DefaultGameInstance.getVersion(DefaultGameInstance.java:184)
at org.jackhuang.hmcl.game.DefaultGameInstance.getAnalyzer(DefaultGameInstance.java:171)
at org.jackhuang.hmcl.game.GameInstance.getModLoaders(GameInstance.java:80)
at org.jackhuang.hmcl.game.HMCLGameInstance$WeakCachedIconImageProperty.computeIconImage(HMCLGameInstance.java:470)
at org.jackhuang.hmcl.game.HMCLGameInstance$WeakCachedIconImageProperty.get(HMCLGameInstance.java:444)
at org.jackhuang.hmcl.game.HMCLGameInstance$WeakCachedIconImageProperty.get(HMCLGameInstance.java:423)
at javafx.base@25/javafx.beans.binding.ObjectExpression.getValue(ObjectExpression.java:51)
at javafx.base@25/com.sun.javafx.binding.ExpressionHelper.addListener(ExpressionHelper.java:79)
at javafx.base@25/javafx.beans.property.ReadOnlyObjectPropertyBase.addListener(ReadOnlyObjectPropertyBase.java:64)
at org.jackhuang.hmcl.ui.instances.GameAdvancedListItem.loadInstance(GameAdvancedListItem.java:63)
at org.jackhuang.hmcl.ui.FXUtils.onWeakChangeAndOperate(FXUtils.java:287)
at org.jackhuang.hmcl.ui.instances.GameAdvancedListItem.<init>(GameAdvancedListItem.java:53)
at org.jackhuang.hmcl.ui.main.RootPage$Skin.<init>(RootPage.java:120)
at org.jackhuang.hmcl.ui.main.RootPage.createDefaultSkin(RootPage.java:74)
at org.jackhuang.hmcl.ui.main.RootPage.createDefaultSkin(RootPage.java:59)
at javafx.controls@25/javafx.scene.control.Control.doProcessCSS(Control.java:910)
at javafx.controls@25/javafx.scene.control.Control$1.doProcessCSS(Control.java:88)
at javafx.controls@25/com.sun.javafx.scene.control.ControlHelper.processCSSImpl(ControlHelper.java:68)
at javafx.graphics@25/com.sun.javafx.scene.NodeHelper.processCSS(NodeHelper.java:134)
at javafx.graphics@25/javafx.scene.Parent.doProcessCSS(Parent.java:1468)
at javafx.graphics@25/javafx.scene.Parent$1.doProcessCSS(Parent.java:126)
at javafx.graphics@25/com.sun.javafx.scene.ParentHelper.processCSSImpl(ParentHelper.java:98)
at javafx.graphics@25/com.sun.javafx.scene.NodeHelper.processCSS(NodeHelper.java:134)
at javafx.graphics@25/javafx.scene.Parent.doProcessCSS(Parent.java:1468)
at javafx.graphics@25/javafx.scene.Parent$1.doProcessCSS(Parent.java:126)
at javafx.graphics@25/com.sun.javafx.scene.ParentHelper.processCSSImpl(ParentHelper.java:98)
at javafx.graphics@25/com.sun.javafx.scene.NodeHelper.processCSS(NodeHelper.java:134)
at javafx.graphics@25/javafx.scene.Parent.doProcessCSS(Parent.java:1468)
at javafx.graphics@25/javafx.scene.Parent$1.doProcessCSS(Parent.java:126)
at javafx.graphics@25/com.sun.javafx.scene.ParentHelper.processCSSImpl(ParentHelper.java:98)
at javafx.graphics@25/com.sun.javafx.scene.NodeHelper.processCSS(NodeHelper.java:134)
at javafx.graphics@25/javafx.scene.Parent.doProcessCSS(Parent.java:1468)
at javafx.graphics@25/javafx.scene.Parent$1.doProcessCSS(Parent.java:126)
at javafx.graphics@25/com.sun.javafx.scene.ParentHelper.processCSSImpl(ParentHelper.java:98)
at javafx.graphics@25/com.sun.javafx.scene.NodeHelper.processCSS(NodeHelper.java:134)
at javafx.graphics@25/javafx.scene.Parent.doProcessCSS(Parent.java:1468)
at javafx.graphics@25/javafx.scene.Parent$1.doProcessCSS(Parent.java:126)
at javafx.graphics@25/com.sun.javafx.scene.ParentHelper.processCSSImpl(ParentHelper.java:98)
at javafx.graphics@25/com.sun.javafx.scene.NodeHelper.processCSS(NodeHelper.java:134)
at javafx.graphics@25/javafx.scene.Parent.doProcessCSS(Parent.java:1468)
at javafx.graphics@25/javafx.scene.Parent$1.doProcessCSS(Parent.java:126)
at javafx.graphics@25/com.sun.javafx.scene.ParentHelper.processCSSImpl(ParentHelper.java:98)
at javafx.graphics@25/com.sun.javafx.scene.NodeHelper.processCSS(NodeHelper.java:134)
at javafx.graphics@25/javafx.scene.Node.processCSS(Node.java:9999)
at javafx.graphics@25/javafx.scene.Scene.doCSSPass(Scene.java:621)
at javafx.graphics@25/javafx.scene.Scene.preferredSize(Scene.java:1843)
at javafx.graphics@25/javafx.scene.Scene$2.preferredSize(Scene.java:429)
at javafx.graphics@25/com.sun.javafx.scene.SceneHelper.preferredSize(SceneHelper.java:73)
at javafx.graphics@25/javafx.stage.Window$7.invalidated(Window.java:1088)
at javafx.base@25/javafx.beans.property.BooleanPropertyBase.markInvalid(BooleanPropertyBase.java:110)
at javafx.base@25/javafx.beans.property.BooleanPropertyBase.set(BooleanPropertyBase.java:145)
at javafx.graphics@25/javafx.stage.Window.setShowing(Window.java:1164)
at javafx.graphics@25/javafx.stage.Window.show(Window.java:1179)
at javafx.graphics@25/javafx.stage.Stage.show(Stage.java:295)
at org.jackhuang.hmcl.Launcher.lambda$start$0(Launcher.java:146)
at javafx.graphics@25/com.sun.javafx.application.PlatformImpl.lambda$runLater$0(PlatformImpl.java:424)
at javafx.graphics@25/com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)
at javafx.graphics@25/com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
at javafx.graphics@25/com.sun.glass.ui.win.WinApplication.lambda$runLoop$0(WinApplication.java:168)
at java.base/java.lang.Thread.run(Thread.java:1474)
-- System Details --
Operating System: Windows 11 26H2 10.0.26340.9212
System Architecture: x86-64
Java Architecture: x86-64
Java Version: 25.0.4, JetBrains s.r.o.
Java VM Version: OpenJDK 64-Bit Server VM (mixed mode, sharing), JetBrains s.r.o.
JVM Max Memory: 1073741824
JVM Total Memory: 115343360
JVM Free Memory: 46642336
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with DefaultGameRepositoryLayout.java at line 54, then trace the calls through DefaultGameInstance and GameAdvancedListItem shown in the crash report. Reproduce loading an instance whose ID contains “:” on Windows and check the existing handling referenced by issue #6540. Done means the invalid instance is skipped and the launcher continues running.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- desktop, operating-systems
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 67/100