Re: Not able to debug Core, SunOS 5.10, Gdb also crash.



On Jan 30, 8:26 am, Ian Collins <ian-n...@xxxxxxxxxxx> wrote:
raxitsheth2...@xxxxxxxxxxx wrote:
I am getting core dump (of Cprogram --No C++ ), and i Try to debug the
core using gdb, GDB itself crashes and gives core.

following are the OS/GDB details

I tried both (gcc and Sun Studio's cc, but same result)

If you are using Studio cc, use dbx, not gdb.

Yes I tried both.

I come to know about one more stuff. Below program is always crash ( I
know why) but gdb/dbx is not helpful. I want to ask that is this known
gdb bug or gdb limitation. ( i am just posting to relavant group also)
here is test program, always crash, not able to use GDB. (or dont know
problem of libc etc or what,)

Below program Also crash on linux but i am able to debug the stuff.
(please note i am having different version of gdb on linux)



/*START*/

#include<stdio.h>
#include<string.h>


void f1(char *a)
{

int i;
/* Write in to a without thinking the capacity of a --*/

strcpy(a,"raxitshethraxitshethraxitshethraxitsheth");


for(i=0;i<1000;i++)
{
strcat(a,"raxitshethraxitshethraxitshethraxitsheth");
}
}


int main()
{
char a[5];
f1(a);
printf("\n Output=%s",a);
return 0;
}

/*END*/




( I am compilng/linking using normally used -g or -g3, Unfortuantely i
got so many warnings but currenty I need to Ignore compilers warning--
(I know I should not), I am **NOT** compiling for 64-bit).

Fix the warnings first, then you might be able to see the wood from the
trees.



bash-3.00$ /usr/local/bin/gcc --version
2.95.3

Very, very old.

--
Ian Collins.


--Raxit

.



Relevant Pages

  • Re: segmentation fault at the end of script
    ... >This script is launch by a script shell on an linux machine like this: ... Have you tried examining the core dump with gdb to give ... using a program that'll deliberately crash: ...
    (comp.lang.php)
  • Re: NPTL patch for linux 2.4.28
    ... I have already checked the core files size ... Please point me to NPTL patch location or the kernel SRPM if you could. ... > While debugging a simple multithreaded application using gdb linux ... exec file is newer than core file. ...
    (Linux-Kernel)
  • Re: FreeBSD 8.0-BETA2/amd64 crashes on SMP under load
    ... GNU gdb 6.1.1 [FreeBSD] ... GDB is free software, covered by the GNU General Public License, and you are ... GDB can't read core files on this machine. ...
    (freebsd-current)
  • Re: FreeBSD 8.0-BETA2/amd64 crashes on SMP under load
    ... hob% sudo kgdb -n 1 ... GNU gdb 6.1.1 ... GDB can't read core files on this machine. ... The stratum of the kgdb target was changed from highest ...
    (freebsd-current)
  • Re: solaris nscd cores
    ... I need to get better gdb output, ... Core was generated by `/usr/sbin/nscd'. ... >> Has anyone else seen core dumps from their Solaris nscd process ... >> Do You Yahoo!? ...
    (Incidents)