From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.redhat.com (mail.redhat.com [199.183.24.239]) by listman.redhat.com (Postfix) with ESMTP id 88B4F2EFB6 for ; Sun, 17 Jun 2001 20:55:21 -0400 (EDT) Received: (from mail@localhost) by mail.redhat.com (8.11.0/8.8.7) id f5I0riO06619 for axp-list@listman.redhat.com; Sun, 17 Jun 2001 20:53:44 -0400 Received: from ellpspace.math.ualberta.ca (IDENT:michal@ellpspace.math.ualberta.ca [129.128.207.67]) by mail.redhat.com (8.11.0/8.8.7) with ESMTP id f5I0rhb06614 for ; Sun, 17 Jun 2001 20:53:44 -0400 Received: (from michal@localhost) by ellpspace.math.ualberta.ca (8.9.3/8.9.3) id SAA25756 for axp-list@redhat.com; Sun, 17 Jun 2001 18:55:00 -0600 Date: Sun, 17 Jun 2001 18:55:00 -0600 From: Michal Jaegermann To: axp-list@redhat.com Subject: Re: 2.4.5-ac15 and Tru64 Netscape Message-ID: <20010617185500.B25722@ellpspace.math.ualberta.ca> References: <20010617173836.59b9bb64.ayoung@teleport.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <20010617173836.59b9bb64.ayoung@teleport.com>; from ayoung@teleport.com on Sun, Jun 17, 2001 at 05:38:36PM -0700 X-Loop: axp-list@redhat.com Sender: axp-list-admin@redhat.com Errors-To: axp-list-admin@redhat.com X-BeenThere: axp-list@redhat.com X-Mailman-Version: 2.0.1 Precedence: bulk Reply-To: axp-list@redhat.com List-Help: List-Post: List-Subscribe: , List-Id: Linux and Red Hat on Alpha processors List-Unsubscribe: , List-Archive: On Sun, Jun 17, 2001 at 05:38:36PM -0700, Alan Young wrote: > I've working on a upgrade from 2.2.19 to 2.4.5-ac15 and I've run into a > odd problem with Tru64 Netscape. It runs ok under 2.2.19. When I try > run it on 2.4.5-ac15, it aborts with the message: > > /opt/netscape/netscape: : Fatal Error: cannot map libXmu.so Ivan Kokshaysky provided a patch for this a week ago, or so. It was posted on linux-kernel list. I have no idea why it was not applied yet. You will have to ask Ivan and/or Maciej. Here it is: Date: Sat, 9 Jun 2001 14:14:45 +0400 From: Ivan Kokshaysky Subject: Re: [patch] Re: Linux 2.4.5-ac6 On Fri, Jun 08, 2001 at 06:08:46PM +0200, Maciej W. Rozycki wrote: > Still it has two loops... Ok, here is a single loop version. Ivan. --- 2.4.5-ac11/mm/mmap.c Fri Jun 8 15:59:35 2001 +++ linux/mm/mmap.c Sat Jun 9 12:50:05 2001 @@ -398,27 +398,37 @@ free_vma: static inline unsigned long arch_get_unmapped_area(struct file *filp, unsigned long addr, unsigned long len, unsigned long pgoff, unsigned long flags) { struct vm_area_struct *vma; + unsigned long addr_limit = TASK_SIZE - len; + unsigned long addr1 = 0; if (len > TASK_SIZE) return -ENOMEM; if (addr) { addr = PAGE_ALIGN(addr); - vma = find_vma(current->mm, addr); - if (TASK_SIZE - len >= addr && - (!vma || addr + len <= vma->vm_start)) - return addr; + if (addr > TASK_UNMAPPED_BASE) + addr1 = addr; + goto find_free_area; } + +default_area: addr = PAGE_ALIGN(TASK_UNMAPPED_BASE); +find_free_area: for (vma = find_vma(current->mm, addr); ; vma = vma->vm_next) { /* At this point: (!vma || addr < vma->vm_end). */ - if (TASK_SIZE - len < addr) - return -ENOMEM; + if (addr_limit < addr) + break; if (!vma || addr + len <= vma->vm_start) return addr; addr = vma->vm_end; } + if (addr1) { + /* No unmapped areas above addr; try below it */ + addr_limit = addr1; + goto default_area; + } + return -ENOMEM; } #else extern unsigned long arch_get_unmapped_area(struct file *, unsigned long, unsigned long, unsigned long, unsigned long); The problem is that without this patch a 32-bit COFF excutable is mapped incorrectly with recent changes to mmap. Michal