Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 3 Sep 2002 14:13:45 -0700 (PDT)
From:      Matthew Dillon <dillon@apollo.backplane.com>
To:        John Baldwin <jhb@FreeBSD.ORG>
Cc:        Thomas Moestl <tmoestl@gmx.net>, current@FreeBSD.ORG, des@FreeBSD.ORG, ticso@cicely5.cicely.de, Alexander Kabaev <ak03@gte.com>, ticso@cicely.de, Peter Wemm <peter@wemm.org>
Subject:   Re: alpha tinderbox failure - kernel is broken.
Message-ID:  <200209032113.g83LDjOV063373@apollo.backplane.com>
References:   <XFMail.20020903151106.jhb@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help

:> 
:> Can somebody who is feeling adventurous and has an alpha box please
:> test whether this fixes it for now?
:
:Nope, if anything it's now worse. :(  We should perhaps revert this
:change in -stable until we can get it to work in -current.  FWIW, with
:the patch all sorts of programs no longer work including find,
:rpc.lockd, cron, sendmail, getty, etc., not just static c++ programs.
:
:-- 
:
:John Baldwin <jhb@FreeBSD.org>  <><  http://www.FreeBSD.org/~jhb/
:"Power Users Use the Power to Serve!"  -  http://www.FreeBSD.org/

    Lets try just reverting the algorithm, and keeping the RLIMIT
    stuff intact.  Here's the patch for -current.  Please review.

						-Matt

Index: imgact_elf.c
===================================================================
RCS file: /home/ncvs/src/sys/kern/imgact_elf.c,v
retrieving revision 1.124
diff -u -r1.124 imgact_elf.c
--- imgact_elf.c	2 Sep 2002 17:27:30 -0000	1.124
+++ imgact_elf.c	3 Sep 2002 21:11:01 -0000
@@ -734,20 +734,23 @@
 			    phdr[i].p_vaddr - seg_addr);
 
 			/*
-			 * Is this .text or .data?  Use VM_PROT_WRITE
-			 * to distinguish between the two for the purpose
-			 * of limit checking and vmspace fields.
+			 * Is this .text or .data?  We can't use
+			 * VM_PROT_WRITE or VM_PROT_EXEC, it breaks the
+			 * alpha terribly and possibly does other bad
+			 * things so we stick with the address check.
 			 */
-			if (prot & VM_PROT_WRITE) {
-				data_size += seg_size;
-				if (data_addr == 0)
-					data_addr = seg_addr;
+
+			/* Does the entry point belong to this segment? */
+			if (hdr->e_entry >= phdr[i].p_vaddr &&
+			    hdr->e_entry < (phdr[i].p_vaddr +
+			    phdr[i].p_memsz)) {
+				entry = (u_long)hdr->e_entry;
+				text_size = seg_size;
+				text_addr = seg_addr;
 			} else {
-				text_size += seg_size;
-				if (text_addr == 0)
-					text_addr = seg_addr;
+				data_size = seg_size;
+				data_addr = seg_addr;
 			}
-
 			/*
 			 * Check limits.  It should be safe to check the
 			 * limits after loading the segment since we do
@@ -762,12 +765,6 @@
 				goto fail;
 			}
 
-			/* Does the entry point belong to this segment? */
-			if (hdr->e_entry >= phdr[i].p_vaddr &&
-			    hdr->e_entry < (phdr[i].p_vaddr +
-			    phdr[i].p_memsz)) {
-				entry = (u_long)hdr->e_entry;
-			}
 			break;
 		case PT_PHDR: 	/* Program header table info */
 			proghdr = phdr[i].p_vaddr;

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200209032113.g83LDjOV063373>