[aspectc-user] UINT_MAX and an Assertion Failure

Matthias Urban matthias.urban at pure-systems.com
Thu Aug 7 15:05:57 CEST 2003


Hi,

thank you for the detailed bug report.

Gary Duzan wrote:
>    As a bit of a torture test, I'm trying to add the Trace example aspect
> to the Simple/echo example of the TAO ORB. I think I've set everything up
> properly, but I still get the following output:
> 
> ===========================================================================
> ac++ -v 9 -e cpp -D_POSIX_THREADS -D_POSIX_THREAD_SAFE_FUNCTIONS -D_REENTRANT -DACE_HAS_AIO_CALLS -DACE_HAS_RAPI -DACE_HAS_EXCEPTIONS -I/home/gduzan/work/ACE_wrappers -I/home/gduzan/work/ACE_wrappers/TAO -I/usr/include/rsvp -I/home/gduzan/work/ACE_wrappers/TAO/orbsvcs -I../echo -I. -d . -p ../echo -p aspects
> * Running ac++ 0.7
> * Simple Dependency Check
>   - new or modified: ../echo/Echo_Client_i.h
>   - new or modified: ../echo/Echo_i.h
>   - new or modified: aspects/TestTrace.ah
>   - new or modified: aspects/Trace.ah
> * Handling Translation Unit `Echo_Client_i.cpp'.
>   - Path "../echo/Echo_Client_i.cpp"
> /home/gduzan/work/ACE_wrappers/ace/Basic_Types.h:126: error,: unsupported int size, must be updated for this platform!
>   - Parsing ...
>   - Weaving Introductions ...
>   - intros for TestTrace4
>   - Final checks before weaving introductions
>   - Class Join Points
>   - Weaving Advice Declarations ...
>     Trace::%a0_before
>     Trace::%a1_after
>   - Weaving Singleton Aspects ...
>   - Commiting
>   - Parsing again ...
> /home/gduzan/work/ACE_wrappers/ace/Basic_Types.h:126: error,: unsupported int size, must be updated for this platform!
>   - Changing member protections ...
>   - Weaving Join Points ...
>     Collecting Advice
>       TestTrace4: __a0_before
>         Evaluate Pointcut
>         Setting up thisJoinPoint
> ac++: ThisJoinPoint.cc:22: void ThisJoinPoint::setup (CFunctionInfo *): Assertion `func->Tree ()->NodeName () == CT_FctDef::NodeId ()' failed.
> make: *** [Echo_i.cpp] Aborted (core dumped)
> ===========================================================================
> 
>    The Basic_Types code looks like this:
> 
> ===========================================================================
> // The number of bytes in an int.
> # if !defined (ACE_SIZEOF_INT)
> #   if (UINT_MAX) == 65535U
> #     define ACE_SIZEOF_INT 2
> #   elif (UINT_MAX) == 4294967295U
> #     define ACE_SIZEOF_INT 4
> #   elif (UINT_MAX) == 18446744073709551615U
> #     define ACE_SIZEOF_INT 8
> #   else
> #     error: unsupported int size, must be updated for this platform!
> #   endif /* UINT_MAX */
> # endif /* !defined (ACE_SIZEOF_INT) */
> ===========================================================================
> 
>    I tried setting UINT_MAX in the puma.config and on the command line
> with -D, but neither one changes the result.


This is a bug in the PUMA C preprocessor that uses strtol() instead of 
strtoul() for converting large decimal numbers. It will be fixed in the 
next release (0.7.1) of AspectC++ comming very soon.


>    As for the assertion failure, I ran ac++ under gdb and got the
> following information:
> 
> ===========================================================================
> (gdb) frame 4
> #4  0x08072479 in ThisJoinPoint::setup (this=0x8a2dce8, func=0x84ce4e0)
>     at /home/gduzan/local/build/ac-sources-0.7/native/Puma/include/Puma/CObjectInfo.h:269
> 269      { return _Tree; }
> (gdb) print func->_Tree->NodeName()
> $1 = 0x81e4f03 "InitDeclarator"
> (gdb) print CT_FctDef::NodeId()
> $2 = 0x81e4e88 "FctDef"
> (gdb) 
> ===========================================================================
> 
>    If I leave out the "-p aspects" option (I've put *.ah in an aspects
> subdirectory) I still get the Basic_Types message, but it does manage
> to make it through all the translation units (weaving in nothing).


Sorry, but I can't reproduce this failure. It seems that there is a 
problematic advice declaration in your TestTrace4. I would need to take 
a look into the aspect declaration to find the reason.


Yours,
Matthias

-- 
Matthias Urban                          Phone: (+49) 0391 544569-32
pure-systems GmbH                       Fax:   (+49) 0391 544569-90




More information about the aspectc-user mailing list