Error when executing CosStd/examples/ex01
mingodad opened this issue · comments
*** functional sum (repeat + eval)
COS-Info [23583]: exiting with uncaught exception ExBadMessage 'gcopy(FunExpr2)' thrown at (src/Any.c:140)
Same here.
I get this error on cygwin64/win7 with the current git. I have no idea how to start tracking this down. Running under gdb was not particularly helpful---although I'm no expert. Are there any tips or practices that were learned during the development and implementation of COS on how to start debugging this type of problem?
A few comments and printf's and I've narrowed the problem lines to:
OBJ inc = gautoRelease(aFunctor(gaddTo,0,aInt(1))); // error here
in the sum_rep()
and sum_itr()
routines.
For the sum_oop()
routine, there is a SEGV at this line:
I32 x = gint(greduce1(xs,aFunctor(gaddTo,0,0),aInt(0))); // crashes here
I don't know how to debug this type of problem. I've been working through the code for main.c manually to try to understand how COS is working and where the problems happen. Suggestions welcome.
The functors need to be reviewed, I think they are overdesigned and should be simplified.