<p></p>
Oh, another question: how much do we trust the SWAP built-in? We use it a<br>
lot for simple types like integers, but I think the only places we ever use<br>
it for complex UDTs is when swapping heroes and when re-ordering menudef<br>
items in custom<br>
<br>
I remember being paranoid about SWAP... But I don't remember why.<br>
<br>
On Tue., Apr. 27, 2021, 7:55 a.m. James Paige, ***@***.***><br>
wrote:<br>
<br>
> I tried valgrind, and the crash simply didn't happen.<br>
><br>
> I'll try asan also<br>
><br>
> On Mon., Apr. 26, 2021, 11:41 p.m. Ralph Versteegen, <<br>
> ***@***.***> wrote:<br>
><br>
>> Sounds like it could be a dangling pointer.<br>
>><br>
>> Can you use valgrind or asan (AddressSanitizer)?<br>
>><br>
>> I have a lot of poor luck with valgrind, sometimes I can't really get it<br>
>> to<br>
>> work, and it's a pain that I always have to spend a long time updating<br>
>> misc/valgrind_suppressions.txt after having upgraded parts of my OS.<br>
>><br>
>> asan doesn't seem to have that problem. To use asan compile with "scons<br>
>> asan=1", which compiles in memory error checking into C code (it forces<br>
>> gengcc=1). Like valgrind, asan can report reads/writes off the end of<br>
>> allocated memory or access to freed memory.<br>
>><br>
>> On Tue, 27 Apr 2021 at 09:04, James Paige ***@***.***> wrote:<br>
>><br>
>> > This is a tricky one!<br>
>> > I have a test case that crashes on this, but very tiny seemingly<br>
>> > irrelevant changes to the source code can prevent the crash from<br>
>> happening.<br>
>> ><br>
>> > For example, if I comment out everything in the implementation of<br>
>> "camera<br>
>> > follows hero" in scriptcommands.bas then the crash doesn't happen. Or<br>
>> if I<br>
>> > add debug comments inside update_HeroSliceContext() then the crash<br>
>> doesn't<br>
>> > happen.<br>
>> ><br>
>> > I assume memory is being corrupted and that these small changes are<br>
>> > altering the layout of the corrupted memory just enough to prevent the<br>
>> crash<br>
>> ><br>
>> > —<br>
>> > You are receiving this because you authored the thread.<br>
>> > Reply to this email directly, view it on GitHub<br>
>> > <<br>
>> https://github.com/ohrrpgce/ohrrpgce/issues/1137#issuecomment-827145908>,<br>
>> > or unsubscribe<br>
>> > <<br>
>> https://github.com/notifications/unsubscribe-auth/AAI4RCPDTPZQDR4HKXLFRN3TKXIPBANCNFSM4O7TTNZA<br>
>> ><br>
>> > .<br>
>> ><br>
>><br>
>> —<br>
>> You are receiving this because you commented.<br>
>> Reply to this email directly, view it on GitHub<br>
>> <https://github.com/ohrrpgce/ohrrpgce/issues/1137#issuecomment-827290304>,<br>
>> or unsubscribe<br>
>> <https://github.com/notifications/unsubscribe-auth/AA2IR6LF43VQQHP3MFVJEP3TKYW5RANCNFSM4O7TTNZA><br>
>> .<br>
>><br>
><br>


<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-827550749">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AMWGWZWS3R4CY6FMZYN6XIDTK2RNLANCNFSM4O7TTNZA">unsubscribe</a>.<img src="https://github.com/notifications/beacon/AMWGWZQ7RLOFI2I3R5XPSXTTK2RNLA5CNFSM4O7TTNZKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOGFJWYHI.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-827550749",
"url": "https://github.com/ohrrpgce/ohrrpgce/issues/1137#issuecomment-827550749",
"name": "View Issue"
},
"description": "View this Issue on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>