Red Hat axp-list: Linux on Alpha (1995-2022)
 help / color / mirror / Atom feed
From: Michal Jaegermann <michal@ellpspace.math.ualberta.ca>
To: axp-list@redhat.com
Subject: Re: 2.4.5-ac15 and Tru64 Netscape
Date: Sun, 17 Jun 2001 18:55:00 -0600	[thread overview]
Message-ID: <20010617185500.B25722@ellpspace.math.ualberta.ca> (raw)
In-Reply-To: <20010617173836.59b9bb64.ayoung@teleport.com>; from ayoung@teleport.com on Sun, Jun 17, 2001 at 05:38:36PM -0700

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 <ink@jurassic.park.msu.ru>
 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




  reply	other threads:[~2001-06-18  0:55 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-06-18  0:38 2.4.5-ac15 and Tru64 Netscape Alan Young
2001-06-18  0:55 ` Michal Jaegermann [this message]
2001-06-18  4:14   ` Alan Young
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox