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

jorgefm at cirsa.com jorgefm at cirsa.com
Thu Dec 15 12:37:06 CET 2005


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.0
pre1/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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.aspectc.org/pipermail/aspectc-user/attachments/20051215/2f556784/attachment.html>


More information about the aspectc-user mailing list