473,395 Members | 1,393 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Please help me for segmentation fault

Hi,

I am facing a segmentation fault in my program.
I am using C++, SunOS-5.6. I am debugging the application using dbx.
Here I am pasting a portion.


Ccy:KRW
Gbo Ccy:
t@1 (l@1) signal SEGV (no mapping at the fault address) in dmgDocRecuresList at 0xec4af5d0
dmgDocRecuresList+0x644: ld [%g3 + %g2], %g3
(dbx) where
=>[1] dmgDocRecuresList(0xefff92bc
, 0xee78d0ec, 0xefff930c, 0x0, 0x2, 0xefff9304), at 0xec4af5d0
[2] dmgDocRecuresList(0xefff92bc, 0x18, 0xefff930c, 0x58d430, 0x2, 0xefff9304), at 0xec4af3bc
[3] compareTradeChanges(0xec6ef4cd, 0xec6f2174, 0xec7a9620, 0xee776964, 0x0, 0x0), at 0xec6cee6c
[4] RejectAmendFieldCheck(0xee6d1968, 0xefff97c8, 0xee776964, 0xee7805c4, 0x8, 0x0), at 0xec6cca20
[5] dmgDocumentDo(0xefff95c4, 0x31660, 0x0, 0x1, 0x2, 0x345e28), at 0xec6cdcb8
[6] GenerateDocument(0x0, 0x31630, 0x3, 0xee78d0ec, 0xee6ae294, 0x31660), at 0xedda2d04
[7] ProcessAuditList(0x31680, 0x31630, 0x2, 0x95e82, 0x2008, 0x316ac), at 0xedda2a24
[8] main(0x31630, 0x0, 0x1, 0xefffa0dc, 0xee78d0ec, 0xee6ae294), at 0x11d04
(dbx) lwps
*>l@1 signal SIGSEGV in dmgDocRecuresList()
l@2 running in _signotifywait()
l@3 running in _poll()
l@4 running in _poll()
l@5 running in _door_return()
(dbx) lwp l@1
t@1 (l@1) stopped in dmgDocRecuresList at 0xec4af5d0
dmgDocRecuresList+0x644: ld [%g3 + %g2], %g3
(dbx) where
=>[1] dmgDocRecuresList(0xefff92bc, 0xee78d0ec, 0xefff930c, 0x0, 0x2, 0xefff9304), at 0xec4af5d0
[2] dmgDocRecuresList(0xefff92bc, 0x18, 0xefff930c, 0x58d430, 0x2, 0xefff9304), at 0xec4af3bc
[3] compareTradeChanges(0xec6ef4cd, 0xec6f2174, 0xec7a9620, 0xee776964, 0x0, 0x0), at 0xec6cee6c
[4] RejectAmendFieldCheck(0xee6d1968, 0xefff97c8, 0xee776964, 0xee7805c4, 0x8, 0x0), at 0xec6cca20
[5] dmgDocumentDo(0xefff95c4, 0x31660, 0x0, 0x1, 0x2, 0x345e28), at 0xec6cdcb8
[6] GenerateDocument(0x0, 0x31630, 0x3, 0xee78d0ec, 0xee6ae294, 0x31660), at 0xedda2d04
[7] ProcessAuditList(0x31680, 0x31630, 0x2, 0x95e82, 0x2008, 0x316ac), at 0xedda2a24
[8] main(0x31630, 0x0, 0x1, 0xefffa0dc, 0xee78d0ec, 0xee6ae294), at 0x11d04
(dbx) step



Here I am pasting the declaration of the function

int dmgDocRecuresList( sTRADETYPE pTradeType,
sENTITY* pCurrentEnt,
char* pCurrentData,
char* pOldData,
int* pCount,
int* pCount2,
sDATANODELIST* pDataNodeList,
sDATANODELIST* pDataNodeList2,
DMG_DOC_ACCEPT_REJECT* pRetValue,
cDOC_AMEND_LIST* pDocAmendList = NULL );

is a recursive function. That is this function calls itself according to some conditions.

I could not find what to see and where to see. Please help me.
Jun 13 '07 #1
1 1348
Hi, try allocating some memory in your main program
For instance
Expand|Select|Wrap|Line Numbers
  1. int *pCount = new int;
  2.  
but do that for all the pointers you are about to use
Don't forget to say
Expand|Select|Wrap|Line Numbers
  1.  delete pCount; 
deallocating all of the memory you allocated with the 'new' operator to prevent memory leakages
Jun 13 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: sivignon | last post by:
Hi, I'm writing a php script which deals with 3 ORACLE databases. This script is launch by a script shell on an linux machine like this : /../php/bin/php ./MySript.php (PHP 4.3.3) My script...
3
by: diyanat | last post by:
i am writing a cgi script in C using the CGIC library, the script fails to run, i am using apache on linux error report from apache : internal server error Premature end of script headers:...
6
by: damian birchler | last post by:
If I run the following I get a segmentation fault: #define NAMELEN 15 #define NPERS 10 typedef struct pers { char name; int money; } pers_t;
3
by: I_have_nothing | last post by:
Hi! I am new in C. I got a lots of "Segmentation Fault"s in my code. I guess One possibility is: if " int array_i; " is declard and the code trys to access "array_i", a Segmentation Fault will...
6
by: I_have_nothing | last post by:
Hi! I am new in C. I try to use dynamical allocation fuction malloc( ) and realloc( ). I found something strange. After several calling realloc( ), the malloc( ) will give me a Segmentation...
27
by: Paminu | last post by:
I have a wierd problem. In my main function I print "test" as the first thing. But if I run the call to node_alloc AFTER the printf call I get a segmentation fault and test is not printed! ...
7
by: pycraze | last post by:
I would like to ask a question. How do one handle the exception due to Segmentation fault due to Python ? Our bit operations and arithmetic manipulations are written in C and to some of our...
3
by: madunix | last post by:
My Server is suffering bad lag (High Utlization) I am running on that server Oracle10g with apache_1.3.35/ php-4.4.2 Web visitors retrieve data from the web by php calls through oci cobnnection...
1
by: jwlkr | last post by:
Hi, I am trying to sort a vector of a user defined type: a class which represents points in cartesian coordinates. The vector of points needs to be sorted according to the value of the...
6
by: DanielJohnson | last post by:
int main() { printf("\n Hello World"); main; return 0; } This program terminate just after one loop while the second program goes on infinitely untill segmentation fault (core dumped) on...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.