<p></p>
<p>asan does a nice job of narrowing down the problem:</p>
<pre><code>=================================================================
==28631==ERROR: AddressSanitizer: heap-use-after-free on address 0x61300006b898 at pc 0x000000990baa bp 0x7fffffffc2f0 sp 0x7fffffffc2e8
READ of size 8 at 0x61300006b898 thread T0
    #0 0x990ba9 in OrphanSlice /home/james/src/ohrrpgce/slices.bas:621

0x61300006b898 is located 24 bytes inside of 368-byte region [0x61300006b880,0x61300006b9f0)
freed by thread T0 here:
    #0 0x7ffff6effa10 in free (/usr/lib/x86_64-linux-gnu/libasan.so.3+0xc1a10)
    #1 0x990829 in DeleteSlice /home/james/src/ohrrpgce/slices.bas:599
    #2 0x990a0d in DeleteSliceChildren /home/james/src/ohrrpgce/slices.bas:610
    #3 0x9906e9 in DeleteSlice /home/james/src/ohrrpgce/slices.bas:594
    #4 0x7d5c11 in REFRESH_WALKABOUT_LAYER_SORT /home/james/src/ohrrpgce/walkabouts.bas:461
    #5 0x6f351a in REFRESH_MAP_SLICE /home/james/src/ohrrpgce/game.bas:4105
    #6 0x6de43e in GMAP_UPDATES /home/james/src/ohrrpgce/game.bas:2436
    #7 0x6de66a in LOADMAP_GMAP /home/james/src/ohrrpgce/game.bas:2449
    #8 0x7b0af8 in LOADMAPSTATE_GMAP /home/james/src/ohrrpgce/yetmore2.bas:463
    #9 0x6e795d in PREPARE_MAP /home/james/src/ohrrpgce/game.bas:3104
    #10 0x6de21d in INTERPRET_SCRIPTS /home/james/src/ohrrpgce/game.bas:2417
    #11 0x70b909 in main /home/james/src/ohrrpgce/game.bas:772
    #12 0x7ffff48cb2e0 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x202e0)

previously allocated by thread T0 here:
    #0 0x7ffff6effd28 in malloc (/usr/lib/x86_64-linux-gnu/libasan.so.3+0xc1d28)
    #1 0x98f461 in NewSlice /home/james/src/ohrrpgce/slices.bas:508
    #2 0x98ebe3 in NewSliceOfType /home/james/src/ohrrpgce/slices.bas:461
    #3 0x7cfa15 in CREATE_WALKABOUT_SLICES /home/james/src/ohrrpgce/walkabouts.bas:34
    #4 0x7cfdda in CREATE_HERO_SLICES /home/james/src/ohrrpgce/walkabouts.bas:55
    #5 0x4db292 in ADDHERO /home/james/src/ohrrpgce/moresubs.rbas:130
    #6 0x508099 in GAMESTATE_PARTY_FROM_RELOAD /home/james/src/ohrrpgce/savegame.rbas:597
    #7 0x4fd572 in GAMESTATE_FROM_RELOAD /home/james/src/ohrrpgce/savegame.rbas:304
    #8 0x4fc8e6 in NEW_LOADGAME /home/james/src/ohrrpgce/savegame.rbas:268
    #9 0x4fae2c in LOADGAME /home/james/src/ohrrpgce/savegame.rbas:153
    #10 0x6cb161 in DOLOADGAME /home/james/src/ohrrpgce/game.bas:1045
    #11 0x70c8fc in main /home/james/src/ohrrpgce/game.bas:891
    #12 0x7ffff48cb2e0 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x202e0)

SUMMARY: AddressSanitizer: heap-use-after-free /home/james/src/ohrrpgce/slices.bas:621 in OrphanSlice
</code></pre>
<p>I haven't figured out what to fix yet, but this definitely narrows the search :D</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/ohrrpgce/ohrrpgce/issues/1137#issuecomment-830848221">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AMWGWZQ6TXDC5KJM5MD5TP3TLWIHRANCNFSM4O7TTNZA">unsubscribe</a>.<img src="https://github.com/notifications/beacon/AMWGWZQRGRG7ETQLOMUMSC3TLWIHRA5CNFSM4O7TTNZKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOGGC3ZXI.gif" height="1" width="1" alt="" /></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/ohrrpgce/ohrrpgce/issues/1137#issuecomment-830848221",
"url": "https://github.com/ohrrpgce/ohrrpgce/issues/1137#issuecomment-830848221",
"name": "View Issue"
},
"description": "View this Issue on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>