Crash report

I have recently implemented a method to send home by email the stack, in case of crash in my apps.

Sure enough, I get every crash report, but now I am a bit lost as to what is going on with one. Below is what I get. My issue is that I have no such ListColumnGetter in my code. And I nowhere raise OutOfBound. What could it be ? Is it part of the Xojo framework ? How can I alleviate this ?

TIA

PS : 2017R1

[code]RaiseOutOfBoundsException
listColumnGetter

XojoFramework$4505
XojoFramework$1861
XojoFramework$1734
-[NSView _drawRect:clip:]
-[NSView _recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView:]
-[NSView _recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView:]
-[NSView _recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView:]
-[NSThemeFrame _recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView:]
-[NSView _displayRectIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:]
-[NSView displayIfNeeded]
-[NSWindow displayIfNeeded]
___NSWindowGetDisplayCycleObserver_block_invoke.6314
__37+[NSDisplayCycle currentDisplayCycle]_block_invoke
_ZN2CA11Transaction19run_commit_handlersE18CATransactionPhase
_ZN2CA7Context18commit_transactionEPNS_11TransactionE
_ZN2CA11Transaction6commitEv
_ZN2CA11Transaction17flush_transactionEv
__37+[NSDisplayCycle currentDisplayCycle]_block_invoke.33
_runLoopObserverWithBlockContext
CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION
__CFRunLoopDoObservers
__CFRunLoopRun
CFRunLoopRunSpecific
CFRunLoopRunInMode
RunCurrentEventLoopInMode
ReceiveNextEventCommon
_BlockUntilNextEventMatchingListInModeWithFilter
_DPSNextEvent
-[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:]
-[NSApplication(NSEvent) nextEventMatchingMask:untilDate:inMode:dequeue:]
XojoFramework$1294
XojoFramework$1295

XojoFramework$9814
XojoFramework$1294
-[NSApplication run]
XojoFramework$9816
RuntimeRun[/code]

At first glance I’d say that this is an internal Xojo bug. What did the customer do to get this crash?

I’ve been using a function to clean this data up:

[code]Private Function CleanStack(error as RuntimeException) as string

'get the stack together

dim result as string

#if rbVersion >= 2005.5
for each singleStack as string in error.stack
dim StackString as string = cleanMangledFunction(singleStack)
if StackString <> “” then result = result + EndOfLine + StackString
next

#else
// leave result empty

#endif

return result
End Function[/code]

[code]Private Function CleanMangledFunction(item as string) as string

'for stack cleaning

#if rbVersion >= 2005.5

dim blacklist() as string = array( _
"REALbasic._RuntimeRegisterAppObject%%o<Application>", _
"_NewAppInstance", _'
"_Main", _
"% main", _
"REALbasic._RuntimeRun" _
)

if blacklist.indexOf( item ) >= 0 then exit function

dim parts() as string = item.split( "%" )
if ubound( parts ) < 2 then exit function

dim func as string = parts( 0 )
dim returnType as string
if parts( 1 ) <> "" then returnType = parseParams( parts( 1 ) ).pop()
dim args() as string = parseParams( parts( 2 ) )

if func.inStr( "$" ) > 0 then
  args( 0 ) = "extends " + args( 0 )
  func = func.replaceAll( "$", "" )
  
elseif ubound( args ) >= 0 and func.nthField( ".", 1 ) = args( 0 ) then
  args.remove( 0 )
end if

if func.inStr( "=" ) > 0 then
  dim index as integer = ubound( args )
  args( index ) = "assigns " + args( index )
  func = func.replaceAll( "=", "" )
end if

if func.inStr( "*" ) > 0 then
  dim index as integer = ubound( args )
  args( index ) = "paramarray " + args( index )
  func = func.replaceAll( "*", "" )
end if

dim sig as string
if func.instr( "#" ) > 0 then
  sig = "Event"
  func = func.replaceAll( "#", "" )
elseif returnType = "" then
  sig = "Sub"
else
  sig = "Function"
end if

if ubound( args ) >= 0 then
  sig = sig + " " + func + "( " + join( args, ", " ) + " )"
else
  sig = sig + " " + func + "()"
end if

if returnType <> "" then sig = sig + " as " + returnType

return sig

#else
return “”

#endif
End Function
[/code]

For instance, this gives me

2017-03-27, 15:53:40 Stack:
2017-03-27, 15:53:40
Sub VField.SetString(string)
Sub WriteMessageToValentina.Constructor(VDatabase)
Sub WriteMessageToDatabase.Constructor(string, VDatabase, ExportOptions, string)
Function MailParser.parse() as int32
Sub ArchiveThread.Archive()
Sub ArchiveThread.Event_Run()

HTH

That is the catch. All I have is the crash report.

Apparently, the user does not see the crash. It is reported both by my app, under Mac as well as Windows.

Thank you for the cleaning routines.

Strange that it should write a message to valentina which I don’t have in this app. Neither do I have a database.

Sorry, that was from my crash reports.

[quote=325935:@Beatrix Willius]2017-03-27, 15:53:40 Stack:
2017-03-27, 15:53:40
Sub VField.SetString(string)
Sub WriteMessageToValentina.Constructor(VDatabase)
Sub WriteMessageToDatabase.Constructor(string, VDatabase, ExportOptions, string)
Function MailParser.parse() as int32
Sub ArchiveThread.Archive()
Sub ArchiveThread.Event_Run()[/quote]

can you show me the crash report before the cleaning up??

The stack came from a customer. If I do a

dim f as folderitem f.delete

when printing I get
2017-04-13, 13:07:10 Stack:
2017-04-13, 13:07:10
RaiseNilObjectException
MainWindow.MainWindow.DoPrinting%%o<MainWindow.MainWindow>
CCToolbar.CCToolbar.MainToolbar1_Action%%o<CCToolbar.CCToolbar>oo
Delegate.IM_Invoke%%oo
AddHandler.Stub.15%%o
XojoFramework$3534
XojoFramework$2687
XojoFramework$2696
-[NSObject performSelector:withObject:]
-[NSToolbarButton sendAction:to:]
-[NSToolbarButton sendAction]
-[NSToolbarItemViewer mouseDown:]
-[NSWindow(NSEventRouting) _handleMouseDownEvent:isDelayedEvent:]
-[NSWindow(NSEventRouting) _reallySendEvent:isDelayedEvent:]
-[NSWindow(NSEventRouting) sendEvent:]
XojoFramework$1746
-[NSApplication(NSEvent) sendEvent:]
XojoFramework$1292
XojoFramework$1293
Delegate.Invoke%%
Application._CallFunctionWithExceptionHandling%%op
XojoFramework$9814
XojoFramework$1292
-[NSApplication run]
XojoFramework$9816
RuntimeRun
REALbasic._RuntimeRun
_Main
main
start

which the old functions reduce to:

2017-04-13, 13:04:38 Stack:
2017-04-13, 13:04:38
Sub MainWindow.MainWindow.DoPrinting(MainWindow.MainWindow)
Sub CCToolbar.CCToolbar.MainToolbar1_Action(CCToolbar.CCToolbar, MainToolbar, ToolItem)
Sub Delegate.IM_Invoke(MainToolbar, ToolItem)
Sub AddHandler.Stub.15(ToolItem)
Sub Delegate.Invoke()
Sub Application._CallFunctionWithExceptionHandling()

i like this… make it so much easier to understand

Do you have function names enabled in the build settings?

Hi Beatrix, any chance i have the codes for parseParams??
trying to use your code to have better crash report.

Yes.