[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Sheflug] Re: [Sheflug - Sheffield Linux User's Group] Re:Segfaults & ld.so wierditude
On Tue, 2 May 2000, Bob Ham wrote:
> I was under the impression that a segfault was given when an instruction
> tries to write to a piece of memory it's not allowed to. Surely I'm not
Technically, no. The segfault occurs when a memory address can't be
resolved to a physical address in memory, even after checking swapped out
pages.
> allowed to write over malloc()'s hosuekeeping data?
Where else is malloc() going to keep it's data? You've got to remember that
malloc() is within the purvue of the process, and doesn't have access to any
memory that any code that you write doesn't have access to (mprotect not
withstanding).
> > >> Have you tried Electric Fence and cousins?
> >
> > Bob> Never heard of it; care to expand on that?
Immediately segfaults on any access to a memory area not allocated to the
process' data area. This is useful because a process can usually fiddle
with data that it hasn't allocated, but is still in the current memory page.
With this you can determine the instruction that is writing somewhere it
shouldn't, because running the program in a debugger, the segfault will
allow you to do a bt and find out the call chain.
--
-----------------------------------------------------------------------
#include <disclaimer.h>
Matthew Palmer
mjp16@uow.edu.au
> >
> > Standard package in all the distributions AFAIK (Debian and
> > TurboLinux, anyway). Replaces malloc and automatically watches all
> > pointers amlloced for evil behavior.
>
> I'll check it out, cheers.
>
> Bob
>
> --
> Bob Ham: bob [at] timecity.org http://flux.mentaltempt.org/~node/
> IRC: 'Bob' on irc.openprojects.net: #Slashdot #TimeCity
> ICQ: 4396425 'The Tek' & 27699423 'The Tek.'
>
> Time City Level Designer
> Time City: http://www.timecity.org/
> My work: http://flux.mentaltempt.org/~node/tc/
>
> This email is Copyright (C) 2000 Robert Ham. Copyright is protected in law
> in the UK and by treaty in other countries. Permission to reproduce is
> strictly forbidden. If you wish to reproduce this email's content, please
> apply by email to bob [at] timecity.org.
>
> ---------------------------------------------------------------------
> Sheffield Linux User's Group - http://www.sheflug.co.uk
> To unsubscribe from this list send mail to
> - <sheflug-request [at] vuw.ac.nz> - with the word
> "unsubscribe" in the body of the message.
>
> GNU the choice of a complete generation.
>
>
--
-----------------------------------------------------------------------
#include <disclaimer.h>
Matthew Palmer
mjp16@uow.edu.au
---------------------------------------------------------------------
Sheffield Linux User's Group - http://www.sheflug.co.uk
To unsubscribe from this list send mail to
- <sheflug-request [at] vuw.ac.nz> - with the word
"unsubscribe" in the body of the message.
GNU the choice of a complete generation.