Node.js import of a malformed GPX file does not return
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 新手友好度
- 66/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- node.js, typescript
调研方向
Start at ScoreLoader.loadScoreFromBytes and trace how malformed GPX input is parsed; the issue provides a Node.js reproduction that generates the input and compares it with a control case. Run that reproduction and identify where the backward entry causes the import to stop returning. Done means the malformed input returns an import error promptly, while the control case continues to fail promptly as shown.
由索引模型根据 Issue 内容生成。
描述
[!NOTE]
AI-authored disclosure (alphatab-ai-authored-v1)Portions of this content were authored by an AI agent. The agent has read
AGENTS.md and the human submitter accepts responsibility for
compliance with the rules in that document.
Is there an existing issue for this?
- I have searched the existing issues
I have read the contribution rules
- I have read CONTRIBUTING.md and, if any AI agent helped draft this issue, AGENTS.md.
AI authorship
AI-assisted (disclosure block included as described in AGENTS.md)
Current Behavior
In Node.js with alphaTab 1.8.4, ScoreLoader.loadScoreFromBytes does not return or throw for the small malformed GPX input generated below. A parent process terminates the import after 2.5 seconds. The control input returns an import error promptly in the same environment.
This affects callers that import an invalid file synchronously: the call does not yield control back to the application. This report concerns observed import behavior only.
Expected Behavior
Reject the malformed file with an import error and return control to the caller, as the control case does.
Steps To Reproduce
- In a temporary directory, run
npm init -yandnpm install --save-exact @coderline/[email protected]. - Save the following as
repro.cjsin that directory. - Run
node repro.cjs. The script runs each import in a child process and terminates it after 2.5 seconds, so the reproduction itself does not hang indefinitely.
const { spawnSync } = require('node:child_process');
const os = require('node:os');
const alphaTab = require('@coderline/alphatab');
if (process.argv[2]) {
const bytes = Buffer.alloc(4 + 3 * 4096);
bytes.write('BCFS');
if (process.argv[2] === 'backward') {
const entry = 4 + 2 * 4096;
bytes.writeUInt32LE(2, entry);
bytes.write('score.gpif', entry + 4);
bytes.writeUInt32LE(1, entry + 0x8c);
bytes.writeUInt32LE(1, entry + 0x94);
}
console.log('Calling ScoreLoader.loadScoreFromBytes');
try {
alphaTab.importer.ScoreLoader.loadScoreFromBytes(bytes);
console.log('Import returned');
} catch (error) {
console.log('Import threw: ' + error.message);
}
} else {
alphaTab.Environment.printEnvironmentInfo();
console.log(`Node ${process.version}; ${os.type()} ${os.release()}; ${os.arch()}`);
for (const mode of ['control', 'backward']) {
const result = spawnSync(process.execPath, [__filename, mode], {
timeout: 2500,
encoding: 'utf8',
maxBuffer: 1024 * 1024
});
console.log(`--- ${mode} ---`);
process.stdout.write(result.stdout || '');
process.stderr.write(result.stderr || '');
console.log(`status=${result.status}; signal=${result.signal}; error=${result.error?.code || 'none'}`);
}
}
Observed output after the environment details:
--- control ---
Calling ScoreLoader.loadScoreFromBytes
Import threw: No compatible importer found for file
status=0; signal=null; error=none
--- backward ---
Calling ScoreLoader.loadScoreFromBytes
status=null; signal=SIGTERM; error=ETIMEDOUT
Link to jsFiddle, CodePen, Project
The complete reproduction and input generator are included above; no application repository or external score file is required.
Version and Environment
Actual output from alphaTab.Environment.printEnvironmentInfo(), followed by Node.js and operating-system information from the reproduction:
[AlphaTab][VersionInfo] alphaTab 1.8.4
[AlphaTab][VersionInfo] commit: 022a45c8e42370f9e12e68949d11eada370da83d
[AlphaTab][VersionInfo] build date: 2026-07-05T14:46:18.224Z
[AlphaTab][VersionInfo] High DPI: 1
[AlphaTab][VersionInfo] Platform: NodeJs
[AlphaTab][VersionInfo] WebPack: false
[AlphaTab][VersionInfo] Vite: false
Node v26.12.0; Darwin 27.0.0; arm64
Platform
Node.js
Anything else?
The sample is intentionally malformed and generated entirely by the script. This has been reproduced with the released npm package version shown above. Other versions and platforms have not been tested.
- 主要语言
- TypeScript
- 星标
- 1.9k
- 派生
- 297
- 平均合并
- 9 小时 2 分钟
- 30 天内合并 PR
- 44
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
CoderLine/alphaTab 的其他 Issue
-
ai-authored
难度 2/5 1-3 小时 新手友好度 69/100
维护者通常 1 天内回复
-
Respect systems layout of MusicXML可能已有人在做 @Danielku15 于 18 天前认领。 未关闭
CoderLine/alphaTab#2909 · 已指派 1 人 ·
维护者通常 1 天内回复
-
Expose Lyrics in public api可能已有人在做 @Danielku15 于 18 天前认领。 未关闭
CoderLine/alphaTab#2908 · 已指派 1 人 ·
维护者通常 1 天内回复
-
Show accentuations on tab-only staves可能已有人在做 @Danielku15 于 18 天前认领。 未关闭
CoderLine/alphaTab#2906 · 1 条评论 · 已指派 1 人 ·
维护者通常 1 天内回复
-
Support tuning alterations可能已有人在做 @kulek1 于 70 天前认领。 未关闭
难度 4/5 3-5 天 新手友好度 35/100
维护者通常 1 天内回复
查看 CoderLine/alphaTab 的全部 Issue
相似的 Issue
-
[Bug]: REST API URL starting with "http" but no scheme (e.g. httpbin.org/get) is not given an http:// prefix可能已有人在做 @ItsDeadlyProgrammer 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 68/100
appsmithorg/appsmith#42471 · 1 条评论 ·
维护者通常 2 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
ehmpathy/rhachet-roles-bhrain#705 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 82/100
维护者通常 1 天内回复
-
Status: Triage
难度 2/5 1-3 小时 新手友好度 76/100
mermaid-js/mermaid#8546 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
braintrustdata/braintrust-sdk-javascript#2659 ·
维护者通常 1 天内回复