calibumm
13th July 2004, 05:26 AM
One kind of never wants to see a coredump file when programming, However I came across something a bit odd when using Fedora Core1 and gcc(g++).
When working on a c++ program, the thing faulted, segmentation fault to be precise.
However, it left no core file to debug with.
So, I made a little prog. that would for SURE dump and should have left a file.
ex.
#include<stdio.h>
#include<stdlib.h>
#define BIGNUM 5000
void index_to(int ary[]);
int main(void)
{
int intary[10];
index_to(intary);
exit(EXIT_SUCCESS);
}
void index_to(int ary[])
{
int i;
for(i=1; i<BIGNUM;i++)
ary[i] = i;
}
i compiled the code as gcc -g test.c -o test. It gave nothing, when i executed ./test
I compiled the exact same prog on an AIX machine and it gave me a Segmentation Fault(coredump) and left a core file to play w/.
Whats up w/ my gcc/g++?
I tried to remove the gcc and glibc and all its dependancies but ti wouldnt' let me. rpm -e gcc 2-3.x.x.x right?
Whats even weirder is I ran gdb w/ the prog above and it said it executed correctly.
WHAT??!!
Any suggestions? Before i try another distro... :(
When working on a c++ program, the thing faulted, segmentation fault to be precise.
However, it left no core file to debug with.
So, I made a little prog. that would for SURE dump and should have left a file.
ex.
#include<stdio.h>
#include<stdlib.h>
#define BIGNUM 5000
void index_to(int ary[]);
int main(void)
{
int intary[10];
index_to(intary);
exit(EXIT_SUCCESS);
}
void index_to(int ary[])
{
int i;
for(i=1; i<BIGNUM;i++)
ary[i] = i;
}
i compiled the code as gcc -g test.c -o test. It gave nothing, when i executed ./test
I compiled the exact same prog on an AIX machine and it gave me a Segmentation Fault(coredump) and left a core file to play w/.
Whats up w/ my gcc/g++?
I tried to remove the gcc and glibc and all its dependancies but ti wouldnt' let me. rpm -e gcc 2-3.x.x.x right?
Whats even weirder is I ran gdb w/ the prog above and it said it executed correctly.
WHAT??!!
Any suggestions? Before i try another distro... :(