Re: abort acroread at today's -current, but OK at 03-Oct -current

From: Kostik Belousov <kostikbel_at_gmail.com>
Date: Mon, 5 Oct 2009 22:07:10 +0300
On Mon, Oct 05, 2009 at 10:46:51PM +0400, Boris Samorodov wrote:
> Hello List,
> 
> today I updated my computer from 03-Oct CURRENT to -current and
> some ports were updated. And have got an error:
> -----
> % acroread
> zsh: abort      acroread
> % /bin/sh -x `which acroread`
> + echo ''
> + tr a-z A-Z
> + ADOBE_LANG=''
> + : ENU
> + BN=acroread
> + VN=''
> + [ -d /usr/local/Adobe/Reader8 ]
> + ADOBE_VER=8
> + [ -d /usr/local/Adobe/Reader9 ]
> + ACROBASE=Adobe/Reader8
> + BINPREFIX=Adobe/Reader8/bin
> + MOZILLA_COMP_PATH=/..//usr/local/lib/linux-nvu
> + export MOZILLA_COMP_PATH
> + GTK_IM_MODULE=xim
> + export GTK_IM_MODULE
> + UNAME_s=Linux
> + export UNAME_s
> + [ -x /usr/local/Adobe/Reader8/ENU/Adobe/Reader8/bin/acroread ]
> + exec /compat/linux/bin/sh /usr/local/Adobe/Reader8/ENU/Adobe/Reader8/bin/acroread
> zsh: abort      /bin/sh -x `which acroread`
> -----
> 
> Loading old kernel gives a working acroread. What did I miss?
> Thanks.

Try this.

diff --git a/sys/kern/imgact_elf.c b/sys/kern/imgact_elf.c
index 4ed7382..e958214 100644
--- a/sys/kern/imgact_elf.c
+++ b/sys/kern/imgact_elf.c
_at__at_ -635,7 +635,8 _at__at_ __elfN(load_file)(struct proc *p, const char *file, u_long *addr,
 	}
 
 	for (i = 0, numsegs = 0; i < hdr->e_phnum; i++) {
-		if (phdr[i].p_type == PT_LOAD) {	/* Loadable segment */
+		if (phdr[i].p_type == PT_LOAD && phdr[i].p_memsz != 0) {
+			/* Loadable segment */
 			prot = 0;
 			if (phdr[i].p_flags & PF_X)
   				prot |= VM_PROT_EXECUTE;
_at__at_ -764,6 +768,8 _at__at_ __CONCAT(exec_, __elfN(imgact))(struct image_params *imgp)
 	for (i = 0; i < hdr->e_phnum; i++) {
 		switch (phdr[i].p_type) {
 		case PT_LOAD:	/* Loadable segment */
+			if (phdr[i].p_memsz == 0)
+				break;
 			prot = 0;
 			if (phdr[i].p_flags & PF_X)
   				prot |= VM_PROT_EXECUTE;

Received on Mon Oct 05 2009 - 17:07:17 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:39:56 UTC