[aspectc-user] segmentation fault

Olaf Spinczyk Olaf.Spinczyk at informatik.uni-erlangen.de
Fri Sep 23 14:02:12 CEST 2005


Hello Francisco,

I don't see any problem in the code or the command line. It would be 
very helpful if you could strip down your application as far as 
possible, i.e. to remove all files and code fragments that are not 
needed to reproduce the crash. With a minimal example I would try to fix 
the problem prior to the next release date. Maybe I could also tell you 
another workaround for 0.9.3.

BTW, does is also help to reorder the -I options?

Olaf

Francisco Afonso wrote:
> Hi,
> 
> I have got a segmentation fault when weaving my project.
> 
> I have the following structure:
> 
> - aop // has the aspect file (logging.ah)
>   - include // include files from base code
>   - src         // source files  from base code
>   - aspect  //  include and source files used by only by aspects
> 
> The aspect directory contains only the files LogManager.h and 
> LogManager.cc that define the LogManager class. This class needs to use 
> some functionality from base code.
> 
> That  is logging.ah:
> 
> //------------------------------------------------
> #ifndef __logging_ah__
> #define __logging_ah__
> 
> #include <stdio.h>
> #include "os.h"
> #include "LogManager.h"
> 
> aspect Logging {
> public:
>   LogManager logManager;
> 
>   pointcut log1 () =
>     execution ("% ...::Thread::restart(...)");
> 
>   advice log1 () : before()  {
>        logManager.writeTimeEvent("before %s target=%s",
>                                   JoinPoint::signature(),
>                                   tjp->target()->myName);
>   }
> };
> #endif
> //----------------------------------------------------------------------
> 
> My weaving script is:
> ~/aspect/ac-0.9.3/ac++ -v1 --config ~/aspect/ac-0.9.3/puma.config -I 
> ./aspect -I ./include/support -I ./include  -p . -d ../aop-out
> 
> The result is:
> * Running ac++ 0.9.3
> * Simple Dependency Check
> * Handling Translation Unit `LogManager.cc'.
> * Handling Translation Unit `LogWriter.cc'.
> * Handling Translation Unit `MailBox.cc'.
> * Handling Translation Unit `Message.cc'.
> ./weave: line 6:  5817 Segmentation fault      ~/aspect/ac-0.9.3/ac++ 
> -v1 --config ~/aspect/ac-0.9.3/puma.config -I ./aspect -I 
> ./include/support -I ./include -p . -d ../aop-out
> 
> I noticed that weaver runs without errors if:
> a) I move the logging.ah file to the /aspect directory or
> a) I rename the "aspect" directory to "xaspect", so that the base code 
> is handled first by the weaver.
> 
> Does anyone has a clue about what is happening?
> 
> Francisco




More information about the aspectc-user mailing list