[aspectc-user] segmentation fault

Francisco Afonso afonsofc at hotmail.com
Fri Sep 23 13:48:23 CEST 2005


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