Subject: pkg/9507: mlockall(2) failure prevents cdrecord from working
To: None <gnats-bugs@gnats.netbsd.org>
From: SUNAGAWA Keiki <kei_sun@ba2.so-net.ne.jp>
List: netbsd-bugs
Date: 02/29/2000 07:21:35
>Number:         9507
>Category:       pkg
>Synopsis:       mlockall(2) returns EAGAIN, causes cdrecord not to work.
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    pkg-manager (NetBSD software packages system bug manager)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Feb 29 07:20:59 2000
>Last-Modified:
>Originator:     SUNAGAWA Keiki
>Organization:
	home
>Release:        2000-02-29
>Environment:
	
System: NetBSD azarin 1.4P NetBSD 1.4P (AZARIN) #84: Wed Dec 1 21:54:14 JST 1999 kei@azarin:/a/anoncvs/netbsd/src/sys/arch/macppc/compile/AZARIN macppc


>Description:
	cdrecord calls mlockall(2) with argument MCL_CURRENT|MCL_FUTURE, but
	it always returns EAGAIN on my environment and causes the program exit.

	I tried to maximize the resource limit with built-in ulimit of sh, but
	got no success.
>How-To-Repeat:
	make cdrecord 
>Fix:
	I commented out mlockall call and it works on my macppc box (XXX see:
	pkg/9506) and sparc classic.  macppc has 160MB of RAM and sparc 32MB.

	the new patch-af is attached below.

$NetBSD$

--- cdrecord/cdrecord.c.orig	Mon Feb 14 19:56:07 2000
+++ cdrecord/cdrecord.c	Tue Feb 15 23:05:46 2000
@@ -226,9 +226,11 @@
 		 * Try to lock us im memory (will only work for root)
 		 * but you need access to root anyway to use /dev/scg?
 		 */
+#if 0 /* XXX */
 #if defined(HAVE_MLOCKALL) || defined(_POSIX_MEMLOCK)
 		if (mlockall(MCL_CURRENT|MCL_FUTURE) < 0)
 			comerr("Cannot do mlockall(2).\n");
+#endif
 #endif
 
 		raisepri(0); /* max priority */
>Audit-Trail:
>Unformatted: