[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

mmap bug report



[Note: Simon, please send bug reports to cmucl-bugs@cs.cmu.edu
Send mail to cmucl-bugs-request@cs.cmu.edu to be placed on this list.]

------- Forwarded Message

Date: Mon, 8 Jul 91 19:29 MET DST
From: Simon Leinen <simon@liasun6.epfl.ch>
To: Rob.MacLachlan@LISP-PMAX2.SLISP.CS.CMU.EDU
Subject: Problem Report for CMU CL/SunOS (was: Re: CMU CL)
References: <m0jwCkP-0008OkC@liasun6.epfl.ch>
	<m0jwxuF-0008OpC@liasun6.epfl.ch>
Reply-to: simon@liasun6.epfl.ch
Full-Name: Simon Leinen

Thanks for the information on how to get CMUCL/SunOS! I transferred
the tar file from NMSU and installed it.  As an expression of
gratitude, here is my first problem report:

SHORT DESCRIPTION:
	In ldb, mmap(2) system calls fail if /tmp is mounted as a
	TMPFS filesystem.

HARDWARE TYPE:			Sun 4/470
OPERATING SYSTEM:		SunOS 4.1.1B
CMU COMMON LISP VERSION:	cmucl for Sun4/SunOS May 11 1991
PROBLEM DESCRIPTION:		ldb fails to mmap()
EXAMPLE SESSION:

	simon@liasun6% ldb
	mapin: mmap: Invalid argument
	mapin: mmap: Invalid argument
	mapin: mmap: Invalid argument
	mapin: mmap: Invalid argument
	mapin: mmap: Invalid argument
	mapin: mmap: Invalid argument
<gazillions of messages like these:>
	segv_handler: No mapping fault: 0x00e047cc
	segv_handler: No mapping fault: 0x00e047d8
	segv_handler: No mapping fault: 0x00e047e4
	segv_handler: No mapping fault: 0x00e047f0
	segv_handler: No mapping fault: 0x00e047fc
	segv_handler: No mapping fault: 0x00e04808
	segv_handler: No mapping fault: 0x00e04814
	segv_handler: No mapping fault: 0x00e04820
	segv_handler: No mapping fault: 0x00e0482c
	segv_handler: No mapping fault: 0x00e04838
	segv_handler: No mapping fault: 0x00e04844
	segv_handler: No mapping fault: 0x00e04850
	segv_handler: No mapping fault: 0x00e0485c
	...

	simon@liasun6% trace ldb
	getpagesize () = 8192
	brk (0x3e030) = 0
	brk (0x40038) = 0
	open ("/dev/zero", 0, 0740160) = 3
	open ("/tmp/empty", 01000, 0740160) = 4
	unlink ("/tmp/empty") = 0
	getpagesize () = 8192
	mmap (0x1000000, 50331648, 0, 0x80000012, 4, 0) = -1 EINVAL (Invalid argument)
	writev (2, 0xf7fff658, 4) = mapin: mmap: Invalid argument
	30

EXPLANATION:
	The file descriptor passed as the `fd' argument to the mmap()
	system calls was obtained by an open of `/tmp/empty'.  At our
	site (and many others I know of), /tmp is mounted from virtual
	memory using SunOS 4's TMPFS filesystem type.  Apparently mmap
	doesn't like this, although the mmap(2) man page does not
	mention this as a reason to return EINVAL.

SUGGESTED FIX:
	ldb should either
	* try a different pathname if the mmap() syscalls fail or
	* have a configuration parameter somewhere that can be used to
	  specify a different pathname (maybe it already has, and I
	  simply don't know about it).

	I managed to get CMUCL running by simply replacing all (two)
	occurrences of the string "/tmp/empty" by "/var/tmp/e" in the
	binary (/var is mounted as a normal Berkeley filesystem).
- -- 
Simon.

------- End of Forwarded Message