Crash on Guitar Pro import

• Sep 21, 2013 - 03:43
Type
Functional
Severity
S2 - Critical
Status
closed
Project
Tags

1. open the following file in MuseScore: //musescore.org/sites/musescore.org/files/issues/%5BGuitar%20Pro%5D%20Multi-bar%20rests%20in%20the%20incorrect%20position.gp4

Discussion: The file comes from #22041: [Guitar Pro] Multi-bar rests in the incorrect position, so MuseScore used to open it without crashing.

GIT commit: 7769088


Comments

It happens with both GP 5 and GP 6 files on Ubuntu 14.04. Two examples from my web site are listed below.

gpx - http://v3p0.m3guitar.com/examples/soloarrangements/soloarr_donna_lee.gpx
gp5 - http://v2p0.m3guitar.com/examples/pentatonic/pt0/pt0_j01.gp5

The gp5 file used to load fine. The stack trace in Qt Creator is the same in both cases (revision 3543170).

0 Ms::Element::links element.h 322 0x99e6ac
1 Ms::cloneSpanner excerpt.cpp 225 0xfa8193
2 Ms::cloneStaves excerpt.cpp 486 0xfa9b7c
3 Ms::importGTP importgtp.cpp 2302 0xbdabcd
4 Ms::readScore file.cpp 1853 0xc8668c
5 Ms::MuseScore::readScore file.cpp 318 0xc79bc1
6 Ms::MuseScore::openScore file.cpp 297 0xc79a7b
7 Ms::MuseScore::loadFiles file.cpp 286 0xc7981d
8 main musescore.cpp 5040 0xaa253c

I cannot recreate a crash in the second attached file of comment #4 nor in either of the comments of #5. Are you using the latest master guys?

I pulled from the repository at lunchtime today. Git log:

commit 57ce3dcc471056863a66f6eab7018b0f0a1130d4
Author: lasconic
Date: Sat Aug 23 12:31:15 2014 +0200

John, with the latest version from today I no longer get the crash.

commit 57dd45139cfa09d2c095af4758b1ec7db1942256
Author: ws
Date: Sun Aug 24 10:52:28 2014 +0200

So for now you can ignore my comment #5.

In comment #11, I don't get a crash on Score 1, and Score 2 is far too big to be a minimal working example - the format is also too old for me to create again (exporting to e.g. GP5 doesn't work, as the error does not appear in that format). In general, please try to submit only small files as a full score is very hard to debug, especially if they are GP3 files as I can't edit them in that format.

For Score 1, I still get a crash. Could it be OS-specific?

Regarding small files, I will try, but as I'm not a programmer, it maybe hard to do so.

Using MuseScore 2.0 Nightly Build 516d037 - Mac 10.7.5.

I don't mean small in file size, I mean small in terms of score size. So e.g. chop out half the tracks and see if the error persists. If it does, then the issue is in the half tracks you have remaining. If not, then it was in the other half. By chopping things out this way we can create tiny scores with only a couple of bars which makes things much easier on my end to debug and fix.

Hrm, strange about Score 1. I'll play about with it and see if I can make a crash happen. ^^and

Here is a minimal crashing example from Score2 (edited in TuxGuitar).
The problem seems to be the cross-measure glissando.

Score1 does not crash under Linux Mint 17, even when address sanitizer is on.
I will try on Mac OS X 10.8.

Attachment Size
Queen_All_Gods_People_reduced.gp3 1.09 KB

Thanks, this has helped a lot in understanding what is happening here.

That GP3 exported from TuxGuitar is not the same as the GP3 format used by Guitar Pro (although it's supposed to be). In that file, TuxGuitar is exporting an illegal kind of slide, which Guitar Pro handles well by throwing it away (Guitar Pro 6). We should probably do the same and ignore bogus markings output by TuxGuitar.

The same file with either the slide removed, or applied sanely in Guitar Pro and then exported both import correctly. I see many of the tests that I have fail for the same reason, unfortunately I know of no way to determine whether a GP file is actually created in Guitar Pro, or created with something else. In any case, the implementation should do what Guitar Pro as much as possible, so we should locate and throw away such markings.

Score1 does not crash for me under Mac OS X 10.8.5 with commit e2a6fbd8
@chen lung: Does it still crash for you by simply opening it?
Can you try from the terminal to launch the following (adjust path accordingly to your installation):
/Applications/MuseScore\ 2.app/Contents/MacOS/mscore -d
(eventually also -F for factory reset)
and see if it adds further details?
Just to be sure we are talking about the same file, it is "Elton John - Someone Saved My Life Tonight (Pro).gp5", right?

A-Ah!
I was looking at the wrong file: I was checking the gp5 instead of the gpx. The trick was to check "ver2" before downloading the file.
The link should be this:
//tabs.ultimate-guitar.com/e/elton_john/someone_saved_my_life_tonight_ver2_guitar_pro.htm

It also crashes for me both under Windows and under Linux in the latest commit ( e2a6fbd8 )
Attached a log file with debug informations (line numbers) and a pair of comments about what is causing the crash at mscore/importgtp.cpp:703 (but not the real underlying bug).
Unfortunately, I can't open gpx files with TuxGuitar, so I can't try to create a minimal example :-(

Attachment Size
GuitarProX_log.txt 7.2 KB

The point where that file crashes has changed. Now it crashes in the point shown in the attached backtrace ("gpx_import_crash.txt") from gdb.
Windows 8.1 & Linux Mint 17.1, commit 9d50186
Attached also the xml extracted from the file ("GPX_xml.txt").
It seems that the file contains 7 Tracks elements, but in the MasterBars section each MasterBar contains 9 tracks, with keys: G2, F4, F4, G2, F4, G2, Neutral, Neutral, Neutral.
Therefore when the 8th track is read, it can't find a correspoding track already defined and initialized.
The Tracks are:
Piano
Electric Bass
Vocal
Back Vocals
Tambourine
Maracas
Drums
Is it possible that the "Piano" Track actually contains two staves (key: G2 and F4), and the same also for one of the vocal Tracks? If I understood correctly the import code, each instrument is initialized with only one single staff.
What does GuitarPro show when opening the file?

Attachment Size
GPX_xml.txt 343.69 KB
gpx_import_crash.txt 5.53 KB

(Wild guess:) Could it be an hard-coded setting for the "Instrument" tag?
In this file we have:
Instrument ref="a-piano-gs" (2 staves)
Instrument ref="e-bass4" (1 staff)
Instrument ref="snt-lead-gs" (2 staves)
Instrument ref="tnr-s" (1 staff)
Instrument ref="tmbrn" (1 staff)
Instrument ref="mrcs" (1 staff)
Instrument ref="drmkt" (1 staff)

That was my guess too but we would need someone with GP6 to make sure it's the case. Apparently, according to http://www.suseitalia.org/forum/programmi/guitar-pro-6?page=1#comment-9… the possible value for ref are numerous...

'e-gtr6', 'e-gtr7', 'e-gtr8', 'e-gtr12', 'n-gtr6', 'n-gtr7', 'n-gtr8', 's-gtr6', 's-gtr7', 's-gtr8', 's-gtr12', 'r-gtr6', 'bnj4', 'bnj5', 'bnj6', 'mndln8', 'ukll4', 'e-bass4', 'e-bass5', 'e-bass6', 'e-bass7', 'a-bass4', 'a-bass5', 'a-bass6', 'a-bass7', 'f-bass4', 'f-bass5', 'f-bass6', 'f-bass7', 's-bass4', 's-bass5', 's-bass6', 's-bass7', 'm-bass4', 'm-bass5', 'm-bass6', 'm-bass7', 'a-piano-gs', 'a-piano-ss', 'e-piano-gs', 'e-piano-ss', 'em-organ-gs', 'em-organ-ss', 'hrpch-gs', 'hrpch-ss', 'snt-pad-gs', 'snt-pad-ss', 'snt-lead-gs', 'snt-lead-ss', 'snt-brass-gs', 'snt-brass-ss', 'snt-key-gs', 'snt-key-ss', 'snt-seq-gs', 'snt-seq-ss', 'snt-bass-gs', 'snt-bass-ss', 'vln', 'vla', 'cello', 'ctbass', 'harp-gs', 'harp-ss', 'trmpt-c', 'trmpt-c-bass', 'trmpt-bb', 'trmpt-a', 'trmpt-g', 'trmpt-f', 'trmpt-e', 'trmpt-eb', 'trmpt-d', 'trmpt-flgh', 'trmpt-d-bass', 'trmpt-eb-bass', 'trmbn-bb-treble', 'trmbn-eb', 'trmbn-bb', 'trmbn-eb-bass', 'trmbn-bb-bass', 'fr-horn', 'bass-tuba-eb', 'bass-tuba-bb', 'oboe', 'bassn', 'ctbassn', 'en-horn', 'clrnt-c', 'clrnt-bb', 'clrnt-a', 'clrnt-d', 'clrnt-eb', 'clrnt-bb-bass', 'sax-sop-bb', 'sax-alt-eb', 'sax-ten-bb', 'sax-bar-eb', 'sax-bass-eb', 'sax-sop-f', 'sax-sop-c', 'sax-ten-c', 'sax-ms-f', 'bttlbw', 'flt-c', 'flt-g', 'bass-flt-c', 'pccl', 'rec', 'pnflt', 'flt-whstl', 'ocrn', 'xlphn', 'vbrphn', 'clst-ss', 'clst-gs', 'tmpn', 'trngl', 'snr', 'grcss', 'ptt', 'tnklbll', 'taiko', 'mldctm', 'snthdrm', 'china', 'crash', 'hihat', 'pedalhihat', 'ride', 'splash', 'rvs-cymb', 'snare', 'kick', 'tom', 'cowbell', 'bongo', 'conga', 'cuica', 'surdo', 'tmbrn', 'tmbl', 'agogo', 'bell-tree', 'cbs', 'cstnt', 'clvs', 'guiro', 'hclap', 'jngl-bell', 'mrcs', '2Mrcs', 'shkr', 'vbrslp', 'whstl', 'wdblck', 'sprn-s', 'alt-s', 'tnr-s', 'brtn-s', 'bass-s', 'sprn-c', 'alt-c', 'tnr-c', 'brtn-c', 'bass-c', 'bngKit', 'cngKit', 'agogoKit', 'tmblKit', 'wdblckKit', 'cuicaKit', 'whstlKit', 'conbon', 'sambaKit', 'africaKit', 'latinoKit', 'drmkt'

And now I read again :) and the "-gs" in the ref is for Grand Staff ! So it has to be it !
It probably also mean that in this case, it doesn't make sense to create tablature in the part btw.