musescore / musescore/MuseScore
MuseScore 4 fails to export parts via JSON batch export – segmentation fault or no output
@cbjeukendrup is already working on this.
Since May 9, 2025.
- Dominant language
- C++
- Stars
- 15.1k
- Forks
- 3.3k
- Avg merge
- 2d 2h
- Merged PRs (30d)
- 91
Description
Issue type
Import/export issue
Description with steps to reproduce
When exporting .mscz files using the -j batch export option in MuseScore 4, the expected output (full score + individual parts as PDFs) is either not created at all or causes a segmentation fault.
This issue occurs across all MuseScore 4.x versions tested, including the latest release and a current nightly build.
In contrast, MuseScore 3.6.2 performs the same operation correctly.
Expected behavior
MuseScore should export:
testfile.pdf(full score)testfile_Tenor.pdfandtestfile_Bass.pdf(individual parts)
using the following export_job.json:
[
{
"in": "./testfile.mscz",
"out": [
"testfile.pdf",
["testfile_", ".pdf"]
]
}
]
Command
musescore.AppImage -j export_job.json
How to create the test files
Create in MuseScore v3.6.2
- File → New…
- Enter title:
v3.6.2 - Choose Instruments
- Vocals - Tenor
- Vocals - Bass
- Finish
- File → Parts…
- All parts
- OK
- File → Save as…
- Filename:
v3.6.mscz - Save
Create in MuseScore v4.0.0
- File → New…
- Choose Instruments
- Vocals - Tenor
- Vocals - Bass
- Done
- File → Save as…
- Filename:
v4.0.0.mscz - Save
Convert to MuseScore v4.0.0
- Open test file
v3.6.msczwith MuseScore v4.0.0 - Change title to:
3t4 - File → Save as…
- Filename:
3to4.mscz - Save
Results summary
| MuseScore Version | v3.6.2.mscz |
v4.0.0.mscz |
3to4.mscz |
|---|---|---|---|
| MuseScore 3.6.2 | ✅ Full + Parts (OK) | ||
| MuseScore 4.0.0 | ❌ No files | ||
| MuseScore 4.1.1 | ❌ No files | ||
| MuseScore 4.2.1 | ❌ No files | ||
| MuseScore 4.3.2 | ❌ No files | ||
| MuseScore 4.4.4 | ❌ No files | ❌ No files | ❌ No files |
| MuseScore 4.5.2 | ❌ Segfault | ❌️ Segfault | ⚠ Full OK + Parts blank |
| MuseScore Nightly | ❌️ Segfault | ⚠️ Full OK + Parts missing | ❌️ Segfault |
Environment
- Ubuntu 22.04 (headless CI: GitHub Actions)
- Dependencies installed:
xvfb,libfuse2,libegl1,libopengl0,libjack-jackd2-0 - MuseScore AppImages used as CLI tools
Additional information
- MuseScore 3.6.2 handles the export job as expected
- MuseScore 4 fails silently or crashes with:
QEventLoop: Cannot be used without QApplication
Environment
- Ubuntu 22.04 headless
- GitHub Actions
.github\workflows\convert.yml
name: Convert MuseScore files to PDF
on:
push:
jobs:
convert:
runs-on: ubuntu-22.04
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Install dependencies (xvfb + wget + libfuse + OpenGL + JACK)
run: |
sudo apt-get update
sudo apt-get install -y \
xvfb wget libfuse2 \
libegl1 libopengl0 libjack-jackd2-0
- name: Download MuseScore AppImage
run: |
wget -q https://ftp.osuosl.org/pub/musescore-nightlies/linux/4x/nightly/MuseScore-Studio-Nightly-251280318-master-3b25461-x86_64.AppImage -O musescore.AppImage
chmod +x musescore.AppImage
- name: Convert .mscz/.mscx to PDF (Parts)
run: |
find . -name '*.mscz' | while read file; do
name=$(basename "$file")
name_no_ext="${name%.*}"
echo "[
{
\"in\": \"$file\",
\"out\": [
\"${name_no_ext}.pdf\",
[\"${name_no_ext}_\", \".pdf\"]
]
}
]" > export_job.json
echo "::group::export_job.json"
cat export_job.json
echo "::endgroup::"
export QT_LOGGING_RULES="qt.qml.typeregistration=false"
xvfb-run -a ./musescore.AppImage -j export_job.json
done
- name: Upload PDF files as artifacts
uses: actions/upload-artifact@v4
with:
name: converted-pdfs
path: '**/*.pdf'
Supporting files, videos and screenshots
publisher-debug-feat-export-parts.zip
What is the latest version of MuseScore Studio where this issue is present?
4.5.2
Regression
Yes, this used to work in MuseScore 3.x and now is broken
Operating system
Ubuntu 22.04 and Windows 10
Additional context
No response
Checklist
- This report follows the guidelines for reporting bugs and issues
- I have verified that this issue has not been logged before, by searching the issue tracker for similar issues
- I have attached all requested files and information to this report
- I have attempted to identify the root problem as concisely as possible, and have used minimal reproducible examples where possible
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.
Assessment
This issue has not been assessed yet.