06-03-2009
segmantation Fault error SEGV_MAPERR - Address not mapped to object
Program received signal SIGSEGV, Segmentation fault
si_code: 1 - SEGV_MAPERR - Address not mapped to object.
0x9fffffffbe7080d0:0 in free+0xb0 () from /usr/lib/hpux64/libc.so.1
Hi ,
I have developed a class to read config file (flat file with space as a field seperator ) on plattform HP-UX B.11.23 IA 64 .
I am passing pointers to strings to a function which reads the config file and traverse line by line and retrieves value on the basis of key passed as parameter . I am getting above error .when i call this function more than once. First time call works fine but second time it fails with above error.
Please see code of the function
:
int CConfigReader::GetConfigValue(char *paramApp,string *ResultServer,string * ResultPort,string *ResultLogDir)
{
ifstream Stream (szConfigPath);
if (Stream.is_open())
{
while(!Stream.eof())
{
string buffer=NULL;
getline(Stream, buffer);
if(buffer.length() !=0)
{
if (buffer.find('#') == string::npos)
{
//ingnore the line header
printf("\n the red is %s \n",buffer);
string *pstrSplit=NULL;
int iNumWords =split(buffer, pstrSplit);
if(iNumWords != -1)
{
if (pstrSplit[0].compare(paramApp)!=0)
{
continue;
}
else
{
*ResultServer=pstrSplit[1];
*ResultPort=pstrSplit[2];
*ResultLogDir=pstrSplit[3];
printf("\n Serve-- %s Port --%s Log Directory --%s \ n",*ResultServer,*ResultPort,*ResultLogDir);
delete[] pstrSplit;
break;
}
}
else
{
cout << "Error in reading the line ";
return 1;
}
}
else
{
cout << "header line ignore it ";
}
}
else
{
cout << "empty line ignore it ";
}
}//end of while
}
else
{
cout << "unable to open the stream ";
return 1;
}
Stream.close();
return 0;
}
function call :
string tempServer;
string tempPort;
string tempLogDir;
// Install the SAP RFC functions that can be called.
CConfigReader config =CConfigReader(szConfigFile);
if (! config.GetConfigValue("MMSYNCH",&tempServer,&tempPort,&tempLogDir))
{
printf("sucessfully executed function \n");
printf("result MMSYNCH server is--> %s Port is --> %s log dir is -->%s \n",tempServer,tempPort,tempLogDir);
nPort=atoi(tempPort.c_str());
strcpy(szServer, tempServer.c_str());
strcpy(szLogDir, tempLogDir.c_str());
}
else
{
ErrorExit( table[0].ithandle, "Error in reading config file", errno);
}
Please help me in resolviong this error .
10 More Discussions You Might Find Interesting
1. Programming
Hi,
I've tried to compile a program I wrote with a Makefile, yet it returns an error:
<<<test_log>>>
itest_log.o /sr/local/bin/gcc -o test_log.o -I ../../../include -L ../../../lib -llog_mgr
sh: itest_log.o: execute permission denied
Error code 1
make: Fatal error: Command failed for... (3 Replies)
Discussion started by: Stevhp
3 Replies
2. UNIX for Dummies Questions & Answers
When i run a program in sun solaris i got core dumped with an error message as follows...
signal SEGV (no mapping at the fault address) in _malloc_unlocked at 0xfe1d44ac
0xfe1d44ac: _malloc_unlocked+0x022c: ld , %o3
Current function is GetEDBInfo
360 EXEC SQL
(dbx) where... (1 Reply)
Discussion started by: noufal
1 Replies
3. Linux
Dear All,
Need your help to rectify this error.
Recently I have upgraded my Linux server from 32 bit to 64 bit server.
OS details are
Red Hat Enterprise Linux Server release 5.3
Kernel 2.6.18-120.el5 on an x86_64
After upgradation, when i try to compile or catalog any program, it is... (2 Replies)
Discussion started by: mysmileforu
2 Replies
4. UNIX for Dummies Questions & Answers
:) Firstly Hi all!!, im NEW!! and on here hoping that someone might be able to offer me some help... i have a server that keeps crashing every few days with the error message:
PANIC KERNAL-MODE ADDRESS FAULT ON USER ADDRESS 0X14
KERNAL PAGE FAULT FROM (CS:EIP)=(100:EF71B5BD)
EAX=EF822000... (10 Replies)
Discussion started by: Twix
10 Replies
5. UNIX for Dummies Questions & Answers
I am new to PHP and UNIX. I am using Apache to do my testing on a Windows Vista machine.
I am getting this error when I am trying to connect to a web service. I did a search and did not see any posts that pertain to this.
Here is my function:
<?php
function TRECSend($a, $b, $c, $d,... (0 Replies)
Discussion started by: EddiRae
0 Replies
6. Programming
I need some help to write a C++ code that read and write the register of a sequencer. I have to make a code that relate the objects with the physical address but I am a bit confuse. Could someone suggest me how to proceed? in which parts do I split the code?
thanks (1 Reply)
Discussion started by: silviafisica
1 Replies
7. UNIX for Dummies Questions & Answers
Hello
i ve got the following error on a C servor.
signal SEGV (no mapping at the fault address)
when running in dbx
program terminated by signal SEGV (no mapping at the fault address)
0xff1d5cb4: srch_dir+0x0154: cmp %o1, %o0
Current function is _log
533 ... (4 Replies)
Discussion started by: mumuri
4 Replies
8. Programming
Hi,
I am unable to copy the cursor value into character variable which is defined in nested structure by pointer.
typedef struct aaa
{
unsigned char device_type;
unsigned char encrypt;
unsigned short rec_len;
} ABC;
typedef ABC *Pabc;
typedef struct def
{
ABC... (9 Replies)
Discussion started by: gthangav
9 Replies
9. Red Hat
Hi All,
I am new to linux and trying to install mediawiki on linux server. I have installed xampp and mediawiki on window which works absolutely fine. The redhat version i am using seems pretty old 5.1. Here is what I did so far on redhat to install mediawiki
1. installed xampp for... (0 Replies)
Discussion started by: Puvi
0 Replies
10. Programming
How to initialize an object of class say "A", with an object of type say "B".
The following code give the error message "error: conversion from âAâ to non-scalar type âBâ requested"
#include <iostream>
using namespace std;
class B;
class A{
public:
A() { cout <<"\nA()" << endl; }
... (1 Reply)
Discussion started by: techmonk
1 Replies