[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: creating a segfault in a translator (on purpose)

From: Marcus Brinkmann
Subject: Re: creating a segfault in a translator (on purpose)
Date: Wed, 5 Feb 2003 19:16:52 +0100
User-agent: Mutt/1.5.3i

On Wed, Feb 05, 2003 at 10:06:20AM -0800, Greg Buchholz wrote:
> I've been reading the Hurd Hacking Guide since I am
> interested in making some of my own translators.  When
> I came across the trivfs example, I was quite
> perplexed about the trivfs_S_io_read section in which
> you mmap a buffer for the data, but you don't have to
> free it.  So I scoured the 'Net, and found out that
> this is the way it is supposed to work; someone else
> will free the memory for me.

Yes, this is part of interface definition.

> Then my devious mind
> asked, "what happens if I pass back a pointer that
> can't be freed?"  Say I use alloca or automatic
> arrays, what happens then?

You are shooting yourself in the foot :)

> Well, it turns out that
> the translator dies (no surprise) with the message
> "Resource Lost".  What you also get is a 16MB core
> file (from the server that tried to free the memory, I
> presume), along with a flaky system that has a
> tendency to reboot itself within a couple of minutes,
> if not immediately.

Yes, the core dump implementation is broken and crashes the system.  This
has to be fixed.  It is unrelated to the buffer exchange issue.  Any core
dump makes the system unstable.


`Rhubarb is no Egyptian god.' GNU
Marcus Brinkmann              The Hurd

reply via email to

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