Operating System - HP-UX
1752855 Members
3746 Online
108790 Solutions
New Discussion юеВ

Re: Core dump occuring and bt points to basic_string:

 
Meenakshi Gupta
New Member

Core dump occuring and bt points to basic_string:

We have a coredump while running a shared lib. The core analysis using gdb points to the std lib string

(gdb) bt
#0 0x60000000d0cbfe10:1 in std::basic_string,std::allocator >::operator= () at /opt/aCC/include_std/rw/string_ref:258
#1 0x60000000d0db09a0:0 in CCallSession::processDCCMsg ()
at /localhome/sunku/SAC_5.4/Components/OCPPSP/code/DCC_PI/CallSession.C:4194
#2 0x60000000d0d92100:0 in CCallSession_Mgr::buildAndDispatchPPSMsg ()
at /localhome/sunku/SAC_5.4/Components/OCPPSP/code/DCC_PI/CallSession_Mgr.C:1290


At the line no. 4194
/localhome/sunku/SAC_5.4/Components/OCPPSP/code/DCC_PI/CallSession.C:4194
We are just doing an assignment
L_data_dictionary_key = "Start time";
L_data_dictionary = M_CallSessionMgr->getDataFromDictionary(L_data_dictionary_key);

where L_data_dictionary is of type T_ProtocolDataDictionary

{ CCallSession_Mgr::type_timestamp, CCallSession_Mgr::dis_type_time, 0x0408, "Start time" }



Can I get some indication as what could be the possible issue.


2 REPLIES 2
Meenakshi Gupta
New Member

Re: Core dump occuring and bt points to basic_string:

Found the issue. Actually the core was happening because memcpy was failing when trying to copy a buffer of length 255 to a variable of size 2
Dennis Handly
Acclaimed Contributor

Re: Core dump occuring and bt points to basic_string:

>the core was happening because memcpy was failing when trying to copy a buffer of length 255 to a variable of size 2

A memcpy you were doing or the one from string::operator=?