LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 10-25-2007, 09:19 AM   #1
dayalan_cse
Member
 
Registered: Oct 2006
Posts: 132

Rep: Reputation: 15
core-dumped


Hello,

I have question about core-dump. for eample in simple C code i am declaring a pointer but it doesnt have any pointe ( no address has been pointed to the pointer) in that case if i dereference the pointer variable i will get code-dump. In simple C code we can find the place where is core-dump and which line code-dumped but incase of bigger projects and all, how to find these kind of dereference of unallocated pointers or not assigned a valid address to the pointer.

Can anybody suggest how to find the pointer variables which is not allocated any valid address but it has been dereference some where in the code.

Thanks in advance.

Thanks,
Dayalan
 
Old 10-27-2007, 03:41 PM   #2
Mara
Moderator
 
Registered: Feb 2002
Location: Grenoble
Distribution: Debian
Posts: 9,696

Rep: Reputation: 232Reputation: 232Reputation: 232
Exactly the same way. You are able to find the point of code where it crashed. Then there's an action performed on some pointer. From that point it's easy.

On the other hand, it's much better to try to prevent such situations: when you declare a pointer, always set it to NULL and when you free() one, set it to NULL again.
 
Old 10-28-2007, 03:32 AM   #3
mudd1
LQ Newbie
 
Registered: Oct 2007
Posts: 12

Rep: Reputation: 0
Quote:
Originally Posted by dayalan_cse View Post
Can anybody suggest how to find the pointer variables which is not allocated any valid address but it has been dereference some where in the code.
ddd is a nice debugger (it's a gdb frontend) in case you don't know it yet. It answers a lot of questions by itself.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Aborted (core dumped) ashlesha Programming 3 11-05-2007 01:09 PM
segmentation fault (core dumped) - what??? Micro420 Programming 6 12-07-2006 01:03 AM
urpmi - core dumped ashamril Mandriva 0 02-26-2004 08:41 PM
Segmentation fault (core dumped) hasanaydin Linux - General 0 03-27-2002 07:47 AM
Core Dumped Nezar Linux - General 4 07-18-2001 02:29 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 09:06 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration