Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 7775 - openafs ebuild crashes
Summary: openafs ebuild crashes
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: x86 Linux
: Highest blocker (vote)
Assignee: Ryan Phillips (RETIRED)
URL:
Whiteboard:
Keywords:
: 7828 7925 8012 (view as bug list)
Depends on:
Blocks:
 
Reported: 2002-09-10 19:18 UTC by lucas
Modified: 2003-02-04 19:42 UTC (History)
5 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Patch to fix segfault on execve when building (openafs-1.2.6.patch,811 bytes, patch)
2002-10-01 17:12 UTC, conteb
Details | Diff
Patch to fix segfault on execve when building (openafs-1.2.6.patch,811 bytes, patch)
2002-10-01 17:15 UTC, conteb
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description lucas 2002-09-10 19:18:03 UTC
Error message follows:

creating src/xstat/Makefile
creating src/config/afsconfig.h
mkdir -p /var/tmp/portage/openafs-1.2.6/work/openafs-1.2.6/include
mkdir -p /var/tmp/portage/openafs-1.2.6/work/openafs-1.2.6/include/afs
mkdir -p /var/tmp/portage/openafs-1.2.6/work/openafs-1.2.6/lib
make build
make[1]: Entering directory 
`/var/tmp/portage/openafs-1.2.6/work/openafs-1.2.6'
make finale 
DEST=/var/tmp/portage/openafs-1.2.6/work/openafs-1.2.6/i386_linux24/dest 
COMPILE_PART2B=all DESTDIR=
make[2]: Entering directory 
`/var/tmp/portage/openafs-1.2.6/work/openafs-1.2.6'
cd src; cd config ; make all
make[3]: Entering directory 
`/var/tmp/portage/openafs-1.2.6/work/openafs-1.2.6/src/config'
rm -f Makefile.version
if      [ -r SRC/../CML/state ] ; \
then    cp Makefile.version-CML Makefile.version ; \
else    cp Makefile.version-NOCML Makefile.version ; \
fi
make -f Makefile.version AFS_component_version_number.c
make[4]: Entering directory 
`/var/tmp/portage/openafs-1.2.6/work/openafs-1.2.6/src/config'
echo 'char cml_version_number[]="@(#) OpenAFS 1.2.6 built ' `date 
+"%Y-%m-%d"` '";' >AFS_component_version_number.c
echo 'char* AFSVersion = "openafs 1.2.6"; ' >>AFS_component_version_number.c
make[4]: Leaving directory 
`/var/tmp/portage/openafs-1.2.6/work/openafs-1.2.6/src/config'
cc -g -I/var/tmp/portage/openafs-1.2.6/work/openafs-1.2.6/include -O2   -c 
-o config.o config.c
cc -g -I/var/tmp/portage/openafs-1.2.6/work/openafs-1.2.6/include -O2   -c 
-o mc.o mc.c
cc -g -I/var/tmp/portage/openafs-1.2.6/work/openafs-1.2.6/include -O2 -o 
config config.o mc.o
cc -g -I/var/tmp/portage/openafs-1.2.6/work/openafs-1.2.6/include -O2 -o 
mkvers mkvers.c
mkdir -p ../libuafs/afs
mkdir -p ../libuafs/rx
mkdir -p ../libuafs/afsint
mkdir -p ../libuafs/config
rm -f ../libuafs/afs/param.h; cp param.i386_linux24_usr.h 
../libuafs/afs/param.h
rm -f ../libuafs/afs/stds.h; cp stds.h ../libuafs/afs/stds.h
rm -f ../libuafs/afs/afs_sysnames.h; cp afs_sysnames.h 
../libuafs/afs/afs_sysnames.h
rm -f ../libuafs/config/Makefile.i386_linux24; cp Makefile.i386_linux24 
../libuafs/config/Makefile.i386_linux24
rm -f ../libuafs/afs/afs_args.h; cp afs_args.h ../libuafs/afs/afs_args.h
rm -f ../libuafs/afs/icl.h; cp icl.h ../libuafs/afs/icl.h
rm -f ../libuafs/afs/venus.h; cp venus.h ../libuafs/afs/venus.h
rm -f ../libuafs/afs/AFS_component_version_number.c; cp 
AFS_component_version_number.c ../libuafs/afs/AFS_component_version_number.c
mkdir -p ../libafs/afs
mkdir -p ../libafs/rx
mkdir -p ../libafs/afsint
mkdir -p ../libafs/config
rm -f ../libafs/afs/param.h; cp param.i386_linux24.h ../libafs/afs/param.h
rm -f ../libafs/afs/stds.h; cp stds.h ../libafs/afs/stds.h
rm -f ../libafs/afs/afs_sysnames.h; cp afs_sysnames.h 
../libafs/afs/afs_sysnames.h
rm -f ../libafs/config/Makefile.i386_linux24; cp Makefile.i386_linux24 
../libafs/config/Makefile.i386_linux24
rm -f ../libafs/afs/afs_args.h; cp afs_args.h ../libafs/afs/afs_args.h
rm -f ../libafs/afs/icl.h; cp icl.h ../libafs/afs/icl.h
rm -f ../libafs/afs/AFS_component_version_number.c; cp 
AFS_component_version_number.c ../libafs/afs/AFS_component_version_number.c
rm -f 
/var/tmp/portage/openafs-1.2.6/work/openafs-1.2.6/include/afs/param.h; cp 
param.i386_linux24.h 
/var/tmp/portage/openafs-1.2.6/work/openafs-1.2.6/include/afs/param.h
rm -f /var/tmp/portage/openafs-1.2.6/work/openafs-1.2.6/include/afs/stds.h; 
cp stds.h 
/var/tmp/portage/openafs-1.2.6/work/openafs-1.2.6/include/afs/stds.h
rm -f 
/var/tmp/portage/openafs-1.2.6/work/openafs-1.2.6/include/afs/afs_sysnames.h; 
cp afs_sysnames.h 
/var/tmp/portage/openafs-1.2.6/work/openafs-1.2.6/include/afs/afs_sysnames.h
rm -f 
/var/tmp/portage/openafs-1.2.6/work/openafs-1.2.6/include/afs/afs_args.h; 
cp afs_args.h 
/var/tmp/portage/openafs-1.2.6/work/openafs-1.2.6/include/afs/afs_args.h
rm -f /var/tmp/portage/openafs-1.2.6/work/openafs-1.2.6/include/afs/icl.h; 
cp icl.h /var/tmp/portage/openafs-1.2.6/work/openafs-1.2.6/include/afs/icl.h
rm -f 
/var/tmp/portage/openafs-1.2.6/work/openafs-1.2.6/include/afs/venus.h; cp 
venus.h 
/var/tmp/portage/openafs-1.2.6/work/openafs-1.2.6/include/afs/venus.h
rm -f 
/var/tmp/portage/openafs-1.2.6/work/openafs-1.2.6/include/afs/debug.h; cp 
debug.h 
/var/tmp/portage/openafs-1.2.6/work/openafs-1.2.6/include/afs/debug.h
make[3]: Leaving directory 
`/var/tmp/portage/openafs-1.2.6/work/openafs-1.2.6/src/config'
cd src; cd pinstall ; make all
make[3]: Entering directory 
`/var/tmp/portage/openafs-1.2.6/work/openafs-1.2.6/src/pinstall'
echo 'char cml_version_number[]="@(#) OpenAFS 1.2.6 built ' `date 
+"%Y-%m-%d"` '";' >AFS_component_version_number.c
echo 'char* AFSVersion = "openafs 1.2.6"; ' >>AFS_component_version_number.c
case i386_linux24 in \
                sgi_64 | sgi_65) \
                        cc -O2 -g -I. 
-I/var/tmp/portage/openafs-1.2.6/work/openafs-1.2.6/include 
-I/var/tmp/portage/openafs-1.2.6/work/openafs-1.2.6/src/config -O2 
install.c -o pinstall -lresolv ;; \
                sgi_* ) \
                        cc -O2 -g -I. 
-I/var/tmp/portage/openafs-1.2.6/work/openafs-1.2.6/include 
-I/var/tmp/portage/openafs-1.2.6/work/openafs-1.2.6/src/config -O2 
install.c -o pinstall -lresolv -lmld ;; \
                *) \
                        cc -O2 -g -I. 
-I/var/tmp/portage/openafs-1.2.6/work/openafs-1.2.6/include 
-I/var/tmp/portage/openafs-1.2.6/work/openafs-1.2.6/src/config -O2 
install.c -o pinstall -lresolv ;; \
        esac
make[3]: Leaving directory 
`/var/tmp/portage/openafs-1.2.6/work/openafs-1.2.6/src/pinstall'
cd src; cd procmgmt ; make all
make[3]: Entering directory 
`/var/tmp/portage/openafs-1.2.6/work/openafs-1.2.6/src/procmgmt'
cc  -I/var/tmp/portage/openafs-1.2.6/work/openafs-1.2.6/include 
-I/var/tmp/portage/openafs-1.2.6/work/openafs-1.2.6/src/config -O2   -c -o 
procmgmt_unix.o procmgmt_unix.c
echo 'char cml_version_number[]="@(#) OpenAFS 1.2.6 built ' `date 
+"%Y-%m-%d"` '";' >AFS_component_version_number.c
echo 'char* AFSVersion = "openafs 1.2.6"; ' >>AFS_component_version_number.c
cc  -I/var/tmp/portage/openafs-1.2.6/work/openafs-1.2.6/include 
-I/var/tmp/portage/openafs-1.2.6/work/openafs-1.2.6/src/config -O2   -c -o 
AFS_component_version_number.o AFS_component_version_number.c
rm -f libprocmgmt.a
ar crv libprocmgmt.a procmgmt_unix.o AFS_component_version_number.o
a - procmgmt_unix.o
a - AFS_component_version_number.o
ranlib libprocmgmt.a
/var/tmp/portage/openafs-1.2.6/work/openafs-1.2.6/src/pinstall/pinstall 
libprocmgmt.a 
/var/tmp/portage/openafs-1.2.6/work/openafs-1.2.6/lib/libprocmgmt.a
Bad exit code from /bin/cp: 11
Could not open output temp file 
``/var/tmp/portage/openafs-1.2.6/work/openafs-1.2.6/lib/libprocmgmt.a.picasso.cchem.berkeley.edu'': 
No such file or directory
make[3]: *** 
[/var/tmp/portage/openafs-1.2.6/work/openafs-1.2.6/lib/libprocmgmt.a] Error 
1
make[3]: Leaving directory 
`/var/tmp/portage/openafs-1.2.6/work/openafs-1.2.6/src/procmgmt'
make[2]: *** [procmgmt] Error 2
make[2]: Leaving directory 
`/var/tmp/portage/openafs-1.2.6/work/openafs-1.2.6'
make[1]: *** [build] Error 2
make[1]: Leaving directory 
`/var/tmp/portage/openafs-1.2.6/work/openafs-1.2.6'
make: *** [all] Error 2

!!! ERROR: The ebuild did not complete successfully.
!!! Function src_compile, Line 4, Exitcode 2
!!! (no error message)
Comment 1 Ryan Phillips (RETIRED) gentoo-dev 2002-09-13 00:40:12 UTC
compiler, use flags, portage version?
Comment 2 Ryan Phillips (RETIRED) gentoo-dev 2002-09-13 00:45:13 UTC
I can reproduce this... will take a look
Comment 3 SpanKY gentoo-dev 2002-09-14 19:50:36 UTC
*** Bug 7925 has been marked as a duplicate of this bug. ***
Comment 4 SpanKY gentoo-dev 2002-09-14 19:50:41 UTC
*** Bug 7828 has been marked as a duplicate of this bug. ***
Comment 5 Daniel Ahlberg (RETIRED) gentoo-dev 2002-09-15 12:57:04 UTC
As stated in #7828, removing the keyword "sandbox" from the FEATURES tag in
/etc/make.globals makes openafs merge cleanly.
Comment 6 Ryan Phillips (RETIRED) gentoo-dev 2002-09-16 00:03:46 UTC
committed
Comment 7 SpanKY gentoo-dev 2002-09-24 14:57:04 UTC
its back ...
Comment 8 SpanKY gentoo-dev 2002-09-24 14:57:18 UTC
*** Bug 8012 has been marked as a duplicate of this bug. ***
Comment 9 Ryan Phillips (RETIRED) gentoo-dev 2002-09-29 18:29:19 UTC
The problem in the ebuild appears to be the custom install program that is
used... Look for pinstall, and install.c in makefiles and the source tree.  Any
help finding the bug within the program would be appreciated.
Comment 10 JR Boyens 2002-10-01 15:23:16 UTC
When actually running the command before the error it works. So running:

cd /var/tmp/portage/openafs-1.2.6/work/openafs-1.2.6/src/procmgmt
/var/tmp/portage/openafs-1.2.6/work/openafs-1.2.6/src/pinstall/pinstall
libprocmgmt.a /var/tmp/portage/openafs-1.2.6/work/openafs-1.2.6/lib/libprocmgmt.a

I get no error. Leads me to believe it is sandbox bug/feature.
Comment 11 conteb 2002-10-01 16:25:41 UTC
Well...i've found the piece of code where the error occurs.  I added some 
debug statements to try and pinpoint what the problem is exactly.  The 
edits i made start on line 183 - here is a clip from my lines 
180-207:
	    case 0:			/* child	*/
		copy[1] = iname;
		copy[2] = oname;
		fprintf(stderr,"DEBUG: %s, %s\n\n",copy[1],copy[2]);
		execve("/bin/cp", copy, (char **)0);
		perror("/bin/cp");
		exit(1);

	    default:			/* parent	*/
		if (waitpid(pid, &status, 0) != pid) {
			perror("waitpid");
			return -1;
		}
	}

	if (status != 0) {
		fprintf(stderr, "Bad exit code from /bin/cp: %d\n", status);
		fprintf(stderr,"  Return value: %d\n", pid);
		fprintf(stderr,"  Status:       %d\n", status);
		fprintf(stderr,"  WIFSTOPPED:   %d\n", WIFSTOPPED(status));
		fprintf(stderr,"  WIFSIGNALED:  %d\n", WIFSIGNALED(status));
		fprintf(stderr,"  WIFEXITED:    %d\n", WIFEXITED(status));
		fprintf(stderr,"  WEXITSTATUS:  %d\n", WEXITSTATUS(status));
		fprintf(stderr,"  WTERMSIG:     %d\n", WTERMSIG(status));
		fprintf(stderr,"  WSTOPSIG:     %d\n", WSTOPSIG(status));
		return -1;
	}

And heres the relivant snippet of what printed out.

ranlib libprocmgmt.a
/var/tmp/portage/openafs-1.2.6/work/openafs-1.2.6/src/pinstall/pinstall 
libprocmgmt.a 
/var/tmp/portage/openafs-1.2.6/work/openafs-1.2.6/lib/libprocmgmt.a
DEBUG: libprocmgmt.a, 
/var/tmp/portage/openafs-1.2.6/work/openafs-1.2.6/lib/libprocmgmt.a.lain

Bad exit code from /bin/cp: 11
  Return value: 9422
  Status:       11
  WIFSTOPPED:   0
  WIFSIGNALED:  1
  WIFEXITED:    0
  WEXITSTATUS:  0
  WTERMSIG:     11
  WSTOPSIG:     0
Could not open output temp file 
``/var/tmp/portage/openafs-1.2.6/work/openafs-1.2.6/lib/libprocmgmt.a.lain'': 
No such file or directory
make[3]: *** 
[/var/tmp/portage/openafs-1.2.6/work/openafs-1.2.6/lib/libprocmgmt.a] Error 
1
make[3]: Leaving directory 
`/tmp/portage/openafs-1.2.6/work/openafs-1.2.6/src/procmgmt'
make[2]: *** [procmgmt] Error 2

So this isn't just a return code like i thought, but /bin/cp is actually 
segfaulting for some reason.
Comment 12 conteb 2002-10-01 17:12:41 UTC
Created attachment 4342 [details, diff]
Patch to fix segfault on execve when building

Here is a patch that works on my system.  I'm not sure if its an optimization
thing, but the (char **)0 for the array just wasn't cutting it (it could also
be a gcc 3.2 issue - are others who are having this problem using 3.2?).  This
patch fixes it by creating an emtpy array with 1 null element.	I've fixed both
places that run /bin/cp, but i'm not sure if the AIX
Comment 13 conteb 2002-10-01 17:15:32 UTC
Created attachment 4343 [details, diff]
Patch to fix segfault on execve when building

Here is a patch to openafs-1.2.6 that works on my system.  I'm not sure if its
an optimization thing, but the (char **)0 for the array just wasn't cutting it
(it could also be a gcc 3.2 issue - are others who are having this problem
using 3.2?).  This patch fixes it by creating an emtpy array with 1 null
element.  I've fixed both places that run /bin/cp, but i'm not sure if the AIX
one works or is even broken...

It is currently working on my system, building properly as i type this.

How i applied this patch:
start emerge - ctrl-Z when configuring
cd <dir/with/install.c>; cat ~/openafs-1.2.6.patch | patch -p0
cd; fg 

Let me know if it works
Comment 14 JR Boyens 2002-10-01 22:44:34 UTC
Works fine on my end. Good patch.

I'd say we look into what causes this. Perhaps email the GCC mailing list to
see if this is a problem with GCC or not. Other than that, let's commit the
patch, put it into the ebuild, and notify upstream authors.

Huzzah!
Comment 15 Ryan Phillips (RETIRED) gentoo-dev 2002-10-01 23:49:18 UTC
 Committed the patch... Leaving this open so I can contact the devels.