[Top][All Lists]

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

[Axiom-developer] address@hidden: Re: Executable memory: some apps that

From: Tim Daly
Subject: [Axiom-developer] address@hidden: Re: Executable memory: some apps that work on RH9 don't on FC1]
Date: Mon, 17 Nov 2003 20:33:19 -0500


------- Start of forwarded message -------
Subject: Re: Executable memory: some apps that work on RH9 don't on FC1
From: Gerard Milmeister <address@hidden>
To: address@hidden
In-Reply-To: <address@hidden>
Content-Type: text/plain; charset=iso-8859-1
Organization: Universität Zürich
X-MIME-Autoconverted: from quoted-printable to 8bit by 
id hAHKSjw12007
X-loop: address@hidden
Sender: address@hidden
X-BeenThere: address@hidden
X-Mailman-Version: 2.0.13
Precedence: junk
Reply-To: address@hidden
List-Help: <mailto:address@hidden>
List-Post: <mailto:address@hidden>
List-Subscribe: <>,
List-Id: For developers, developers, developers <>
List-Unsubscribe: <>,
List-Archive: <>
Date: Mon, 17 Nov 2003 21:28:42 +0100

On Mon, 2003-11-17 at 20:12, Roland McGrath wrote:
> > The official binary of mit-scheme 7.7.1 
> > (
> > segfaults if called with 'scheme -compiler'. In this case the scheme main
> > program load a 'band' called, which contains executable code.
> > Could somebody investigate this issue? I am not that familiar with problems
> > like this.
> If this binary was created with old tools and has no PT_GNU_STACK marker,
> then it should get executable stack by default.  More likely the issue is
> that it calls malloc and expects the memory returned to be executable.
> The Scheme runtime needs to be changed to use mmap when executability matters.

I further investigated problem using scheme-7.7.90 and found the
following. When loading a band (the runtime image), the following is

static void *
mmap_heap_malloc_1 (unsigned long requested_length, int fixedp)
  unsigned long ps = (UX_getpagesize ());
  void * addr
    = (mmap (((void *) MMAP_BASE_ADDRESS),
             (((requested_length + (ps - 1)) / ps) * ps),
             (PROT_EXEC | PROT_READ | PROT_WRITE),
             (MAP_PRIVATE | MAP_ANONYMOUS | (fixedp ? MAP_FIXED : 0)),
             /* Ignored by GNU/Linux, required by FreeBSD and Solaris.  */
  return ((addr == MAP_FAILED) ? 0 : addr);

Now for the default runtime (, requested_length == 5726028,
and the function proceeds without fault. However when the "-compiler"
switch is used to load the compiler, the runtime is loaded and
then requested_length == 18563072 (this image is much bigger) and the
mmap call results in a segfault. ps is 4096, fixedp is 1 and
Why does mmap segfault at all? Shouldn't it at worst return an error?

Hope this helps...

- -- 
Gérard Milmeister
Tannenrauchstrasse 35
8038 Zürich

- --
fedora-devel-list mailing list
------- End of forwarded message -------

reply via email to

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