Crash at Startup

Hi,

From time to time my GP crashes when starting up and loading my last gig file.
I‘m running GP 4.5.8 on a M1pro MBP latest Ventura in native mode. all plugins M1 compatible.

From the last crash report:

Crashed Thread: 7 GPScriptRT

Exception Type: EXC_BAD_ACCESS (SIGBUS)

Exception

Codes: KERN_PROTECTION_FAILURE at 0x00000004e77ba6b0
Exception Codes: 0x0000000000000002, 0x00000004e77ba6b0

Termination Reason: Namespace SIGNAL, Code 10 Bus error: 10
Terminating Process: exc handler [12250]

Thread 7 crashed with ARM Thread State (64-bit):
x0: 0x00000004953e8330 x1: 0x0000000502db1f10 x2: 0x0000000502df75c0 x3: 0x0000000000000002
x4: 0x00000000a2512000 x5: 0x0000000000000002 x6: 0x0000000000000002 x7: 0x00000001979fe73c
x8: 0x00000004e77ba6b0 x9: 0x00000004e13b7a80 x10: 0x0000000000000a80 x11: 0x00000000000e7e50
x12: 0x0000000502d03f2c x13: 0x0000000000000001 x14: 0x0000000502d00000 x15: 0x00000000a2412000
x16: 0xd796000107f70080 x17: 0x0000000502db1f10 x18: 0x0000000000000000 x19: 0x00000004436f1420
x20: 0x0000000000000103 x21: 0x000000012c9da1d0 x22: 0x000000012c9da118 x23: 0x000000012c9da0e8
x24: 0xffffffffffffffff x25: 0x000000016c7f6f08 x26: 0x0000000107d74791 x27: 0x0000000107d3bd14
x28: 0x000000016c7f6ee8 fp: 0x000000016c7f6e90 lr: 0x0000000104d740e0
sp: 0x000000016c7f6e20 pc: 0x00000004e77ba6b0 cpsr: 0x80001000
far: 0x00000004e77ba6b0 esr: 0x8200000f (Instruction Abort) Permission fault

How to proceed?

The thread indicates GP script. Are you using them throughout the Gig file?

When did this start happening? Did you change something?

@rank13 , @dhj

In my gig file I use GP Scripts on Gig level, in the Global Rack and of course in some rackspaces. I also use scriptlets.

I did not change anything “relevant” which I can remember, maybe some paramters like volume levels by widgets etc… I just happens sometimes when I start GP. Maybe 7-8 starts are OK.

I am currently even not able to tell, if this happens when I update a plugin, after a reboot of the MBP, after sleep etc. I’m not able to identify a pattern, or better the relevant parts of scripting which could raise this crash :frowning:

For the gig script and global rackspace script, how complex are they? @dhj could confirm, but I assume if the crash is happening immediately as you start loading the gig file, it is more likely to be something in the gig script or global rackspace script.

Busy afternoon…

I have quite simple scripts at gig script level and global rack.
Typically the gig file starts to load, I can see the GP main window and the dialog showing the progress while loading all rackspaces.

The crash typically occurs at the end of the loading. All windows close, and after some seconds the crash report appears.

I‘ll try to provide some more information and script excerpts etc. tomorrow.

Puh, what a week - sorry for a late reply:

Here are my Gig script

// TripleB, 05/2021
//
// 25-DEC-2021 added Playhead to Metronome Start Sync Control when switchung Rackspaces
// 08-JAN-2023 added LOWER CC 67
// 30-JUL-2023 added Next Song Injection

Var
UPPER : MidiInDevice // Handle to MIDI in devices setup by Rig Manager
LOWER : MidiInDevice

LOCALPORT :  MidiInDevice

// -------------------------------------------------------------------------------------------------------
// Proceed to next Songpart, Loop if wanted
// Listen for matching CC
On ControlChangeEvent (c: ControlChangeMessage) matching 67 from LOWER // UPPER
Var currentPart, numParts : integer
partName : string
firstChar : string

// if(InSetlistView() && GetCCValue(c) > 64 && GetChannel(c) == 2) then // only handle in Setlist view!
if(InSetlistView() && GetCCValue(c) > 64 && GetChannel(c) == 1) then // only handle in Setlist view!

currentPart = GetCurrentSongPart()
numParts = GetSongPartCount()

//Print("Part " + IntToString(currentPart) + " of " + IntToString(numParts))

if currentPart < numParts -1 then    // if we are before last Song Part just forward CC message
    //InjectMidiEventViaRigManager(UPPER, c)
    InjectMidiEventViaRigManager(LOWER, c)
else
    //Print("Last")         // otherwise directly jump to first song part
    partName = GetSongPartName(currentPart)
    //Print(partName)
    firstChar = CopySubstring(partName, 0, 1)
    if firstChar == "*" then
       SetSongPart(0)
    else
       //Print("Last Songpart")      // added 30-JUL-2023
       InjectMidiEventViaRigManager(UPPER, MakeControlChangeMessageEx(56,127,2))
       InjectMidiEventViaRigManager(UPPER, MakeControlChangeMessageEx(56,0,2))
    end
 end 

else
//Print(“Not in Setlistview…”)
//InjectMidiEventViaRigManager(UPPER, c) // just forward CC message
InjectMidiEventViaRigManager(LOWER, c) // just forward CC message
end
End

// -------------------------------------------------------------------------------------------------------
// Inject a note off message (C1) to Local GP MIDI Port to enable/disable Playhead Sync to Metronome restart
On Rackspace(oldRackspaceIndex : integer, newRackspaceIndex : integer)

var ccm : MidiMessage
//Print("From: " + IntToString(oldRackspaceIndex) + " to: " + IntToString(newRackspaceIndex))
Print (“On Rackspace - Gig Script”)
// ccm = MakeNoteMessageEx(36, 0, 1) // Note Off C1
// InjectMidiEventViaRigManager(LOCALPORT, ccm)
End

// -------------------------------------------------------------------------------------------------------

and the Globalrack Scripts

Var
// Widgets from left/to right top/down blockwise
GPtoFrontButton : widget
//OnSongPrev, OnSongNext : Widget
GPShowGlobal : widget
UCButton : Widget
FCButton : Widget
CMButton : Widget
//Ui24RFlag : Widget

//MetronomeButton : widget --> Scriptlet
MetroSyncButton : widget    // still here as used by Global Rack script...

PlayListBGM1Button : Widget  
PlayListBGM2Button : Widget  
PlayPauseButton : Widget   
StopButton : Widget
SkipPrev, SkipNext : Widget

RSThrsKnob, RSThrsStr  : widget

SEGainKnob, SEGainStr : Widget
SEThrsKnob, SEThrsStr : Widget

// Remaining Widgets which need defaults
GRDefaultsButton: Widget

GRMuteButton, GRMetronomeButton : Widget
GRMetronomeFader, GRFSEFader, GRRacksFader, GRMusicFader, GRMasterTrim : Widget
GRAuxLevel, GRBypassPBeq : Widget
/*GRWidthKnob,*/ GRBeatMode : Widget

USB_DIM : Widget

// internals for SE relative mode mapped Gain knob
myRamp : Ramp  
step_width : double
rel_step : double
CCvalue : double

// MIDI blocks used
KeyLabMkII_MIDI : MidiInBlock
OnSong_MIDI : MidiOutBlock
LocalPort_MIDI : MidiInBlock

KeyLabSysExGlobal : MidiInBlock      // used to insert SysEx MIDI ----> remove Event Blocking for SysEx!

// ---------------------------------------------------------------------------------------------------------
// Functions
// Main Function to create and send a System Exclusive Message for the desired colour LED
Function ResetCLED()
var
SysExMsg : String
SysExSend : SysexMessage

i : integer
now: double

for i := 0; i<16; i := i + 1 do
   
    SysExMsg = "F0 00 20 6B 7F 42 02 00 16 " + IntToHexString(i+7*16) + " "
    SysExMsg = SysExMsg + "00 03 03 F7"
    
    SysExSend = SysExMsg
    SendSysexInternalNow(KeyLabSysExGlobal, SysExSend)

    now = TimeSinceStartup()                    // Little Guard Times
    while TimeSinceStartup() < now + 10.0 do
    end
end  

end

// Set corresp. Threshold to text label widget
function SetThrsdB(target : widget, newValue : double)
var thres_dB : double
thrs_str : string

thres_dB = -30.0 + 30.0*newValue
thrs_str = DoubleToString(thres_dB, 1 ) + “dB”
//Print(thrs_str)
SetWidgetLabel(target, thrs_str)
end

// Relative CC Control helpers
function GetValues(value : integer) returns double
if value <= 63
then result = step_width * -1.0
else result = step_width
end
end

/*function AdjustWidget( m : ControlChangeMessage)
var widgetIndex : integer;

    widgetValue : double 
    
//widgetIndex = GetCCNumber(m) - 40 // Be careful you don't go out of range here or you'll crash GP
//Print ("Adjust OK")
If IsGeneratorEnabled(myRamp) == false
Then
    rel_step = GetValues(GetCCValue(m))
End

myRamp.SetGeneratorLength(30); // 30ms
SetTimersRunning(true)
myRamp.EnableGenerator(True)    

// CCvalue = GetValues(GetCCValue(m))
// widgetValue = GetWidgetValue(WidgetList[widgetIndex])
// SetWidgetValue(WidgetList[widgetIndex], widgetValue + rel_step)

CCvalue = GetValues(GetCCValue(m))
widgetValue = GetWidgetValue(SEGainKnob) 
SetWidgetValue(SEGainKnob, widgetValue + rel_step)

end
*/

// ---------------------------------------------------------------------------------------------------------
// init all widgets
Initialization
SetGeneratorOneShot(myRamp, true) // Generator will only run once when triggered
// Also, check the SetGeneratorCoarseness function
// which can be used to control how often we get called back
// Choose values wisely! You’re trading accuracy against CPU cycles

step_width = 0.01
rel_step = 0

SetThrsdB(SEThrsStr, GetWidgetValue(SEThrsKnob))
SetThrsdB(RSThrsStr, GetWidgetValue(RSThrsKnob))
SetThrsdB(SEGainStr, GetWidgetValue(SEGainKnob))
End

// ---------------------------------------------------------------------------------------------------------
// Callbacks
// Get OSC Message
On OSCMessageReceived(message : OSCMessage) Matching “/KeyLabMK2Leds”
var
i : integer
msg : String

msg = OSC_GetArgAsString(message, 0)
Print(“KeyLabMkIILEDs: '” + msg + “'”)

if msg == “ResetPads” then ResetCLED(); end // react on dedicated Message…
End

// This gets called by the ramp generator as time passes
on TimePassing(timeX : integer, amplitudeY : double) from myRamp

rel_step = rel_step + CCvalue

//Print (rel_step)
//Print("X = " + timeX + " Y = " + amplitudeY)
end

/*
// Just doing three widgets here – adjust this and knoblist array to suit
On ControlChangeEvent(m : ControlChangeMessage) Matching 40 from KeyLabMkII_MIDI
AdjustWidget(m)
End
*/

// ---------------------------------------------------------------------------------------------------------
// ---------------------------------------------------------------------------------------------------------
// ---------------------------------------------------------------------------------------------------------

// ---------------------------------------------------------------------------------------------------------
// Upper Rack / Mixer & Playbacks by Music
// Called when a widget value has changed
On WidgetValueChanged(newValue : double) from StopButton
var retVal : integer
if newValue == 1.0 then
retVal := Shell(“osascript -e ‘tell Application "Music" to stop’”)
SetWidgetValue(StopButton, 0.0)
end
End

// Called when a widget value has changed
On WidgetValueChanged(newValue : double) from PlayPauseButton
var retVal : integer
if newValue == 1.0 then
retVal := Shell(“osascript -e ‘tell Application "Music" to playpause’”)
SetWidgetValue(PlayPauseButton, 0.0)
end
End

// Called when a widget value has changed
On WidgetValueChanged(newValue : double) from SkipPrev
var retVal : integer
if newValue == 1.0 then
retVal := Shell(“osascript -e ‘tell Application "Music" to play (previous track)’”)
SetWidgetValue(SkipPrev, 0.0)
end
End

// Called when a widget value has changed
On WidgetValueChanged(newValue : double) from SkipNext
var retVal : integer
if newValue == 1.0 then
retVal := Shell(“osascript -e ‘tell Application "Music" to play (next track)’”)
SetWidgetValue(SkipNext, 0.0)
end
End

// Called when a widget value has changed
On WidgetValueChanged(newValue : double) from PlayListBGM1Button
var retVal : string
if newValue == 1.0 then
retVal := ShellEx(“osascript ‘/Users/alexander/Documents/Gig Performer/AppleScript/Playlist-BGM1.scpt’”)
Print("Playing: " + retVal)
SetWidgetValue(PlayListBGM1Button, 0.0)
end
End

// Called when a widget value has changed
On WidgetValueChanged(newValue : double) from PlayListBGM2Button
var retVal : string
if newValue == 1.0 then
retVal := ShellEx(“osascript ‘/Users/alexander/Documents/Gig Performer/AppleScript/Playlist-BGM2.scpt’”)
Print("Playing: " + retVal)
SetWidgetValue(PlayListBGM2Button, 0.0)
end
End

// ---------------------------------------------------------------------------------------------------------
// Screen Control Buttons

// Called when a widget value has changed
On WidgetValueChanged(newValue : double) from GPtoFrontButton
var retVal : string
if newValue == 1.0 then
//retVal := ShellEx(“osascript ‘/Users/alexander/Music/Gig Performer/AppleScript/GP-to-Front-GP4.scpt’”)
GPWindowToFront()
SetWidgetValue(GPtoFrontButton, 0.0)
//Print(“GPtfr”)
end
End

// Called when a widget value has changed
On WidgetValueChanged(newValue : double) from GPShowGlobal
if newValue == 1.0 then
ShowGlobalRackspace(true)
else
ShowGlobalRackspace(false)
end
End

// Called when a widget value has changed
On WidgetValueChanged(newValue : double) from UCButton
var retVal : string
if newValue == 1.0 then
/*
if GetWidgetValue(Ui24RFlag) < 0.5 then
retVal := ShellEx(“osascript -e ‘tell application "UniversalControl" to activate’”)
else
retVal := ShellEx(“osascript ‘/Users/alexander/Documents/Gig Performer/AppleScript/Open Ui24R.scpt’”)
end
*/
retVal := ShellEx(“osascript ‘/Users/alexander/Documents/Gig Performer/AppleScript/Open Ui24R.scpt’”)
SetWidgetValue(UCButton, 0.0)
end
End

// Called when a widget value has changed
On WidgetValueChanged(newValue : double) from FCButton
var retVal : string
if newValue == 1.0 then
// retVal := ShellEx(“osascript -e ‘tell application "Focusrite Control" to activate’”)
retVal := ShellEx(“osascript -e ‘tell application "Bandhelper" to activate’”)
SetWidgetValue(FCButton, 0.0)
end
End

// Called when a widget value has changed
On WidgetValueChanged(newValue : double) from CMButton
var retVal : string
if newValue == 1.0 then
retVal := ShellEx(“osascript ‘/Users/alexander/Documents/Gig Performer/AppleScript/FC Clear Meters.scpt’”)
SetWidgetValue(CMButton, 0.0)
end
End

// Set defaults to some controls
On WidgetValueChanged(newValue : double) from GRDefaultsButton

SetWidgetValue(GRMetronomeButton, 0.0) // turn off Metronome (incl Playhead)
SetWidgetValue(StopButton, 1.0)
EnablePlayhead(false)
SetWidgetValue(GRMetronomeFader, 0.2229719) // -20dB
SetWidgetValue(MetroSyncButton, 1.0)
SetWidgetValue(GRBeatMode, 1.0)

SetWidgetValue(GRFSEFader, 0.7074653) // set all faders to 0dB
SetWidgetValue(GRRacksFader, 0.7074653)
SetWidgetValue(GRMuteButton, 1.0) // Mute Apple Music
SetWidgetValue(GRMusicFader, 0.2229719) // -20dB
SetWidgetValue(GRBypassPBeq, 1.0) // disable SSL EQ

SetWidgetValue(GRAuxLevel, 0.2229719) // AUX Input -20dB
SetWidgetValue(GRBypassPBeq, 1.0)
SetWidgetValue(GRMasterTrim, 1.0)

SetWidgetValue(USB_DIM, 0.445)

//SetWidgetValue(GRWidthKnob, 0.5) // default Stereo Pan

End

/*
On WidgetValueChanged(newValue : double) from GRMusicFader
Print(newValue)
End
*/

// ---------------------------------------------------------------------------------------------------------
// OnSong Control Buttons
/*
// Called when a widget value has changed
On WidgetValueChanged(newValue : double) from OnSongPrev
var retVal : string
if newValue == 1.0 then
SendNowExternal(OnSong_MIDI, MakeNoteMessageEx(D#3, 100, 1))
SetWidgetValue(OnSongPrev, 0.0)
end
End

// Called when a widget value has changed
On WidgetValueChanged(newValue : double) from OnSongNext
var retVal : string
if newValue == 1.0 then
SendNowExternal(OnSong_MIDI, MakeNoteMessageEx(G3, 100, 1))
SetWidgetValue(OnSongNext, 0.0)
end
End
*/
// ---------------------------------------------------------------------------------------------------------
// Calculate SE Gain
On WidgetValueChanged(newValue : double) from SEGainKnob
SetThrsdB(SEGainStr, newValue)
End

// ---------------------------------------------------------------------------------------------------------
// Calculate Threshold LoudMax for SE
On WidgetValueChanged(newValue : double) from SEThrsKnob
SetThrsdB(SEThrsStr, newValue)
End

// ---------------------------------------------------------------------------------------------------------
// Calculate Threshold LoudMax for Rackspace
On WidgetValueChanged(newValue : double) from RSThrsKnob
SetThrsdB(RSThrsStr, newValue)
End

// ---------------------------------------------------------------------------------------------------------
// wrapper for metronone
//On WidgetValueChanged(newValue : double) from MetronomeButton
// if newValue >= 0.5 then
// EnableMetronome(true)
// EnablePlayhead(true)
// else
// EnableMetronome(false)
// EnablePlayhead(false)
// end
//End

// ---------------------------------------------------------------------------------------------------------
// Reset Playhead Start to sync/w Metronome when leaving Rackspace…
//On NoteEvent(m : NoteMessage) matching C1 from LocalPort_MIDI

//Print("Sync Playhead to Metronome omn Retart")

// SetWidgetValue(MetroSyncButton, 1.0)

//end

// ---------------------------------------------EOF---------------------------------------------------------

@dhj regarding the “when did this star?” question: I can’t remember. I had sometimes crashes on the move from intel to M1 - mainly caused by non M1 ready Plugins, but this is now definitely over: only M1 compatible Plugins - all other sorted out…

You have a lot of shell scripts. Do you know if these are being triggered when the gig file loads?

Hm, while re-reading my Global Rackspace script: there’s a lot of obsolete stuff in - time to clean up :innocent:

To provide some more visual context (sorry, totally forgot this when providing the scripts)


Most of the shell scripts trigger actions with external applications (e.g. Music, Bandhelper, mixing console, sound card). I use this to control Music for BGM, bringing GP, Bandhelper etc. to front etc. by using dedicated buttons of my KeyLabMkII mapped to widgets in the Global Rackspace…

I have not been able to catch anything specific, however I started wondering why the Apple Music app starts up, when GP starts… Maybe that’s a starting point for further investigations!

I’ll get back after cleaning up, and some more tests!

Any last recommendations how to catch more informations besides the GP script logs? Is there a chance to use other loggings like the macOS console, and how?

Ok, some news on my side: Yesterday when I tried to start GP, my last small gig file from my tests with the Arturia LCD was active as last gig to load (Arturia Keylab : display on LCD screen - #44 by tripleB)

Maybe this helps (the development team…): this file does not open anymore, GP 4.5.8 immediately crashes after scanning for new plugins.

I also tried to reboot my MBP (“boot tut gut”) - same result. I’ve attached the severals crashlogs and the gig file.

What does this small gig file have in common with my main gigfile? Both have GPScript on gig level.

HTH
BBB
TripleB-ScriptCrashes.zip (50.0 KB)

Can you Upload the Gig file?

It’s in the zip :wink:

I can load it without any issue.
GP 4.5.8 Mac Ventura

Where is the crashlog?

When I face a crashlog, I copy the text from the crash reporter into a textedit and save it.
This is an RTF-File which can be uploaded.

The crashlogs are the zip inside the zip - the .ips files from the macOS console.

Just to add and to confirm: I’m on latest Ventura (13.5.1) on a MBP 14" M1pro, GP 4.5.8,
If needed I can also export them as txt/rtf this evening…

These crashes are happening inside a GPScript callback — can’t tell any more than that at this point.

What happens if you open your gigfile with GP 4.7?

I did just try that and it does NOT crash.

I have to install 4.7 first :innocent: this will happen in the next 3 days…
I’ll get back as soon as I have done this and retested!

OK, progress on my side.

I just installed 4.7 and after a first start with disableing loading the last gig I tried to open the crashing LCD-Test(2).gig. and …
… it’s not crashing anymore :slight_smile: However, I get the following error message in the script log

I will do further testing in the evening with my main gig file.

Stay tuned!
BBB

PS: I’m starting GP in fullscreen, therefore the Log window opens in another fullscreen window. If I close this, a black empty Desktop remains. It only closes when shutting down GP. How do I close this Desktop?

I do not get this log messages at all, it is working.

Are you sure, you are running 4.7

I modified the code

//Callbacks
On Variation (old : Integer, new : Integer)
    var VariationName : String = GetVariationName(GetCurrentVariation())
    Print(VariationName)
    
    If GetVariationCount() ==1 Then
        VariationName=""
    End
    
    KeylabLCD(GetRackspaceNameAtIndex(GetCurrentRackspaceIndex()) ,VariationName)
End

And in the log window I see the Variation Name.
No error message