Deciphering crash stack

Hey,
My app runs fine in the IDE and in the same user account when I install it and run it externally on the mac as a real Application after compile.
Tested on another mac and it crashes. I’ve pasted the stack below but had to cut the bottom off bc forum says post is too long

Per below is it crashing on “fileExistsGetter” ?
And if so what does that mean?
I do have some if file exists statements but why would that crash the program?
And why would that happen on one account or mac and not another?
Anyway the only way I can think to debug is to add some file logging or popups.
I already have some Exception handling but it doesn’t pop up… crashes before anything happens.

Thanks in advance. -Tim

----stack dump -----

Process: RetirementView [5140]
Path: /Applications/RetirementView.app/Contents/MacOS/RetirementView
Identifier: com.torrid-tech.retirementview
Version: 2017.1 (17.1.1.3.0)
Code Type: X86 (Native)
Parent Process: ??? [1]
Responsible: RetirementView [5140]
User ID: 501

Date/Time: 2017-01-27 11:23:03.490 -0500
OS Version: Mac OS X 10.10.5 (14F2109)
Report Version: 11
Anonymous UUID: 5FAA7BBE-4BBC-ED99-0FF9-678EA4E2E8FE

Sleep/Wake UUID: 42CC3CCA-41AC-4614-8DF5-3025BD81D944

Time Awake Since Boot: 66000 seconds
Time Since Wake: 210 seconds

Crashed Thread: 0 Dispatch queue: com.apple.main-thread

Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0x0000000000000018

VM Regions Near 0x18:
–>
__TEXT 0000000000001000-00000000011ae000 [ 17.7M] r-x/rwx SM=COW /Applications/RetirementView.app/Contents/MacOS/RetirementView

Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0 rbframework.dylib 0x012ac999 fileExistsGetter + 9
1 com.torrid-tech.retirementview 0x0009bc9e 0x1000 + 634014
2 com.torrid-tech.retirementview 0x004b518d 0x1000 + 4931981
3 rbframework.dylib 0x0126f715 enableMenuItems + 629
4 com.torrid-tech.retirementview 0x0001f6de 0x1000 + 124638
5 com.torrid-tech.retirementview 0x000cd39e 0x1000 + 836510
6 rbframework.dylib 0x012a3794 DecodeBackslashEscapeString + 10372
7 rbframework.dylib 0x0126de62 RuntimeRegisterAppObject + 338
8 com.torrid-tech.retirementview 0x002049c0 0x1000 + 2111936
9 com.torrid-tech.retirementview 0x000027ba 0x1000 + 6074
10 com.torrid-tech.retirementview 0x000063a0 0x1000 + 21408
11 com.torrid-tech.retirementview 0x000064f3 0x1000 + 21747
12 com.torrid-tech.retirementview 0x0000253c 0x1000 + 5436
13 com.torrid-tech.retirementview 0x01107bb7 0x1000 + 17853367
14 com.torrid-tech.retirementview 0x01107b0d 0x1000 + 17853197

Thread 1:: Dispatch queue: com.apple.libdispatch-manager
0 libsystem_kernel.dylib 0x9362d8ce kevent64 + 10
1 libdispatch.dylib 0x9a47ace3 _dispatch_mgr_invoke + 245
2 libdispatch.dylib 0x9a47a8c6 _dispatch_mgr_thread + 52

Thread 2:
0 libsystem_kernel.dylib 0x9362ce6a __workq_kernreturn + 10
1 libsystem_pthread.dylib 0x912a872a _pthread_wqthread + 939
2 libsystem_pthread.dylib 0x912a5e0e start_wqthread + 30

Thread 3:
0 libsystem_kernel.dylib 0x9362ce6a __workq_kernreturn + 10
1 libsystem_pthread.dylib 0x912a872a _pthread_wqthread + 939
2 libsystem_pthread.dylib 0x912a5e0e start_wqthread + 30

Thread 4:
0 libsystem_kernel.dylib 0x9362ce6a __workq_kernreturn + 10
1 libsystem_pthread.dylib 0x912a872a _pthread_wqthread + 939
2 libsystem_pthread.dylib 0x912a5e0e start_wqthread + 30

Thread 5:
0 libsystem_kernel.dylib 0x9362ce6a __workq_kernreturn + 10
1 libsystem_pthread.dylib 0x912a872a _pthread_wqthread + 939
2 libsystem_pthread.dylib 0x912a5e0e start_wqthread + 30

Thread 6:
0 libsystem_kernel.dylib 0x9362c512 __psynch_cvwait + 10
1 libsystem_pthread.dylib 0x912a91d7 _pthread_cond_wait + 842
2 libsystem_pthread.dylib 0x912a9e68 pthread_cond_timedwait_relative_np + 47
3 com.apple.CoreServices.CarbonCore 0x9b639811 TSWaitOnConditionTimedRelative + 167
4 com.apple.CoreServices.CarbonCore 0x9b639370 TSWaitOnSemaphoreCommon + 499
5 com.apple.CoreServices.CarbonCore 0x9b63956b TSWaitOnSemaphoreRelative + 24
6 com.apple.QuickTimeComponents.component 0x97cbf282 0x97a4b000 + 2572930
7 libsystem_pthread.dylib 0x912a8c25 _pthread_body + 138
8 libsystem_pthread.dylib 0x912a8b9b _pthread_start + 162
9 libsystem_pthread.dylib 0x912a5e32 thread_start + 34

Thread 7:
0 libsystem_kernel.dylib 0x9362c512 __psynch_cvwait + 10
1 libsystem_pthread.dylib 0x912a91d7 _pthread_cond_wait + 842
2 libsystem_pthread.dylib 0x912a9e68 pthread_cond_timedwait_relative_np + 47
3 com.apple.CoreServices.CarbonCore 0x9b639811 TSWaitOnConditionTimedRelative + 167
4 com.apple.CoreServices.CarbonCore 0x9b639370 TSWaitOnSemaphoreCommon + 499
5 com.apple.CoreServices.CarbonCore 0x9b63956b TSWaitOnSemaphoreRelative + 24
6 com.apple.CoreServices.CarbonCore 0x9b5dc950 AIOFileThread(void*) + 914
7 libsystem_pthread.dylib 0x912a8c25 _pthread_body + 138
8 libsystem_pthread.dylib 0x912a8b9b _pthread_start + 162
9 libsystem_pthread.dylib 0x912a5e32 thread_start + 34

Thread 8:
0 libsystem_kernel.dylib 0x9362ce6a __workq_kernreturn + 10
1 libsystem_pthread.dylib 0x912a872a _pthread_wqthread + 939
2 libsystem_pthread.dylib 0x912a5e0e start_wqthread + 30

Thread 0 crashed with X86 Thread State (32-bit):
eax: 0x00000000 ebx: 0x07e08bc0 ecx: 0x07e09110 edx: 0xbffffb18
edi: 0x016778a0 esi: 0x00000000 ebp: 0xbfffd998 esp: 0xbfffd990
ss: 0x00000023 efl: 0x00010286 eip: 0x012ac999 cs: 0x0000001b
ds: 0x00000023 es: 0x00000023 fs: 0x00000000 gs: 0x0000000f
cr2: 0x00000018

Logical CPU: 0
Error Code: 0x00000004
Trap Number: 14

What are you doing in EnableMenuItems? That’s where I’d look.

You have “something” - I cant tell you what from that crash log - that is being run as part of the app literally starting
And this appears to be BEFORE app.open

Something like a constructor in a menu item thats on a menu bar that is being created as the app starts up

And it looks like perhaps its trying to access a file - again not sure how - but that is causing the crash

Make sure you turn on “include function names”

If you happened to file a bug report with the crash log & you code attached (privately of course) we could look it over

I can find that in documentation and that it is under Build Settings.
But only build settings I can find are if I click App in the CONTENTS and scroll to bottom
it just has checkboxes for Mac, Win, Shared, etc.

Where is the include function names?

What version are you using ???

OK got it… you have to click on Shared to get it to appear. DOH!

I think this crash is related to assigning a small image to a menuitem.icon

For some reason I created a new menu item and it does NOT have all of the settings of all my other menu items.
It only lists Super: MenuItem
but underneath in settings does not have icon or any of the other many settings all my other menus have.

OK got the function names… looks like it is on a file exists call in App.Open.
I have exception handlers at bottom of App.Open for IOException and RuntimeException
and also an App.UnhandledException routine. None fire and it just crashes.

Just trying to figure out how to debug other than trial and error… comment out half the code and try
to narrow down where it is dying.

Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0 rbframework.dylib 0x013ac999 fileExistsGetter + 9
1 com.torrid-tech.retirementview 0x0009bc9e FolderItem.Exists.Get%b%oi4 + 54
2 com.torrid-tech.retirementview 0x004b505d App.Event_Open%%o + 9434
3 rbframework.dylib 0x0136f715 enableMenuItems + 629
4 com.torrid-tech.retirementview 0x0001f6de Delegate.Invoke%% + 34
5 com.torrid-tech.retirementview 0x000cd39e Application._CallFunctionWithExceptionHandling%%op + 264
6 rbframework.dylib 0x013a3794 DecodeBackslashEscapeString + 10372
7 rbframework.dylib 0x0136de62 RuntimeRegisterAppObject + 338
8 com.torrid-tech.retirementview 0x002049c0 REALbasic._RuntimeRegisterAppObject%%o + 48
9 com.torrid-tech.retirementview 0x000027ba _NewAppInstance + 238
10 com.torrid-tech.retirementview 0x000063a0 _EarlyStartup + 52
11 com.torrid-tech.retirementview 0x000064f3 _Main + 153
12 com.torrid-tech.retirementview 0x0000253c % main + 36
13 com.torrid-tech.retirementview 0x01107497 _start + 116
14 com.torrid-tech.retirementview 0x011073ed start + 43

Something in your App.Open event

Hmmmm… I did add 3 lines to check for a folder with old name and if it exists rename it to new name.

finit = SpecialFolder.Documents.Child(“Torrid Technologies”).Child(“OldFolderName”)
If finit.Exists Then
// try to rename it
finit.Name = “NewFolderName”
End if

Where I changed the real names in the code above just so it makes sense.
What if any error handling should I add to that code?

Do you have NilObjectChecking turned off with a #pragma?

[quote=312302:@Tim Turner]Hmmmm… I did add 3 lines to check for a folder with old name and if it exists rename it to new name.

finit = SpecialFolder.Documents.Child(“Torrid Technologies”).Child(“OldFolderName”)
If finit.Exists Then
// try to rename it
finit.Name = “NewFolderName”
End if

Where I changed the real names in the code above just so it makes sense.
What if any error handling should I add to that code?[/quote]

On a brand new set up that line will cause an exception since the child folder, Torrid Technologies, wont already exist
At least wrap it in a try catch

try
  finit = SpecialFolder.Documents.Child("Torrid Technologies").Child("OldFolderName")
  If finit.Exists Then
    // try to rename it
    finit.Name = "NewFolderName"
  End if
catch noe as NilObjectException
end try

but i’d actually consider rewriting it

  finit = SpecialFolder.Documents.Child("Torrid Technologies")
  If (not (finit is nil)) and finit.Exists Then
        finit = finit.Child("OldFolderName")
        // try to rename it
        if (not (finit is nil)) and finit.exists then
             finit.Name = "NewFolderName"
        end if
  End if

Joe Ranieri [quote]Do you have NilObjectChecking turned off with a #pragma?[/quote]

No

Norman Palardy – I actually have this code above the other one that was doing that.

dim fInit as folderitem
fInit = SpecialFolder.Documents.Child(“Torrid Technologies”)

if not(fInit.exists) then
fInit.createasfolder
end if

But I will convert to a try…catch to see if that stops it from outright crashing.

For my menu item question… which got on here bc I thought it was due to setting an icon property on a menu item… that menu item is actually a subclass so I can append it to a menu for MRU purposes. What is the correct way to set an icon on a subclass MenuItem? I tried it in code and thought maybe that was what was crashing it. From the log it is not the menu but one of these file exists calls. Here is how I did that in code.
someMenuItem.icon = myIconName

Running the app in a clean user account I can see which folders it managed to create.

It’s getting farther down in the code where the app checks for Application Support folder
and tries to rename it. Does that require special permissions for the App to do that?

If I manually try to rename the folder is asks me to type in the account password.
So does that mean in code it can’t rename it?
I added a try catch to that in the code and it still crashes without any messages from my exception handling.

That would be a good guess
Why do you want to rename it ?

It uses old app name. If I switch installers to new app name for folders too,
prior users who upgrade won’t have their preferences read in.

Sooo was thinking I would try to rename old folder name to new folder name
and then upgraders will be happy.

Maybe I should do that in my installer instead.

I would

Or just have the app read from old preferences if it exists and there’s no new one
Then only write to the new one

That way IF they happen to want to use the old app it will still work since its old preferences will still be there
Kind of like our users do that want to be able to use the latest + old versions
Removing or renaming things would break that

I finally figure this one out and it was more related to a data file not getting created than any “permissions” issue.

Thanks for everyone who helped.