This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [v3] pure.cc standardization.
- To: Benjamin Kosnik <bkoz at redhat dot com>
- Subject: Re: [v3] pure.cc standardization.
- From: Fergus Henderson <fjh at cs dot mu dot oz dot au>
- Date: Sun, 28 Jan 2001 01:11:59 +1100
- Cc: gcc-patches at gcc dot gnu dot org
- References: <200101270232.f0R2WEL09843@fillmore.constant.com>
On 26-Jan-2001, Benjamin Kosnik <bkoz@redhat.com> wrote:
>
> Is there any reason to use something besides fputs here? I can't think
> of one. If not, can this get checked in?
I think this may cause problems.
Consider the following scenario:
user's code calls malloc()
malloc() puts heap temporarily in an inconsistent state
signal arrives
signal handler invoked
signal handler calls pure virtual function
PURE_VIRTUAL_NAME called
PURE_VIRTUAL_NAME calls fputs()
fputs() calls malloc() to allocate stream buffer
malloc() dies, because heap is in an inconsistent state.
--
Fergus Henderson <fjh@cs.mu.oz.au> | "I have always known that the pursuit
| of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh> | -- the last words of T. S. Garp.