[Bug c++/57426] Application core dumps at __gnu_cxx::__exchange_and_add

rajagopal.maddi at plintron dot com gcc-bugzilla@gcc.gnu.org
Mon May 27 07:10:00 GMT 2013


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57426

--- Comment #2 from RajaGopal <rajagopal.maddi at plintron dot com> ---
(In reply to Andrew Pinski from comment #1)
> It is not __exchange_and_add which causing the abort but rather
> TdrData::~TdrData which is not part of libstdc++ code.
> __gnu_cxx::__exchange_and_add is inlined into TdrData::~TdrData which is why
> gdb and the line numbers are a bit off for the abort.



The TdrData structure is as below:

#define TDR_COMMON_MAX_PARAMS        10
#define TDR_APPLICATION_MAX_PARAMS   90

class TdrData
{
   public:
      string m_HDR[TDR_COMMON_MAX_PARAMS];
      string m_CDR[TDR_APPLICATION_MAX_PARAMS];
      TdrData();
      ~TdrData();

      void setChar(int , s8 );
      void setInteger(int , s32 );
      void setString(int , s8* );
      void setHex(int , s8* , u16 );

      //The functions below shall set the Header Data
      void setOpCode(u16 );
      void setMapVersion(u16 );
      void setRemoteAddr(s8* );
      void setTdrId();
      void setRemoteAddrSsn(int );
      void setOriginatingModule(char *);
      void setContextId(char *);
};

The TdrData constructor and destructor are defined as below:

TdrData::TdrData()
{
}

TdrData::~TdrData()
{
}


The following piece of code gets executed in the code multiple times. The m_tdr
is of type TdrData. m_tdr is newed at the application startup. The below code
gets executed at run-time almost once for processing a message. The system
dumps core upon the execution of the "delete(m_tdr)". Please let us know what
can be the issue.

if(NULL != m_tdr)
   delete(m_tdr);
m_tdr = new TdrData;



More information about the Gcc-bugs mailing list