Complete.Org: Mailing Lists: Archives: linux-help: June 2003:
[linux-help] Re: core dump
Home

[linux-help] Re: core dump

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: linux-help@xxxxxxxxx
Subject: [linux-help] Re: core dump
From: Jeff Vian <jvian10@xxxxxxxxxxx>
Date: Sat, 07 Jun 2003 01:49:06 -0500
Reply-to: linux-help@xxxxxxxxx

This may or may not create the core dump depending upon the circumstances.
Since you have no control over what data is being overwritten, it may 
not even crash.

If the space being overwritten is simply unused memory, the crash may 
not occur.
If the space is process code the effects will be different.
If the space is stack used by a different application the effects will 
be different yet.

If the goal is to deliberately create a crash and core dump you need to 
have some idea of what the effects of the out-of-bounds array addressing 
will be.

I compiled it and it segfaults, but does not core dump for me either.


Sudharsha Wijesinghe wrote:

>sorry
>the code should be
>int main(){
>int buff[4096],i;
>for(i=0;i<8000;i++)
>buff[i]=i;
>return 0;
>}
>the intention here is for the program to crash and to
>create a core dump.
>in my case the program crashes but does not create a
>core dump.
>Thanks 
>Sudharsha.
>--- Tom Hull <thull2@xxxxxxx> wrote:
>  
>
>>Sudharsha Wijesinghe wrote:
>>    
>>
>>>I wrote the following code 
>>>int void main()
>>>{
>>>int buff[4096],i;
>>>for(i=0;i<8000;i++)
>>>buff[i]=i;
>>>return 0;
>>>}
>>>and compliled it with gcc 
>>>executable file created.
>>>when I run it
>>>#./a.out
>>>I would get a segment fault
>>>it does not create a core dump.
>>>Does any one know why it is?
>>>Thanks in advance
>>>Sudharsha.
>>>      
>>>
>>Of course. Is this a test, or just a joke?
>>
>>The code won't compile because you say: int void
>>main().
>>Get rid of the void. You're returning a value from
>>the
>>function so the function isn't void -- it returns a
>>value.
>>
>>Also change 4096 to 8000, or 8000 to 4096. Then
>>figure
>>out why that works and what you had didn't.
>>
>>-- 
>>/*
>>  *  Tom Hull * thull2(cox.net) *
>>http://www.tomhull.com/
>>  */
>>
>>-- This is the linux-help@xxxxxxxxx list.  To
>>unsubscribe,
>>visit
>>http://www.complete.org/cgi-bin/listargate-aclug.cgi
>>
>>    
>>
>
>
>__________________________________
>Do you Yahoo!?
>Yahoo! Calendar - Free online calendar with sync to Outlook(TM).
>http://calendar.yahoo.com
>-- This is the linux-help@xxxxxxxxx list.  To unsubscribe,
>visit http://www.complete.org/cgi-bin/listargate-aclug.cgi
>
>  
>


-- This is the linux-help@xxxxxxxxx list.  To unsubscribe,
visit http://www.complete.org/cgi-bin/listargate-aclug.cgi


[Prev in Thread] Current Thread [Next in Thread]