[CM] C Stack Unwinding

Woody Douglass wdouglass at carnegierobotics.com
Wed Nov 10 08:30:38 PST 2021


Bill,

See the attached patch which is against git revision
15849c52b4ee59eacae99a72f7486cc9f877b845. The patch keeps a jmp_buf
with each catch object, so that if a longjmp is required, it won't
return to the wrong place. It seems to work in the trivial testing i've
done, but it's very possible I've missed something.

One thing this doesn't address is cleaning up data that may exist in
functions that called s7_eval that get "jumped over" as part of the
catch process -- maybe a seperate stack of "cleanup functions" with
signature `void (*)(void *)` so 'free' could be passed?

Let me know what you think!
Thanks,
Woody

On Thu, 2021-11-04 at 06:52 -0700, bil at ccrma.Stanford.EDU wrote:
> I think these are the same bug as before (stack
> underflow) -- I didn't fix it correctly yesterday --
> will poke at it.
> 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Store-a-Jmp_Buf-with-each-catch-object-and-jump-to-i.patch
Type: text/x-patch
Size: 4390 bytes
Desc: 0001-Store-a-Jmp_Buf-with-each-catch-object-and-jump-to-i.patch
URL: <https://cm-mail.stanford.edu/pipermail/cmdist/attachments/20211110/00b94fc6/attachment.bin>


More information about the Cmdist mailing list