*(1)* I've implemented a routine to dig out the GC roots for a given object, |dig-out-gc-roots-graph| .
For it to work out, |##resolve-referencing-objects| needed to return weak references. Not clear about exactly why, anyhow so the last rows in it in _kernel.scm need to be:
; Download the resolved objects and return. ; We keep the references weak as to keep the interference induced by this mechanism ; on recurring resolves minimal. ; ; test: eq? as we want uniqueness to be per unique object reference. (let ((r (*make-table* weak-keys: #t test: eq?))) (let loop () (let ((object (##c-code "___RESULT = get_next_resolved_referencing_object();"))) (if object (begin (table-set! r object #t) (loop))))) r)))
because of this.
*(2)* ##resolve-referencing-objects does *not* traverse weak references, which is as it should.
Why it does not though, I must admit that I'm not clear about, as it looks to me like that __garbage_collect should be including those too.
*(3)* It happens that |dig-out-gc-roots-graph| / |##resolve-referencing-objects| makes the GC pass break, any clue why?
The GC has detected the following inconsistency during call of mark_array on line 3250 of mem.c: Memory map: msection 0: 0x00cf4028 .. 0x00d74028 .. 0x00df4028 msection 1: 0x019fc028 .. 0x01a7c028 .. 0x01afc028 msection 2: 0x01afd028 .. 0x01b7d028 .. 0x01bfd028 msection 3: 0x01bfe028 .. 0x01c7e028 .. 0x01cfe028 msection 4: 0x030e1028 .. 0x03161028 .. 0x031e1028 msection 5: 0x0422f028 .. 0x042af028 .. 0x0432f028 msection 6: 0x04acc028 .. 0x04b4c028 .. 0x04bcc028 msection 7: 0x0562b028 .. 0x056ab028 .. 0x0572b028 msection 8: 0x064df028 .. 0x0655f028 .. 0x065df028 msection 9: 0x070fa028 .. 0x0717a028 .. 0x071fa028 msection 10: 0x077ba028 .. 0x0783a028 .. 0x078ba028 msection 11: 0x07e45028 .. 0x07ec5028 .. 0x07f45028 msection 12: 0x08805028 .. 0x08885028 .. 0x08905028 msection 13: 0x0a06d028 .. 0x0a0ed028 .. 0x0a16d028 msection 14: 0x0aa5c028 .. 0x0aadc028 .. 0x0ab5c028 msection 15: 0x0ac22028 .. 0x0aca2028 .. 0x0ad22028 msection 16: 0x0b3c5028 .. 0x0b445028 .. 0x0b4c5028 msection 17: 0x0b9b6028 .. 0x0ba36028 .. 0x0bab6028 msection 18: 0x0c0ab028 .. 0x0c12b028 .. 0x0c1ab028 msection 19: 0x0c88e028 .. 0x0c90e028 .. 0x0c98e028 msection 20: 0x0df7e028 .. 0x0dffe028 .. 0x0e07e028 msection 21: 0x0ec0f028 .. 0x0ec8f028 .. 0x0ed0f028 msection 22: 0x0ef35028 .. 0x0efb5028 .. 0x0f035028 msection 23: 0x1c09a028 .. 0x1c11a028 .. 0x1c19a028 msection 24: 0x1e1ac028 .. 0x1e22c028 .. 0x1e2ac028 msection 25: 0x1e2ad028 .. 0x1e32d028 .. 0x1e3ad028 msection 115: 0x23d07028 .. 0x23d87028 .. 0x23e07028 msection 116: 0x23e08028 .. 0x23e88028 .. 0x23f08028 msection 117: 0x23f09028 .. 0x23f89028 .. 0x24009028 msection 118: 0x2400a028 .. 0x2408a028 .. 0x2410a028 msection 119: 0x2410b028 .. 0x2418b028 .. 0x2420b028 msection 120: 0x2420c028 .. 0x2428c028 .. 0x2430c028 msection 121: 0x2430d028 .. 0x2438d028 .. 0x2440d028 msection 122: 0x2440e028 .. 0x2448e028 .. 0x2450e028 msection 123: 0x2450f028 .. 0x2458f028 .. 0x2460f028 msection 124: 0x24610028 .. 0x24690028 .. 0x24710028 msection 125: 0x24711028 .. 0x24791028 .. 0x24811028 msection 126: 0x24812028 .. 0x24892028 .. 0x24912028 msection 127: 0x24913028 .. 0x24993028 .. 0x24a13028 msection 128: 0x24a14028 .. 0x24a94028 .. 0x24b14028 msection 129: 0x24b15028 .. 0x24b95028 .. 0x24c15028 msection 130: 0x24c16028 .. 0x24c96028 .. 0x24d16028 msection 131: 0x24d17028 .. 0x24d97028 .. 0x24e17028 msection 132: 0x24e18028 .. 0x24e98028 .. 0x24f18028 msection 133: 0x24f19028 .. 0x24f99028 .. 0x25019028 msection 134: 0x2501a028 .. 0x2509a028 .. 0x2511a028 msection 135: 0x2511b028 .. 0x2519b028 .. 0x2521b028 msection 136: 0x2521c028 .. 0x2529c028 .. 0x2531c028 msection 137: 0x2531d028 .. 0x2539d028 .. 0x2541d028 msection 138: 0x2541e028 .. 0x2549e028 .. 0x2551e028 msection 139: 0x2551f028 .. 0x2559f028 .. 0x2561f028 msection 140: 0x25620028 .. 0x256a0028 .. 0x25720028 msection 141: 0x25721028 .. 0x257a1028 .. 0x25821028 msection 142: 0x25822028 .. 0x258a2028 .. 0x25922028 msection 143: 0x25923028 .. 0x259a3028 .. 0x25a23028 msection 144: 0x25a24028 .. 0x25aa4028 .. 0x25b24028 msection 145: 0x25b25028 .. 0x25ba5028 .. 0x25c25028 msection 146: 0x25c26028 .. 0x25ca6028 .. 0x25d26028 msection 147: 0x25d27028 .. 0x25da7028 .. 0x25e27028 msection 148: 0x25e28028 .. 0x25ea8028 .. 0x25f28028 msection 149: 0x25f29028 .. 0x25fa9028 .. 0x26029028 msection 150: 0x2602a028 .. 0x260aa028 .. 0x2612a028 msection 151: 0x2612b028 .. 0x261ab028 .. 0x2622b028 msection 152: 0x2622c028 .. 0x262ac028 .. 0x2632c028 msection 153: 0x2632d028 .. 0x263ad028 .. 0x2642d028 msection 154: 0x2642e028 .. 0x264ae028 .. 0x2652e028 msection 155: 0x2652f028 .. 0x265af028 .. 0x2662f028 msection 156: 0x26630028 .. 0x266b0028 .. 0x26730028 msection 157: 0x26731028 .. 0x267b1028 .. 0x26831028 msection 158: 0x26832028 .. 0x268b2028 .. 0x26932028 msection 159: 0x26933028 .. 0x269b3028 .. 0x26a33028 msection 160: 0x26a34028 .. 0x26ab4028 .. 0x26b34028 msection 161: 0x26b35028 .. 0x26bb5028 .. 0x26c35028 msection 162: 0x26c36028 .. 0x26cb6028 .. 0x26d36028 msection 163: 0x26d37028 .. 0x26db7028 .. 0x26e37028 msection 164: 0x26e38028 .. 0x26eb8028 .. 0x26f38028 msection 165: 0x26f39028 .. 0x26fb9028 .. 0x27039028 msection 166: 0x2703a028 .. 0x270ba028 .. 0x2713a028 msection 167: 0x2713b028 .. 0x271bb028 .. 0x2723b028 msection 168: 0x2723c028 .. 0x272bc028 .. 0x2733c028 msection 169: 0x2733d028 .. 0x273bd028 .. 0x2743d028 msection 170: 0x2743e028 .. 0x274be028 .. 0x2753e028 msection 171: 0x2753f028 .. 0x275bf028 .. 0x2763f028 msection 172: 0x27640028 .. 0x276c0028 .. 0x27740028 msection 173: 0x27741028 .. 0x277c1028 .. 0x27841028 msection 174: 0x27842028 .. 0x278c2028 .. 0x27942028 msection 175: 0x27943028 .. 0x279c3028 .. 0x27a43028 msection 176: 0x27a44028 .. 0x27ac4028 .. 0x27b44028 msection 177: 0x27b45028 .. 0x27bc5028 .. 0x27c45028 msection 178: 0x27c46028 .. 0x27cc6028 .. 0x27d46028 msection 179: 0x27d47028 .. 0x27dc7028 .. 0x27e47028 msection 180: 0x27e48028 .. 0x27ec8028 .. 0x27f48028 msection 181: 0x27f49028 .. 0x27fc9028 .. 0x28049028 msection 182: 0x2804a028 .. 0x280ca028 .. 0x2814a028 msection 183: 0x2814b028 .. 0x281cb028 .. 0x2824b028 msection 184: 0x2824c028 .. 0x282cc028 .. 0x2834c028 msection 185: 0x2834d028 .. 0x283cd028 .. 0x2844d028 msection 186: 0x2844e028 .. 0x284ce028 .. 0x2854e028 msection 187: 0x2854f028 .. 0x285cf028 .. 0x2864f028 msection 188: 0x28650028 .. 0x286d0028 .. 0x28750028 msection 189: 0x28751028 .. 0x287d1028 .. 0x28851028 msection 190: 0x28852028 .. 0x288d2028 .. 0x28952028 msection 191: 0x28953028 .. 0x289d3028 .. 0x28a53028 msection 192: 0x28a54028 .. 0x28ad4028 .. 0x28b54028 msection 193: 0x28b55028 .. 0x28bd5028 .. 0x28c55028 msection 194: 0x28c56028 .. 0x28cd6028 .. 0x28d56028 msection 195: 0x28d57028 .. 0x28dd7028 .. 0x28e57028 msection 196: 0x28e58028 .. 0x28ed8028 .. 0x28f58028 msection 197: 0x28f59028 .. 0x28fd9028 .. 0x29059028 msection 198: 0x2905a028 .. 0x290da028 .. 0x2915a028 msection 199: 0x2915b028 .. 0x291db028 .. 0x2925b028 msection 200: 0x2925c028 .. 0x292dc028 .. 0x2935c028 msection 201: 0x2935d028 .. 0x293dd028 .. 0x2945d028 msection 202: 0x2945e028 .. 0x294de028 .. 0x2955e028 msection 203: 0x2955f028 .. 0x295df028 .. 0x2965f028 msection 204: 0x29660028 .. 0x296e0028 .. 0x29760028 msection 205: 0x29761028 .. 0x297e1028 .. 0x29861028 msection 206: 0x29862028 .. 0x298e2028 .. 0x29962028 msection 207: 0x29963028 .. 0x299e3028 .. 0x29a63028 msection 208: 0x29a64028 .. 0x29ae4028 .. 0x29b64028 msection 209: 0x29b65028 .. 0x29be5028 .. 0x29c65028 msection 210: 0x29c66028 .. 0x29ce6028 .. 0x29d66028 msection 211: 0x29d67028 .. 0x29de7028 .. 0x29e67028 msection 212: 0x29e68028 .. 0x29ee8028 .. 0x29f68028 msection 213: 0x29f69028 .. 0x29fe9028 .. 0x2a069028 msection 214: 0x2a06a028 .. 0x2a0ea028 .. 0x2a16a028 msection 215: 0x2a16b028 .. 0x2a1eb028 .. 0x2a26b028 msection 216: 0x2a26c028 .. 0x2a2ec028 .. 0x2a36c028 msection 217: 0x2a36d028 .. 0x2a3ed028 .. 0x2a46d028 msection 218: 0x2a46e028 .. 0x2a4ee028 .. 0x2a56e028 msection 219: 0x2a56f028 .. 0x2a5ef028 .. 0x2a66f028 msection 220: 0x2a670028 .. 0x2a6f0028 .. 0x2a770028 msection 221: 0x2a771028 .. 0x2a7f1028 .. 0x2a871028 msection 222: 0x2a872028 .. 0x2a8f2028 .. 0x2a972028 msection 223: 0x2a973028 .. 0x2a9f3028 .. 0x2aa73028 msection 224: 0x2aa74028 .. 0x2aaf4028 .. 0x2ab74028 msection 225: 0x2ab75028 .. 0x2abf5028 .. 0x2ac75028 msection 226: 0x2ac76028 .. 0x2acf6028 .. 0x2ad76028 msection 227: 0x2ad77028 .. 0x2adf7028 .. 0x2ae77028 msection 228: 0x2ae78028 .. 0x2aef8028 .. 0x2af78028 msection 229: 0x2af79028 .. 0x2aff9028 .. 0x2b079028 msection 230: 0x2b07a028 .. 0x2b0fa028 .. 0x2b17a028 msection 231: 0x2b17b028 .. 0x2b1fb028 .. 0x2b27b028 msection 232: 0x2b27c028 .. 0x2b2fc028 .. 0x2b37c028 msection 233: 0x2b37d028 .. 0x2b3fd028 .. 0x2b47d028 msection 234: 0x2b47e028 .. 0x2b4fe028 .. 0x2b57e028 msection 235: 0x2b57f028 .. 0x2b5ff028 .. 0x2b67f028 msection 236: 0x2b680028 .. 0x2b700028 .. 0x2b780028 msection 237: 0x2b781028 .. 0x2b801028 .. 0x2b881028 msection 238: 0x2b882028 .. 0x2b902028 .. 0x2b982028 msection 239: 0x2b983028 .. 0x2ba03028 .. 0x2ba83028 msection 354: 0x32cf6028 .. 0x32d76028 .. 0x32df6028 msection 355: 0x32df7028 .. 0x32e77028 .. 0x32ef7028 msection 356: 0x32ef8028 .. 0x32f78028 .. 0x32ff8028 msection 357: 0x32ff9028 .. 0x33079028 .. 0x330f9028 msection 358: 0x330fa028 .. 0x3317a028 .. 0x331fa028 msection 359: 0x331fb028 .. 0x3327b028 .. 0x332fb028 msection 360: 0x332fc028 .. 0x3337c028 .. 0x333fc028 msection 361: 0x333fd028 .. 0x3347d028 .. 0x334fd028 msection 362: 0x334fe028 .. 0x3357e028 .. 0x335fe028 msection 363: 0x335ff028 .. 0x3367f028 .. 0x336ff028 msection 364: 0x33700028 .. 0x33780028 .. 0x33800028 msection 365: 0x33801028 .. 0x33881028 .. 0x33901028 msection 366: 0x33902028 .. 0x33982028 .. 0x33a02028 msection 367: 0x33a03028 .. 0x33a83028 .. 0x33b03028 msection 368: 0x33b04028 .. 0x33b84028 .. 0x33c04028 msection 369: 0x33c05028 .. 0x33c85028 .. 0x33d05028 msection 370: 0x33d06028 .. 0x33d86028 .. 0x33e06028 msection 371: 0x33e07028 .. 0x33e87028 .. 0x33f07028 msection 372: 0x33f08028 .. 0x33f88028 .. 0x34008028 msection 373: 0x34009028 .. 0x34089028 .. 0x34109028 msection 374: 0x3410a028 .. 0x3418a028 .. 0x3420a028 msection 375: 0x3420b028 .. 0x3428b028 .. 0x3430b028 msection 376: 0x3430c028 .. 0x3438c028 .. 0x3440c028 msection 377: 0x3440d028 .. 0x3448d028 .. 0x3450d028 msection 378: 0x3450e028 .. 0x3458e028 .. 0x3460e028 msection 379: 0x3460f028 .. 0x3468f028 .. 0x3470f028 msection 380: 0x34710028 .. 0x34790028 .. 0x34810028 msection 381: 0x34811028 .. 0x34891028 .. 0x34911028 msection 382: 0x34912028 .. 0x34992028 .. 0x34a12028 msection 383: 0x34a13028 .. 0x34a93028 .. 0x34b13028 msection 384: 0x34b14028 .. 0x34b94028 .. 0x34c14028 msection 385: 0x34c15028 .. 0x34c95028 .. 0x34d15028 msection 386: 0x34d16028 .. 0x34d96028 .. 0x34e16028 msection 387: 0x34e17028 .. 0x34e97028 .. 0x34f17028 msection 388: 0x34f18028 .. 0x34f98028 .. 0x35018028 msection 389: 0x35019028 .. 0x35099028 .. 0x35119028 msection 390: 0x3511a028 .. 0x3519a028 .. 0x3521a028 msection 391: 0x3521b028 .. 0x3529b028 .. 0x3531b028 msection 392: 0x3531c028 .. 0x3539c028 .. 0x3541c028 msection 393: 0x3541d028 .. 0x3549d028 .. 0x3551d028 msection 394: 0x3551e028 .. 0x3559e028 .. 0x3561e028 msection 395: 0x3561f028 .. 0x3569f028 .. 0x3571f028 msection 396: 0x35720028 .. 0x357a0028 .. 0x35820028 msection 397: 0x35821028 .. 0x358a1028 .. 0x35921028 msection 398: 0x35922028 .. 0x359a2028 .. 0x35a22028 msection 399: 0x35a23028 .. 0x35aa3028 .. 0x35b23028 msection 400: 0x35b24028 .. 0x35ba4028 .. 0x35c24028 msection 401: 0x35c25028 .. 0x35ca5028 .. 0x35d25028 msection 402: 0x35d26028 .. 0x35da6028 .. 0x35e26028 msection 403: 0x35ea4028 .. 0x35f24028 .. 0x35fa4028 msection 404: 0x36009028 .. 0x36089028 .. 0x36109028 msection 405: 0x3610a028 .. 0x3618a028 .. 0x3620a028 msection 406: 0x3620b028 .. 0x3628b028 .. 0x3630b028 msection 407: 0x3630c028 .. 0x3638c028 .. 0x3640c028 msection 408: 0x3640d028 .. 0x3648d028 .. 0x3650d028 msection 409: 0x3650e028 .. 0x3658e028 .. 0x3660e028 msection 410: 0x3660f028 .. 0x3668f028 .. 0x3670f028 msection 411: 0x36710028 .. 0x36790028 .. 0x36810028 msection 412: 0x36811028 .. 0x36891028 .. 0x36911028 msection 413: 0x36912028 .. 0x36992028 .. 0x36a12028 msection 414: 0x36a13028 .. 0x36a93028 .. 0x36b13028 msection 415: 0x36b14028 .. 0x36b94028 .. 0x36c14028 msection 416: 0x36c15028 .. 0x36c95028 .. 0x36d15028 msection 417: 0x36d16028 .. 0x36d96028 .. 0x36e16028 msection 418: 0x36e17028 .. 0x36e97028 .. 0x36f17028 msection 419: 0x36f18028 .. 0x36f98028 .. 0x37018028 msection 420: 0x37019028 .. 0x37099028 .. 0x37119028 msection 421: 0x3711a028 .. 0x3719a028 .. 0x3721a028 msection 422: 0x3721b028 .. 0x3729b028 .. 0x3731b028 msection 423: 0x3731c028 .. 0x3739c028 .. 0x3741c028 msection 424: 0x3741d028 .. 0x3749d028 .. 0x3751d028 msection 425: 0x3751e028 .. 0x3759e028 .. 0x3761e028 msection 426: 0x3761f028 .. 0x3769f028 .. 0x3771f028 msection 427: 0x37720028 .. 0x377a0028 .. 0x37820028 msection 428: 0x37821028 .. 0x378a1028 .. 0x37921028 msection 429: 0x4085d028 .. 0x408dd028 .. 0x4095d028 msection 430: 0x4095e028 .. 0x409de028 .. 0x40a5e028 msection 431: 0x40a5f028 .. 0x40adf028 .. 0x40b5f028 msection 432: 0x417c8028 .. 0x41848028 .. 0x418c8028 msection 433: 0x41f25028 .. 0x41fa5028 .. 0x42025028 msection 434: 0x42026028 .. 0x420a6028 .. 0x42126028 msection 435: 0x42127028 .. 0x421a7028 .. 0x42227028 msection 436: 0x4223f028 .. 0x422bf028 .. 0x4233f028 msection 437: 0x4236b028 .. 0x423eb028 .. 0x4246b028 msection 438: 0x4250f028 .. 0x4258f028 .. 0x4260f028 alloc_msection = 0x31ce6008 stack_msection = 0x00000000 heap_msection = 0x31ce6008 scan_msection = 0x31ce6008 alloc_stack_ptr = 0x31e64e88 alloc_stack_limit = 0x31de7028 alloc_heap_limit = 0x31de6028 alloc_heap_ptr = 0x31d77548 scan_ptr = 0x31d77548 scan_msection->alloc = 0x31dd6228 The object 0x0c966cb3 should be ___MOVABLE0 body[-1] = 0x0c946091 #( #(...) PROCEDURE #(...) 53 #(...) #(...) #(...) #(...) ) body[ 0] = 0x00dd4f61 PROCEDURE body[ 1] = 0x0c946041 #( #(...) (...) ) body[ 2] = 0x000000d4 53 body[ 3] = 0x0c90eb91 #( #(...) #f #f #f #f #f #f #f ) body[ 4] = 0x0c9894a1 STRING body[ 5] = 0x00001008 1026 body[ 6] = 0x0c92ee53 ( SYMBOL . (...) ) body[ 7] = 0x00d279c1 SYMBOL body[ 8] = 0x00003000 3072 body[ 9] = 0x0c946181 #( #(...) PROCEDURE #(...) 54 #(...) #(...) #(...) #(...) ) The reference was found in a will list
|dig-out-gc-roots-graph| / |##resolve-referencing-objects| work well enough for my use, though for including them in Gambit it would be good that they're stable.
It's funny that the crash happens _during_ GC. Could it be that |##resolve-referencing-objects| picks up some object references that are so Gambit-internal that just the fact that there's a reference to it makes the GC crash?
Any thought on how fix?
2013/6/19 Mikael mikael.rcv@gmail.com
Afficher les réponses par date