[aspectc-user] "Segmentation fault"

Olaf Spinczyk Olaf.Spinczyk at informatik.uni-erlangen.de
Fri Aug 5 11:46:59 CEST 2005


Hello Sylvain,

your pointcut check_invariant matches the execution of all member 
functions of setAsTree, even the introduced function invariant(). As the 
advice for the check_invariant pointcut calls invariant(), the result is 
an infinite recursion, which yields a stack overflow.

You can avoid the problem by changing the check_invariant pointcut:

pointcut check_invariant(setAsTree& s) = 
   (execution("% setAsTree::%(...)" && !"% setAsTree::invariant(...)") ||
   construction("setAsTree")) && that(s);

If invariant() calls other member functions of setAsTree, you have to 
use cflow to avoid recursive advice invocation:

pointcut check_invariant(setAsTree& s) = 
   (execution("% setAsTree::%(...)") || construction("setAsTree"))
   && that(s) && !cflow (execution ("% setAsTree::invariant(...)"));

Best regards,

Olaf

sylvain meunier wrote:
> Hello,
>    when i execute my project, i obtain a "Segmentation fault", i think 
> this is a ac++ generated code error.
>    How can i avoid this problem ? ( see setastree.zip for project files )
>
>    I use the 0.9.2 ac++ version with CL ( microsoft .net 2003 ).
>
> Best regards
>
> Sylvain Meunier
>------------------------------------------------------------------------
>
>_______________________________________________
>aspectc-user mailing list
>aspectc-user at aspectc.org
>http://www.aspectc.org/mailman/listinfo/aspectc-user
>  




More information about the aspectc-user mailing list