Re: 2.2.8pre6, can't run ZMAGIC binaries

Andrea Arcangeli (andrea@e-mind.com)
Tue, 11 May 1999 03:08:10 +0200 (CEST)


On 10 May 1999, Peter Osterlund wrote:

>When trying to run maple I get a segmentation fault:
>
>[petero@ppro petero]$ uname -a
>Linux ppro.localdomain 2.2.8pre6 #1 Mon May 10 22:12:52 CEST 1999 i686 unknown
>[petero@ppro petero]$ file /usr/local/maple/bin/mapleV
>/usr/local/maple/bin/mapleV: Linux/i386 demand-paged executable (ZMAGIC)
>[petero@ppro petero]$ strace /usr/local/maple/bin/mapleV
>execve("/usr/local/maple/bin/mapleV", ["/usr/local/maple/bin/mapleV"], [/* 39 vars */]) = 0
>--- SIGSEGV (Segmentation fault) ---
>+++ killed by SIGSEGV +++

I think this will fix your problem:

Index: filemap.c
===================================================================
RCS file: /var/cvs/linux/mm/filemap.c,v
retrieving revision 1.1.2.74
diff -u -r1.1.2.74 filemap.c
--- filemap.c 1999/05/07 00:30:13 1.1.2.74
+++ linux/mm/filemap.c 1999/05/11 01:01:40
@@ -997,7 +997,7 @@
unsigned long old_page, new_page;

new_page = 0;
- offset = (address - area->vm_start + area->vm_offset) & PAGE_MASK;
+ offset = (address & PAGE_MASK) - area->vm_start + area->vm_offset;
if (offset >= inode->i_size && (area->vm_flags & VM_SHARED) && area->vm_mm == current->mm)
goto no_page;

The align-check is just done at mmap time.

Andrea Arcangeli

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/