Re: will the memory allocated by malloc get released when program exits?
- From: Lawrence Kirby <lknews@xxxxxxxxxxxxxxx>
- Date: Wed, 06 Jul 2005 13:44:36 +0100
On Tue, 05 Jul 2005 15:54:07 -0700, Mark F. Haigh wrote:
>...
> Let's examine for a moment how one can come across a SIGSEGV:
>
> 1. Through undefined behavior leading to "an invalid access
> to storage" (C99 7.14#3), although such conditions are not
> required to be detected (C99 7.14#4).
>
> 2. As a result of calling raise (or other POSIX or system-
> specific functions, e.g. kill).
....
> Users of POSIX-compliant systems may be able to differentiate #1 from
> #2 via the si_code member of siginfo_t.
What's the point? If something causes a SIGSEGV using raise or POSIX kill
then presumably it wants the code to act as if a segmentation fault (or
whatever on the system causes it) had occurred. If it wanted it to act in
some other way it would make more sense to use a different signal.
Lawrence
.
- Follow-Ups:
- Re: will the memory allocated by malloc get released when program exits?
- From: Mark F. Haigh
- Re: will the memory allocated by malloc get released when program exits?
- References:
- will the memory allocated by malloc get released when program exits?
- From: keredil
- Re: will the memory allocated by malloc get released when program exits?
- From: Malcolm
- Re: will the memory allocated by malloc get released when program exits?
- From: Mark F. Haigh
- Re: will the memory allocated by malloc get released when program exits?
- From: Walter Roberson
- Re: will the memory allocated by malloc get released when program exits?
- From: Mark F. Haigh
- will the memory allocated by malloc get released when program exits?
- Prev by Date: Re: will the memory allocated by malloc get released when program exits?
- Next by Date: Re: Help w/ "incomplete type" error
- Previous by thread: Re: will the memory allocated by malloc get released when program exits?
- Next by thread: Re: will the memory allocated by malloc get released when program exits?
- Index(es):