ReDim an array of Object (class) makes Xojo creazy

I got a crash that gives me headaches ! Xojo is not able to show the debuger, and i know it crash on an object i maybe deleted and trying to access it… but the thing, this object is used so many time so i don’t know where to look :-/ !! I also tried into Xojo 2016r1.1, got the same problem.

here a look of the Apple Crash Dump :

[code]Code Type: X86 (Native)
Parent Process: ??? [1]
Responsible: Kanjo.debug [37944]
User ID: 504

Date/Time: 2016-05-11 21:30:04.487 -0400
OS Version: Mac OS X 10.11.4 (15E65)
Report Version: 11
Anonymous UUID: 505220F1-CC27-4721-F693-68B47C65A46E

Sleep/Wake UUID: 11E4A952-DC85-4441-947B-D6B752A84AD6

Time Awake Since Boot: 420000 seconds
Time Since Wake: 11000 seconds

System Integrity Protection: enabled

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

Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0x00000000f0b3b637
Exception Note: EXC_CORPSE_NOTIFY

VM Regions Near 0xf0b3b637:
Stack 00000000bf800000-00000000c0000000 [ 8192K] rw-/rwx SM=PRV
–>
Submap 00000000ffff0000-00000000ffff1000 [ 4K] r–/r-- SM=PRV process-only VM submap

Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0 XojoFramework 0x015e1477 0x150f000 + 861303
1 XojoFramework 0x016d0af5 0x150f000 + 1841909
2 XojoFramework 0x0164efff 0x150f000 + 1310719
3 Kanjo.debug 0x0008d970 Control.__Exit%%o + 42
4 XojoFramework 0x016bccbf RuntimeUnlockObject + 818
5 XojoFramework 0x0160d8a7 0x150f000 + 1042599
6 XojoFramework 0x0160d8d3 0x150f000 + 1042643
7 XojoFramework 0x0160dd07 0x150f000 + 1043719
8 Kanjo.debug 0x00023c6f Dictionary.Clear%%o + 34
9 Kanjo.debug 0x0043f444 ORM.Create%o%oo + 13715
10 Kanjo.debug 0x0045577d ORM.Save%o%oo + 1236
11 Kanjo.debug 0x010053f8 BHSaveButton.Event_MouseUp%%oi4i4 + 2528
12 XojoFramework 0x015d5da6 0x150f000 + 814502
13 XojoFramework 0x015669db 0x150f000 + 358875
14 XojoFramework 0x01561734 0x150f000 + 337716
15 com.apple.AppKit 0x916ce668 -[NSWindow _handleMouseUpEvent:isDelayedEvent:] + 106
16 com.apple.AppKit 0x916cfc22 -[NSWindow _reallySendEvent:isDelayedEvent:] + 2303
17 com.apple.AppKit 0x9106696f -[NSWindow sendEvent:] + 567
18 XojoFramework 0x01562aa8 0x150f000 + 342696
19 com.apple.AppKit 0x90fe1cdd -[NSApplication sendEvent:] + 2919
20 XojoFramework 0x015518f3 0x150f000 + 272627
21 XojoFramework 0x01551934 0x150f000 + 272692
22 Kanjo.debug 0x001af073 Delegate.Invoke%% + 34
23 Kanjo.debug 0x00079d8c Application._CallFunctionWithExceptionHandling%%op + 248
24 XojoFramework 0x016bad36 0x150f000 + 1752374
25 XojoFramework 0x01551862 0x150f000 + 272482
26 com.apple.AppKit 0x90e34d13 -[NSApplication run] + 1159
27 XojoFramework 0x016baddc 0x150f000 + 1752540
28 XojoFramework 0x016b8f7c RuntimeRun + 49
29 Kanjo.debug 0x001678de REALbasic._RuntimeRun + 34
30 Kanjo.debug 0x010dcbb3 _Main + 295
31 Kanjo.debug 0x010d00f0 main + 36
32 Kanjo.debug 0x01111535 start + 53

Thread 1:: Dispatch queue: com.apple.libdispatch-manager
0 libsystem_kernel.dylib 0x9822c7fa kevent_qos + 10
1 libdispatch.dylib 0x9c91b7ea _dispatch_mgr_invoke + 234
2 libdispatch.dylib 0x9c91b3be _dispatch_mgr_thread + 52

Thread 2:: com.apple.NSEventThread
0 libsystem_kernel.dylib 0x9822449a mach_msg_trap + 10
1 libsystem_kernel.dylib 0x98223884 mach_msg + 68
2 com.apple.CoreFoundation 0x99d5edc6 __CFRunLoopServiceMachPort + 214
3 com.apple.CoreFoundation 0x99d5e1d1 __CFRunLoopRun + 1521
4 com.apple.CoreFoundation 0x99d5d976 CFRunLoopRunSpecific + 390
5 com.apple.CoreFoundation 0x99d5d7db CFRunLoopRunInMode + 123
6 com.apple.AppKit 0x90fa9f76 _NSEventThread + 291
7 libsystem_pthread.dylib 0x9ba98780 _pthread_body + 138
8 libsystem_pthread.dylib 0x9ba986f6 _pthread_start + 155
9 libsystem_pthread.dylib 0x9ba95f7a thread_start + 34

Thread 3:
0 libsystem_kernel.dylib 0x9822bd5e __workq_kernreturn + 10
1 libsystem_pthread.dylib 0x9ba9834b _pthread_wqthread + 1289
2 libsystem_pthread.dylib 0x9ba95f56 start_wqthread + 34

Thread 4:
0 libsystem_kernel.dylib 0x9822bd5e __workq_kernreturn + 10
1 libsystem_pthread.dylib 0x9ba9834b _pthread_wqthread + 1289
2 libsystem_pthread.dylib 0x9ba95f56 start_wqthread + 34

Thread 5:
0 libsystem_kernel.dylib 0x9822bd5e __workq_kernreturn + 10
1 libsystem_pthread.dylib 0x9ba9834b _pthread_wqthread + 1289
2 libsystem_pthread.dylib 0x9ba95f56 start_wqthread + 34

Thread 0 crashed with X86 Thread State (32-bit):
eax: 0x015e142d ebx: 0x0f4921d8 ecx: 0x01864028 edx: 0x00000000
edi: 0xf0b3b61f esi: 0x0f48d430 ebp: 0xbfffee18 esp: 0xbfffedf0
ss: 0x00000023 efl: 0x00210282 eip: 0x015e1477 cs: 0x0000001b
ds: 0x00000023 es: 0x00000023 fs: 0x00000000 gs: 0x0000000f
cr2: 0xf0b3b637

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

[/code]

EXC_CORPSE_NOTIFY is an indication that your app is talking to something that isn’t there. How do you do the saving? Try to add logging to your app to see exactly where this is happening if you can’t use the debugger.

These are the last steps in your code – that’s where I would start to go step by step in the debugger

BHSaveButton.Event_MouseUp // put a break point at the top of this event ORM.Save ORM.Create Dictionary.Clear

maybe for an object the reference count got wrong, so it’s released once too often.
So it may be interesting to know what you put in dictionary.

Christian : Other object in the dictionary…
Eli Ott : i did tried… but Xojo crash when i do that :-/
Beatrix Willius : saving …?

Somewhere there is a button, BHSaveButton, that, when pressed, causes something called ORM to invoke a Save method
reading the stack from lower numbers (frames) to higher ones reveals that sequence of calls

8 Kanjo.debug 0x00023c6f Dictionary.Clear%%o + 34
9 Kanjo.debug 0x0043f444 ORM.Create%o%oo + 13715
10 Kanjo.debug 0x0045577d ORM.Save%o%oo + 1236
11 Kanjo.debug 0x010053f8 BHSaveButton.Event_MouseUp%%oi4i4 + 2528

And somewhere in that sequence things die - badly
I’m guessing there’s a control that been closed that is trying to be reference or something

Norman : yes i know the problem, the ORM will pass about 50 to 150x on the same event, and most of the time, Xojo crash while passing on the same breaking point…

Have you tried it that way:

BHSaveButton.Event_MouseUp() BREAK // Instead of a break point on ORM.Save ORM.Save ORM.Create Dictionary.Clear End
If that works and a break point on ORM.Save crashes, then ORM is Nil.
If that does not work either, The problem might be that the BHSaveButton instance is not valid anymore (which I doubt very much).

I think i found my problem, i got an array of object (ORM) and i do a ReDim on it, and when i put back others ORMs objects in it, the Xojo Inspector show random carracter then crash

Before the Redim :

After the Redim (puting back the same data (orm) ):

Sending objects to a window make that …

Could you could file a bug report with a project and steps to reproduce?

[quote=266083:@Etienne Pilon]I think i found my problem, i got an array of object (ORM) and i do a ReDim on it, and when i put back others ORMs objects in it, the Xojo Inspector show random carracter then crash

Before the Redim :

After the Redim (puting back the same data (orm) ):
[/quote]
The images dont seem to be accessible