[aspectc-user] Segmentation fault parsing a C++ header file

jorgefm at cirsa.com jorgefm at cirsa.com
Thu Dec 15 16:07:58 CET 2005


Hi,

Yes, I have the next puma.config:

// ------ 8< -------------

--skip-bodies-non-prj
-D __puma
-D __STDC__
-D _GNU_SOURCE
-D __CHAR_BIT__=8
-D __DBL_DENORM_MIN__=4.9406564584124654e-324
-D __DBL_DIG__=15
-D __DBL_EPSILON__=2.2204460492503131e-16
-D __DBL_HAS_INFINITY__
-D __DBL_HAS_QUIET_NAN__
-D __DBL_MANT_DIG__=53
-D __DBL_MAX_10_EXP__=308
-D __DBL_MAX_EXP__=1024
-D __DBL_MAX__=1.7976931348623157e+308
-D __DBL_MIN_10_EXP__=(-307)
-D __DBL_MIN_EXP__=(-1021)
-D __DBL_MIN__=2.2250738585072014e-308
-D __DECIMAL_DIG__=21
-D __DEPRECATED
-D __ELF__
-D __EXCEPTIONS
-D __FINITE_MATH_ONLY__=0
-D __FLT_DENORM_MIN__=1.40129846e-45F
-D __FLT_DIG__=6
-D __FLT_EPSILON__=1.19209290e-7F
-D __FLT_EVAL_METHOD__=2
-D __FLT_HAS_INFINITY__
-D __FLT_HAS_QUIET_NAN__
-D __FLT_MANT_DIG__=24
-D __FLT_MAX_10_EXP__=38
-D __FLT_MAX_EXP__=128
-D __FLT_MAX__=3.40282347e+38F
-D __FLT_MIN_10_EXP__=(-37)
-D __FLT_MIN_EXP__=(-125)
-D __FLT_MIN__=1.17549435e-38F
-D __FLT_RADIX__=2
-D __GNUC_MINOR__=0
-D __GNUC_PATCHLEVEL__
-D __GNUC__=4
--gnu
-D __GNUG__=4
-D __GXX_ABI_VERSION=1002
-D __GXX_WEAK__
-D __INTMAX_MAX__=9223372036854775807LL
-D __INTMAX_TYPE__=long long int
-D __INT_MAX__=2147483647
-D __LDBL_DENORM_MIN__=3.64519953188247460253e-4951L
-D __LDBL_DIG__=18
-D __LDBL_EPSILON__=1.08420217248550443401e-19L
-D __LDBL_HAS_INFINITY__
-D __LDBL_HAS_QUIET_NAN__
-D __LDBL_MANT_DIG__=64
-D __LDBL_MAX_10_EXP__=4932
-D __LDBL_MAX_EXP__=16384
-D __LDBL_MAX__=1.18973149535723176502e+4932L
-D __LDBL_MIN_10_EXP__=(-4931)
-D __LDBL_MIN_EXP__=(-16381)
-D __LDBL_MIN__=3.36210314311209350626e-4932L
-D __LONG_LONG_MAX__=9223372036854775807LL
-D __LONG_MAX__=2147483647L
-D __NO_INLINE__
-D __PTRDIFF_TYPE__=int
--ptrdiff-type "int"
-D __REGISTER_PREFIX__
-D __SCHAR_MAX__=127
-D __SHRT_MAX__=32767
-D __SIZE_TYPE__=unsigned int
--size-type "unsigned int"
-D __STDC_HOSTED__
-D __UINTMAX_TYPE__=long long unsigned int
-D __USER_LABEL_PREFIX__
-D __VERSION__="4.0.1 (4.0.1-5mdk for Mandriva Linux release 2006.0)"
-D __WCHAR_MAX__=2147483647
-D __WCHAR_TYPE__=long int
-D __WINT_TYPE__=unsigned int
-D __cplusplus
-D __gnu_linux__
-D __i386
-D __i386__
-D __linux
-D __linux__
-D __tune_i586__
-D __tune_pentium__
-D __unix
-D __unix__
-D i386
-D linux
-D unix
-I /usr/include
-I /usr/lib/gcc/i586-mandriva-linux-gnu/4.0.1/include
-I /usr/local/include
-I /usr/lib/gcc/i586-mandriva-linux-gnu/4.0.1/../../../../include/c++/4.0.1
/backward
-I /usr/lib/gcc/i586-mandriva-linux-gnu/4.0.1/../../../../include/c++/4.0.1
/i586-mandriva-linux-gnu
-I /usr/lib/gcc/i586-mandriva-linux-gnu/4.0.1/../../../../include/c++/4.0.1

// ------ 8< -------------

This file has been generated from the ac-1.0pre1. I downloaded the 'ac-1.0
pre1.tar.gz' and
'ac-bin-linux-1.0pre1.tar.gz' file and modified the 'Puma/Makefile' to
point to the correct ac++:

AC ?= $(ROOT)/../ac++

Then, in the puma.config is generated in 'Puma/gen-release/puma.cfg' and
with 'make install'
this file is copied to /etc/puma.config.

What's your testing platform ? Mine is Mandriva 2006. In my last update to
AspectC++ 0.9.1 and
Mandrake 10.1 I had similar problems with the new compilers and libs.

Regards,
Jorge


Olaf Spinczyk <Olaf.Spinczyk at informatik.uni-erlangen.de> escribió el
15/12/2005 15:34:46:

> Hi,
>
> what about the parser configuration file (e.g. puma.config)? Do you have
> one? How did you generate it?
>
> We tested to parse the code with 1.0pre1 and with the upcomimg 1.0pre2
> and there was no crash in both tests. We believe that the problem has to
> do with your execution environment.
>
> Olaf
>
> jorgefm at cirsa.com wrote:
> > Hello,
> >
> > I've recently updated my system to Mandriva 2006, and then I've update
> > my AspectC++
> > from 0.9.1 to 1.0pre1. Mainly, I only use the Puma library to parse
some
> > headers files to
> > generate a custom CORBA idl files. With the old version it was working
> > ok, but now I
> > get segmentation faults parsing the files.
> >
> > I've tested the ccparser from the Puma/examples/ccparser directory with

> > the same
> > result.
> >
> > My test header file to parse is:
> >
> > // == IXaviText.h ==== 8< ==================
> >
> > #ifndef __ITEST_H_
> > #define __ITEST_H_
> >
> > typedef struct
> > {
> > char test1;
> > char test2;
> > char test3;
> > char test4;
> > char test5;
> > } TCrbi18nRepresentation;
> >
> > class IXaviTest
> > {
> > public:
> > virtual ~IXaviTest(){};
> > virtual bool GetBasicRepresentation( const char * country, const char *

> > lang, TCrbi18nRepresentation * repr ) = 0;
> > virtual bool SetBasicRepresentation( const char * country, const char *

> > lang, TCrbi18nRepresentation repr ) = 0;
> > };
> >
> > #endif
> >
> > // ==== 8< ==================
> >
> > Then I set my environment to generate core dumps when a segmentation
> > fault occurs:
> >
> >
> > $ ulimit -c unlimited
> >
> > $ ./ccparser IXaviTest.h
> > Starting parse process...
> > Segmentation fault (core dumped)
> >
> > $ gdb ./ccparser core.25204
> > GNU gdb 6.3-5mdk (Mandriva Linux release 2006.0)
> > Copyright 2004 Free Software Foundation, Inc.
> > GDB is free software, covered by the GNU General Public License, and
you are
> > welcome to change it and/or distribute copies of it under certain
> > conditions.
> > Type "show copying" to see the conditions.
> > There is absolutely no warranty for GDB. Type "show warranty" for
details.
> > This GDB was configured as "i586-mandriva-linux-gnu"...Using host
> > libthread_db library "/lib/tls/libthread_db.so.1".
> >
> > Reading symbols from shared object read from target memory...done.
> > Loaded system supplied DSO at 0xffffe000
> > Core was generated by `./ccparser IXaviTest.h'.
> > Program terminated with signal 11, Segmentation fault.
> >
> > warning: svr4_current_sos: Can't read pathname for load map: Error de
> > entrada/salida
> >
> > Reading symbols from /usr/lib/libstdc++.so.6...done.
> > Loaded symbols for /usr/lib/libstdc++.so.6
> > Reading symbols from /lib/tls/libm.so.6...done.
> > Loaded symbols for /lib/tls/libm.so.6
> > Reading symbols from /lib/libgcc_s.so.1...done.
> > Loaded symbols for /lib/libgcc_s.so.1
> > Reading symbols from /lib/tls/libc.so.6...done.
> > Loaded symbols for /lib/tls/libc.so.6
> > Reading symbols from /lib/ld-linux.so.2...done.
> > Loaded symbols for /lib/ld-linux.so.2
> > #0 0x0806b8e7 in Puma::CT_List::CT_List$base ()
> > (gdb) bt
> > #0 0x0806b8e7 in Puma::CT_List::CT_List$base ()
> > #1 0x080b58e5 in Puma::CBuilder::simple_name ()
> > #2 0x080d7fcb in Puma::CSyntax::identifier ()
> > #3 0x080a733e in Puma::CCSyntax::member_declarator ()
> > #4 0x080d72e7 in Puma::CSyntax::member_declarator_list ()
> > #5 0x080a2918 in Puma::CCSyntax::member_decl1 ()
> > #6 0x080aa90f in
> > Puma::TJP__ZN4Puma8CCSyntax11member_declEv_1::__action_func ()
> > #7 0x080a2822 in Puma::CCSyntax::member_decl ()
> > #8 0x080e011e in Puma::Syntax::catch_error<Puma::CSyntax> ()
> > #9 0x080e036e in
> > Puma::TJP__ZN4Puma7CSyntax11member_specEv_0::__action_func ()
> > #10 0x080dd402 in Puma::CSyntax::member_spec ()
> > #11 0x080a26d0 in Puma::CCSyntax::rule_class_spec ()
> > #12 0x080a6edb in Puma::CCSyntax::class_spec ()
> > #13 0x080d4466 in Puma::CSyntax::rule_type_spec ()
> > #14 0x080da90b in Puma::CSyntax::type_spec ()
> > #15 0x080da3a8 in Puma::CSyntax::rule_decl_spec ()
> > #16 0x080da55b in Puma::CSyntax::decl_spec ()
> > #17 0x080d4793 in Puma::CSyntax::decl_spec_seq1 ()
> > #18 0x080dfa46 in
> > Puma::TJP__ZN4Puma7CSyntax13decl_spec_seqEv_0::__action_func ()
> > #19 0x080da692 in Puma::CSyntax::decl_spec_seq ()
> > #20 0x080da2c6 in Puma::CSyntax::simple_decl ()
> > #21 0x0809e8f1 in Puma::CCSyntax::simple_decl ()
> > #22 0x080a5437 in Puma::CCSyntax::block_decl ()
> > #23 0x080a52d0 in Puma::CCSyntax::decl ()
> > #24 0x080e011e in Puma::Syntax::catch_error<Puma::CSyntax> ()
> > #25 0x080dd349 in Puma::CSyntax::decl_seq ()
> > #26 0x080dfadc in
> > Puma::TJP__ZN4Puma7CSyntax10trans_unitEv_0::__action_func ()
> > #27 0x080d8281 in Puma::CSyntax::trans_unit ()
> > #28 0x080f1cff in Puma::Syntax::run ()
> > #29 0x080f5acd in Puma::Parser::parse ()
> > #30 0x0804e389 in Puma::CCParser::parse (this=0xbfab4ee4, u=@0x818d9e8,

> > p=@0xbfac6348, m=0)
> > at
> > /home/jorge/cvs-sgd/develop/Electronica/Soft/Genesis/contrib/ac-1.
> 0pre1/Puma/gen-release/step1/inc/Puma/CCParser.h:51
> > #31 0x0804b855 in run (argc=2, argv=0xbfac6584) at ccparser.cc:112
> > #32 0x0804bd12 in main (argc=2, argv=0xbfac6584) at ccparser.cc:150
> > (gdb)
> >
> >
> > Any help is welcome!
> >
> > Best regards,
> > Jorge
> >
> >
> >
------------------------------------------------------------------------
> >
> > _______________________________________________
> > aspectc-user mailing list
> > aspectc-user at aspectc.org
> > http://www.aspectc.org/mailman/listinfo/aspectc-user
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.aspectc.org/pipermail/aspectc-user/attachments/20051215/f128c74e/attachment.html>


More information about the aspectc-user mailing list