Sponsored Content
Full Discussion: Core dump error in code
Top Forums Programming Core dump error in code Post 302559375 by uday.sena.m on Tuesday 27th of September 2011 01:41:23 AM
Old 09-27-2011
Core dump error in code

HI,
I am getting run time error when am trying to compile the following coe can any one please help me
Code:
 while (fgets(strLine, MAX_LINELEN, vobjFile) != NULL && feof(vobjFile) == 0) {
                printf("this is the first loop\n");

                while (strcmp(strLine, "BEGINTRANS\n") != 0) 
                /*printf("this is second loop\n");
                if (fgets(strLine, MAX_LINELEN, vobjFile) == NULL)
                        break;
                if(!feof(vobjFile)) break;*/
                printf("second loop ends");
                while(strcmp(strLine, "ENDTRANS\n") != 0) {
                        printf("third loop\n");

                        _ParseReplyMessage(strLine, &objCountersInMessage);//This is the place iam getting an error
                        printf("this is the end\n");

And the code of this function is

Code:
static void _ParseReplyMessage(const char *vstrLine, CountersInMessage *robjCountersInMessage)
{
        static const char *strRoutine = "_ParseReplyMessage";
        char strHHMMSS[9] = "";
        char *strTransName;
        const char *tsstr;
        char strMSS[5] = "";

        _CountersInMessageInitialize(robjCountersInMessage);
        /*_FindTransactionDetails(vstrLine, &robjFindTransDetail);*/

        if(strstr(vstrLine, "NEWOLUF2") !=0)
                tsstr = strstr( vstrLine, "Input <");
                sscanf( tsstr, "Input <%8s", strTransName);
        strcpy(robjCountersInMessage->strTransactionName, strTransName);

        tsstr=strstr(vstrLine, "Timestamp");
        sscanf(tsstr, "Timestamp <%[^>]>", strHHMMSS);
        robjCountersInMessage->intTimestamp = _ConvertTimestamp(strHHMMSS);
        if (strncmp(vstrLine, "Elapsetime", 10) == 0)
                sscanf( vstrLine, "Elapsetime <%d>",&strMSS);

}

This function is getting the error core dump

Please help me Thanks in advance.

}

Last edited by pludi; 09-27-2011 at 04:35 AM..
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

help, what is the difference between core dump and panic dump?

help, what is the difference between core dump and panic dump? (1 Reply)
Discussion started by: aileen
1 Replies

2. UNIX for Dummies Questions & Answers

core dump

does any one have read a core dump? is there any reader for that? or may i know what is the use of that core which takes sometimes memory in GBs? :) (6 Replies)
Discussion started by: sskb
6 Replies

3. Programming

about core dump

MY friends: my program under sco unix have a problem? it create a core dump file on the path when execute program , but i can't find the error of the C program ,i don't know how to see the error about my program use core, please help me or give me some suggest and what tools can use... (1 Reply)
Discussion started by: zhaohaizhou
1 Replies

4. UNIX for Advanced & Expert Users

core dump

Hi All, i am new to this forum.i want detail of reading the core file and trace the problem because of what the program get crashed.please help me.if any body knows any website or tutoril plese let me know. sudhir (6 Replies)
Discussion started by: sudhir patnaik
6 Replies

5. UNIX for Advanced & Expert Users

Core Dump

Hello all, Iam new to unix while executing java program which finely working in windows know iam testing with unix ,but in unix while executing iam getting core dump, my application is in client server environment and it is menu drivrn application on clicking options no problem but after some time... (1 Reply)
Discussion started by: vinp
1 Replies

6. Programming

core dump

how to view core dumped file using gdb and how to extract information from the coredumped file.can we get similar information from the other utilites like strace or ptrace. (2 Replies)
Discussion started by: Manabhanjan
2 Replies

7. AIX

Core dump

Hi , I want to read core dump file on AIX5.3. While i am trying to use following commands, i am getting only few lines of information. ux201p3:e46123> dbx capsWrkstnMgr core Type 'help' for help. reading symbolic information ... Segmentation fault in malloc_common.extend_brk at... (1 Reply)
Discussion started by: rps
1 Replies

8. Shell Programming and Scripting

Unable to catch the output after core dump and bus error

I have a weird situation in which the binary dumps core and gives bus error. But before dumping the core and throwing the buss error, it gives some output. unfortunately I can't grep the output before core dump db2bfd -b test.bnd maxSect 15 Bus Error (core dumped) But if I do ... (4 Replies)
Discussion started by: rakeshou
4 Replies

9. Shell Programming and Scripting

Segmentation Fault(Core Dump) Error

Hi all, I have a folder with some 28 files. I have a script file that will iteratively take one file at a time from the folder and provide an output for the input file. Till the 7th file, there was no problem but from the 8th file onwards, i got this Segmentation Fault(Core Dump) error. A file... (2 Replies)
Discussion started by: mick_000
2 Replies

10. HP-UX

Core dump in HP-UX

Hi Guys, I was wondering if somebody could give me a link to a very good source of information or document about core dump process and How to's about it. I have also googled it and found some articles myself. Thanks Messi (1 Reply)
Discussion started by: messi777
1 Replies
STRCMP(3)						   BSD Library Functions Manual 						 STRCMP(3)

NAME
strcmp, strncmp -- compare strings LIBRARY
Standard C Library (libc, -lc) SYNOPSIS
#include <string.h> int strcmp(const char *s1, const char *s2); int strncmp(const char *s1, const char *s2, size_t len); DESCRIPTION
The strcmp() and strncmp() functions lexicographically compare the nul-terminated strings s1 and s2. RETURN VALUES
The strcmp() and strncmp() return an integer greater than, equal to, or less than 0, according to whether the string s1 is greater than, equal to, or less than the string s2. The comparison is done using unsigned characters, so that '200' is greater than ''. The strncmp() compares not more than len characters. SEE ALSO
bcmp(3), memcmp(3), strcasecmp(3), strcoll(3), strxfrm(3) STANDARDS
The strcmp() and strncmp() functions conform to ANSI X3.159-1989 (``ANSI C89''). NOTES
If len is zero strncmp() returns always 0. BSD
June 4, 1993 BSD
All times are GMT -4. The time now is 10:43 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy