[LCP]Address out of bounds error on Linux 7.3
Ajay Aggarwal
aaggarwal at lastminute.com
Tue Aug 19 20:55:02 UTC 2003
Hi,
I am getting Address out of bounds error, while running a program on Red Hat
Linux v7.3. The machine is dual processor.
I have same program running on Sun OS, on a dual processor machine and it is
working fine there.
The error comes, even before the program creates any threads (see snippet
below).
I read a previous thread on the same error and even though it does not seem
to be a a concurrency error,
I still put Mutex locks as indicated by comments in the code snippet below.
Can someone help me on this...
Thanks,
Ajay Aggarwal
typedef struct {
char* relative_link;
char* keys[MAX_KEYS];
} stack_url;
/*
* the last entry in the structure above
* will have relative_link == NULL
* Also, with in a structure where relative_link is
* a valid string, the last key will have a value == NULL
*/
stack_url *wib_urls;
main(int argc,char *argv[])
{
int threads[MAX_STACKS];
int i=0,j;
stack_data *ptr;
stack_url *myurl;
char scp_str[512];
char **kp;
char timeStamp[100];
bettyRunningSince = time(NULL);
getMyTime(timeStamp,2);
dlog(1, "\n\n==== Instance started at %s ====\n", timeStamp );
wib_urls = (stack_url *)read_http_config(HTTP_CONFIG);
/* inside the function there is a mutex lock and unlock */
fprintf(stderr, "printing http url info now \n");
/* Lock Mutex put here */
for(myurl = wib_urls; myurl->relative_link != NULL; myurl++)
{
fprintf(stderr,"URL /%s\n",myurl->relative_link);
for(kp = (myurl->keys); *kp != NULL; kp++ )
{
fprintf( stderr, " %s \n", *kp ); ----------- FAILING
ON THIS LINE AFTER FEW ITERATIONS
}
}
/* Unlock Mutex */
}
ERROR :
Breakpoint 3, main (argc=1, argv=0xbffffb84) at wibCollect.c:126
126 fprintf( stderr, " %s \n", *kp );
(gdb) print *kp
$13 = 0x259e <Address 0x259e out of bounds>
(gdb) print kp
$14 = (char **) 0x8059ec8
More information about the linuxCprogramming
mailing list