how to view a core dump file


 
Thread Tools Search this Thread
Top Forums Programming how to view a core dump file
# 1  
Old 01-09-2008
how to view a core dump file

by what name does a core dump file stored???

like i wrote a test code:

//dump.c

main()
{
char *p=NULL;
printf("%s",p);
}

of course the above code will produce a segmentation fault. but i cant see any file named core in my CWD. am using SUN0S 5.9
# 2  
Old 01-09-2008
You have some very strange behavior if that causes a segfault.
# 3  
Old 01-09-2008
Quote:
Originally Posted by ramen_noodle
You have some very strange behavior if that causes a segfault.
whats so strange about it buddy. Of course trying to dereference a NULL pointer will cause a SEGMENTATION FAULT.
# 4  
Old 01-10-2008
See this article you will need "more coding" in your C program to generate core dumps.
# 5  
Old 01-10-2008
am not able to open that link. guess it has been removed. can you tell me this "do all segmentation call produce core dump". if NO, then when will a segmentation fault produce a core dump
# 6  
Old 01-10-2008
I can open that link fine. Smilie

Dereferencing a null pointer is illegal, but illegal behavior does not have guaranteed results. It may or may not cause a core dump.
# 7  
Old 01-11-2008
I'll instruct you despite your tone.
That's not an invalid memory location (your NULL pointer is a misleading term), it's a pointer to type char assigned NULL. There is a valid memory location assigned to this pointer but no additional storage has been allocated. Thus the assignment of NULL and the printing of the assignment is perfectly legal.
Code:
printf("Pointer at %p and value assigned =%s\n",&p,p);

Perhaps this is what you meant to say would segfault as it is a dereference.
Code:
printf("%c",*p);

Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Solaris

Problems in reading CORE DUMP file with dbx

I am new to UNIX. My Application is using c (.so files) and Java code. My application crashes and CORE DUMP file is generated ,which is huge. Now I want to view the CORE DUMP file to debug the application using dbx without starting process again. By only using the CORE DUMP file and dbx ,can i... (1 Reply)
Discussion started by: satde
1 Replies

2. Emergency UNIX and Linux Support

How to open the core dump file in linux?

Hi, I have got core dump stating "core.bash.29846" so i am unable to open. How to open the core dump file for further analysis? Reagards Vanitha (7 Replies)
Discussion started by: vanitham
7 Replies

3. UNIX for Dummies Questions & Answers

No core dump

my progrme complaints 'Segmentation fault'. How to let it print 'Segmentation fault(core dumped)' and generate core dump file? $ulimit unlimited (22 Replies)
Discussion started by: vistastar
22 Replies

4. Shell Programming and Scripting

Cannot generate core dump file

Segmentation fault(core dumped) but I cant find core file any where. how to make it out? I try the command:ulimit -c unlimited, I even added it to the .bashrc file.And I removed ulimit setting in /etc/init.d/function. And there's no ulimit setting in /etc/profile. And I tried sudo find /... (8 Replies)
Discussion started by: vistastar
8 Replies

5. Programming

How to use a core dump file

Hi All, May be it is a stupid question, but, I would like to know what is the advantage using a core dump file at the moment of debugging using gdb. I know a core dump has information about the state of the application when it crashed, but, what is the difference between debugging using the... (2 Replies)
Discussion started by: lagigliaivan
2 Replies

6. AIX

core dump

My application gives core dump. When i am debugging with dbx getting instructions below: pthdb_session.c, 818: 695445 PTHDB_INTERNAL (internal error) pthreaded.c, 1941: PTHDB_INTERNAL (internal error) Illegal instruction (illegal opcode) in . at 0x0 warning: Unable to access address 0x0... (1 Reply)
Discussion started by: bapi
1 Replies

7. UNIX for Dummies Questions & Answers

core dump file size

Hi All, is there any way to find out the optimal/would be size of the cor dump file generated by the system while a process got terminated abnormally? Basically we have been asked to provide the size of the core dump file being generated by the administrators who maintained the UNIX boxes.... (4 Replies)
Discussion started by: pushp.gahlot
4 Replies

8. UNIX for Advanced & Expert Users

core dump

Hi All, i am new to this forum.i want detail of reading the core file and trace the problem because of what the program get crashed.please help me.if any body knows any website or tutoril plese let me know. sudhir (6 Replies)
Discussion started by: sudhir patnaik
6 Replies

9. Programming

about core dump

MY friends: my program under sco unix have a problem? it create a core dump file on the path when execute program , but i can't find the error of the C program ,i don't know how to see the error about my program use core, please help me or give me some suggest and what tools can use... (1 Reply)
Discussion started by: zhaohaizhou
1 Replies

10. UNIX for Dummies Questions & Answers

help, what is the difference between core dump and panic dump?

help, what is the difference between core dump and panic dump? (1 Reply)
Discussion started by: aileen
1 Replies
Login or Register to Ask a Question