Unix system crashing - Need help to identify the issue


 
Thread Tools Search this Thread
Top Forums Programming Unix system crashing - Need help to identify the issue
# 1  
Old 04-26-2011
Unix system crashing - Need help to identify the issue

Hi,
We are accessing our remote webserver using libcurl.We are using GET method to post the request.The request is a simplified URL.We will receive XML Response for the URL request.
Problem
For Few Scenarios, response for the URL request is received & our component is killed abruptly. Can anyone pls help me what would be the reason for this issue at the earliest.
I have attached the core dump below which will help to track the issue clearly.


core dump: :
Code:
fe2d65e0 _malloc_unlocked (800, 0, 6582f8, fe2d63a0, 6ed718, 0) + 230
fe2d6394 malloc (800, 1, e8070, fec574e0, fe3be3c0, fe3c85b8) + 4c
fec574e0 __1c2n6FI_pv_ (800, 1c, e8070, 15540, fec6c9f8, fe3c85b8) + 2c
fe625868 __1cLxercesc_2_5RMemoryManagerImplIallocate6MI_pv_ (65018, 800, 20, b3bf08, 1, b3bf08) + 14
fe6990fc __1cLxercesc_2_5MXMLBufferMgrLbidOnBuffer6M_rn0AJXMLBuffer__ (d63dbc, fe7f0f9a, 37, 8004, 4, 37) + e4
fe6ab880 __1cLxercesc_2_5KXMLScannerLscanXMLDecl6Mkn0BJDeclTypes__v_ (d63ce8, 1, d63dbc, ea610, 0, d63d58) + 18
fe6ab658 __1cLxercesc_2_5KXMLScannerKscanProlog6M_v_ (d63ce8, 6ef458, 1, 7, 1, 1a273f8) + c8
fe611d84 __1cLxercesc_2_5MIGXMLScannerMscanDocument6Mrkn0ALInputSource__v_ (d63ce8, 0, fe611d3c, 0, 18c, fee726fc) + 48
fe594c04 __1cLxercesc_2_5RAbstractDOMParserFparse6Mrkn0ALInputSource__v_ (19e758, fb1fb080, 4f9, 26f308, d63ce8, 65018) + 8c
fee20bb8 __1cKXMLWrapperQXMLWrapperCommon6MpnHLogging_pnMHttpResponse__v_ (19e750, 2fc, fe7c8e98, fee430b8, 0, 26f308) + 12c
fee20a34 __1cKXMLWrapper2t5B6MpnHLogging_pnMHttpResponse_nUt_requestSensitivity__v_ (19e750, e1d38, b46b08, 0, fec6c9f8, 19e750) + 94
ff244da4 __1cJCMPClientKscrRequest6MrnJRWCString_pkcpc_i_ (e36c8, fb1fb404, fb1fb414, fb1fb860, ff257664, ff2470fd) + 1d0
ff2439fc __1cJCMPClientOserviceRequest6MpknMASOF_Message_r3_i_ (e36c8, 44c, fb1fbf3c, 0, fb1fb860, fb1fb40c) + 184
feebb584 __1cRASOF_WorkDirectorLcallService6MpknMASOF_Message_r3_i_ (5a998, 2461e8, fb1fbf3c, ff258030, 2461ec, ff243878) + 1a8
feebbd88 __1cRASOF_WorkerThreadNthreadRoutine6M_v_ (5d338, feed07f0, feed0758, 0, fe027200, 1) + 80
feebbe8c workerThreadRoutine (5d338, fb1fc000, 0, 0, feebbe88, 0) + 4
fe346d4c _lwp_start (0, 0, 0, 0, 0, 0)


Last edited by Scott; 04-27-2011 at 06:57 AM.. Reason: Code tags
# 2  
Old 04-26-2011
The crash dump tells you nothing without the code.
# 3  
Old 04-26-2011
Assuming it's a SEGV, since it's in malloc() your code is almost certainly corrupting your heap.

You probably should use something like this on your code to actually find such bugs:

IBM Software - Rational Purify
# 4  
Old 04-27-2011
Please find the code sinnpet
Code:
unsigned int CMPClient::scrGetResponse(RWCString &pck, XMLWrapper *parse, DOMElement * res, char* rspBuf)
{
  //docClient SCR_SUCCESS N/A
  //docClient SCR_RES_SCR_STATUS N/A
  //docClient SCR_RES_ACCOUNT_COUNT count
  //docClient SCR_RES_1_ACCOUNT_NO listOfSearchResults[]!searchResult!billingAccountNumber
  //docClient SCR_RES_1_ACCOUNT_STATUS listOfSearchResults[]!searchResult!billingAccountNumber

  unsigned int result = SCR_SUCCESS;
  try {
    RWCString temp;

    XMLArray *accountDetailArray;
    unsigned int noOfAccountDetail = 0;
    unsigned int noOfAccountDetails = 0;
    unsigned int accountDetailOffset = 0;
    DOMElement *res2;
    const accountDetailBlockSize = SCR_RES_1_ACCOUNT_NO_LEN + SCR_RES_1_ACCOUNT_STATUS_LEN +
    SCR_RES_1_ACCOUNT_NAME_LEN;
    if (res2 = parse->getElement("listOfSearchResults",res, false)) {
      accountDetailArray = parse->getArray("listOfSearchResults!searchResult",res2);
      // ACE received the response without the account number in each search result.
      //Thus, we will be incrementing the account Detail count only if account number present
      noOfAccountDetails = accountDetailArray->numEntries();

      if ( noOfAccountDetails == 0) {
        result = SCR_NO_ACCOUNT_NUMBER_RETURNED;
      } else {
        for(int i=0;i < noOfAccountDetails && i < MAXRESULTCOUNT;i++){
          DOMElement * res1 = accountDetailArray->getEntry(i);
          RWCString AccountNumber="";
          if(parse->getValue("billingAccountNumber", res1, AccountNumber,false)){
            AccountNumber = AccountNumber.strip(RWCString::trailing, MSG_PADDER);
          }
          RWCString AccountStatus="";
          if(parse->getValue("billingAccountStatus", res1, AccountStatus,false)) {
            AccountStatus = AccountStatus.strip(RWCString::trailing, MSG_PADDER);
          }
          RWCString Accountname="";
        if(parse->getValue("name", res1, Accountname,false)) {
          Accountname = Accountname.strip(RWCString::trailing, MSG_PADDER);
        }
        setField(rspBuf, AccountNumber, SCR_RES_1_ACCOUNT_NO_OFFSET + accountDetailOffset,
        SCR_RES_1_ACCOUNT_NO_LEN);
        setField(rspBuf, AccountStatus, SCR_RES_1_ACCOUNT_STATUS_OFFSET + accountDetailOffset,
        SCR_RES_1_ACCOUNT_STATUS_LEN);
        setField(rspBuf, Accountname, SCR_RES_1_ACCOUNT_NAME_OFFSET + accountDetailOffset,
        SCR_RES_1_ACCOUNT_NAME_LEN);
        accountDetailOffset += accountDetailBlockSize;
        noOfAccountDetail++;
      } // End of 1st For loop
      //The below block is used to identify the type of customer.
      unsigned int customerDetailOffset = 0;
      const customerDetailBlockSize = SCR_RES_1_CUSTOMER_TYPE_LEN;
    
      for(int i=0;i < noOfAccountDetails && i < MAXRESULTCOUNT;i++){
        DOMElement * res1 = accountDetailArray->getEntry(i);
        RWCString customerType="";
        RWCString TYPE="";
        if(parse->getValue("type", res1, TYPE,false)) {
          TYPE = TYPE.strip(RWCString::trailing, MSG_PADDER);
          if(TYPE == "COMPANY"){
            customerType = "B";
          }else if (TYPE == "CONSUMER"){
            customerType = "R";
          } else {
            customerType = "O";
          }
          setField(rspBuf, customerType, SCR_RES_1_CUSTOMER_TYPE_OFFSET + customerDetailOffset,
          SCR_RES_1_CUSTOMER_TYPE_LEN);
        }
        customerDetailOffset += customerDetailBlockSize;
      } //End of 2nd For loop
      setField(rspBuf, noOfAccountDetail, SCR_RES_ACCOUNT_COUNT_OFFSET, SCR_RES_ACCOUNT_COUNT_LEN);
    }
  }
}
catch (NotFound &e){
  result = ALL_MISSING_RESPONSE_FIELD; //YYY was MISSING_RESPONSE_FIELD;
  m_logger->logError ("CMPClient::scrGetResponse missing response element: %s, PCK=%s",
  e.what(), (const char *) pck);
}
return result;
}


Last edited by Scott; 04-27-2011 at 06:54 AM.. Reason: Added code tags; indentation
# 5  
Old 04-27-2011
Please use code tags to preserve indentation and make code readable.

Regards,
Alister
# 6  
Old 04-27-2011
Sorry.. I am not aware of.. Could you please tell me what do you mean by "use code tags"
# 7  
Old 04-27-2011
It means to surround your code snippets with the following markup:
Code:
(CODE)
First Line of your code snippet.
...etc...
Last Line of your code snippet.
(/CODE)

But use brackets [] instead of parentheses () around the terms CODE and /CODE.

Regards,
Alister
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to identify whether the script is in Unix format or not ?

Hi All, I have the below scenario in my environment Developers used to copy file from windows to Linux box. Some time on the copied file developers miss to run the dos2unix utility. Because of this script gets failed during the execution. Most of the failures are due to the dos2unix format... (7 Replies)
Discussion started by: kalpeer
7 Replies

2. AIX

How to Identify long running unix processes

Hi All, Need an urgent help, I have a requirement to find long running unix processes.. I have tried the below commands, but not succeed. I need to arrange the unix processess in an order of elapsed time (high to low) that runs in a system. For Eg: Consider we have 3 processes, Pid 1 pid 2... (5 Replies)
Discussion started by: mohamedirfan
5 Replies

3. UNIX for Dummies Questions & Answers

Unix System Programmer Vs. Unix System Administrator

Hi friends, I hope you are all fine and doing well. First of all, let me say that I love Unix with passion. But I have one query in my mind that is bothering me. What should I do, Unix System Administration or Unix System Programmering. Could you please tell me the difference between the two. And... (3 Replies)
Discussion started by: gabam
3 Replies

4. UNIX for Dummies Questions & Answers

Identify issues through logging in unix

I am a newbie to unix and appeared for an interview and was asked this question. If i was working for a company as a support person on an application and has to monitor the logs how would i determine if there was outage by checking the logs and where would i search for the issue initially. and... (2 Replies)
Discussion started by: praveenveerla
2 Replies

5. Solaris

Mail system Configuration issue on UNIX box

Hi, I wanted to configure a mail system on my UNIX box. For that I read a document Sun Internet Mail Server 3.5 Advanced Installation Guide: Contents which is actually quite useful document but I am not sure from where can I bring patch? Is this patch will come in any CD form which I need to run... (1 Reply)
Discussion started by: Dhruvak
1 Replies

6. UNIX for Dummies Questions & Answers

identify a customer under a UNIX server

Like many UNIX users, there is a small team that is connected to UNIX (under the same UNIX user) via putty from a Windows PC. Is there a way, once under UNIX, to know the address of the originating computer or anything that can differentiate initial users ? (7 Replies)
Discussion started by: popescu1954
7 Replies

7. Shell Programming and Scripting

how to identify the mode of the file in unix

hi, I have a requirement in that i need to process a input file The problem is, the input file sometimes it is coming in dos mode and some times it is coming in unix mode The script which i have written will process the file only if it is in unix mode and it is not processing if the file is in... (7 Replies)
Discussion started by: trichyselva
7 Replies

8. Shell Programming and Scripting

Identify records having junk characters in unix

Hi Friends, I need to have a command in Unix which output all teh records havingg junk characters in a file.... I know a command cat -tv <Filename> which opens the file and we can check for any junk character in it. But my requirement is to fetch ONLY THOSE records having junk characters.... (6 Replies)
Discussion started by: sureshg_sampat
6 Replies

9. UNIX for Advanced & Expert Users

Identify a remote machine as windows or unix

Hi, I have a IP address of the target machine.Is there is any way to find out whether it is a unix box or windows box without logging into it?. Regs Anand (5 Replies)
Discussion started by: u449064
5 Replies

10. UNIX for Dummies Questions & Answers

how does unix identify C and other language code!

Hello everyone, this question is probably simple for you ppl but i am jus a beginner and still learing. i was wondering if someone could tell me that how does unix identify different program codes in it's environment. for example, unix recognises this C code in the body of any script. how... (2 Replies)
Discussion started by: a25khan
2 Replies
Login or Register to Ask a Question