[CM] C Stack Unwinding

Woody Douglass wdouglass at carnegierobotics.com
Thu Nov 11 05:11:28 PST 2021


I think i may have solved the issue i mentioned below. It looks like a
catch always needs to carry a jmp_buf pointer, so that nested eval
statements are handled properly. consider the attached patch, and the C
file that tests it.

Thanks,
Woody

On Wed, 2021-11-10 at 21:23 +0000, Woody Douglass wrote:
> Cool! thanks so much!
> 
> One thing I have noticed in my testing today is that
> 
>     result1 = s7_call_with_catch(s, tag, make_func, catch);
> 
> behaves differently from
> 
>     result1 = s7_eval_c_string(s, "(catch #t bad-func error-
> handler)");
> 
> now. I suspect that one (or more) of the 
> 
>     catch_cstack(p) = NULL;
> 
> lines i added to s7.c needs to change, but i'm not sure which (all?)
> 
> I'll have more information in the morning, i'm still wrapping my head
> around it. Thanks again for merging!
> 
> -Woody
> 
> On Wed, 2021-11-10 at 13:08 -0800, bil at ccrma.Stanford.EDU wrote:
> > I merged in your changes, and they pass all my bazillion
> > tests.  One timing test is 2% slower -- callgrind
> > blames fprintf, but there is no fprintf!  I made other
> > changes, so this is probably something unrelated to
> > your code.  Thanks again for the improvement!
> > 
> 
> _______________________________________________
> Cmdist mailing list
> Cmdist at ccrma.stanford.edu
> https://cm-mail.stanford.edu/mailman/listinfo/cmdist
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-always-store-the-jump-point-with-a-catch.patch
Type: text/x-patch
Size: 6327 bytes
Desc: 0001-always-store-the-jump-point-with-a-catch.patch
URL: <https://cm-mail.stanford.edu/pipermail/cmdist/attachments/20211111/3b77047d/attachment-0002.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: testerror5.c
Type: text/x-csrc
Size: 1134 bytes
Desc: testerror5.c
URL: <https://cm-mail.stanford.edu/pipermail/cmdist/attachments/20211111/3b77047d/attachment-0003.bin>


More information about the Cmdist mailing list