From owner-freebsd-bugs@FreeBSD.ORG Sat Jan 5 02:10:04 2008 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8230616A47A for ; Sat, 5 Jan 2008 02:10:04 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 689C213C469 for ; Sat, 5 Jan 2008 02:10:04 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.2/8.14.2) with ESMTP id m052A4ZN041214 for ; Sat, 5 Jan 2008 02:10:04 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.2/8.14.1/Submit) id m052A4xI041213; Sat, 5 Jan 2008 02:10:04 GMT (envelope-from gnats) Date: Sat, 5 Jan 2008 02:10:04 GMT Message-Id: <200801050210.m052A4xI041213@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org From: "Zachary Loafman" Cc: Subject: Re: kern/93396: dlopen crash with locked page X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Zachary Loafman List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 05 Jan 2008 02:10:04 -0000 The following reply was made to PR kern/93396; it has been noted by GNATS. From: "Zachary Loafman" To: , Cc: Subject: Re: kern/93396: dlopen crash with locked page Date: Fri, 4 Jan 2008 17:59:57 -0800 Testcase that takes out any RTLD interaction, demonstrates the problem quickly, and works just fine if you take out the mlockall: -- #include #include #include #include #include #define EXIT_IF(__cond, __str) do { if (__cond) { perror(__str); exit(-1); } } while(0) int main() { char name[] =3D "/tmp/pr93396.XXXXXX"; char buf[PAGE_SIZE]; int rc, fd; char *map; fd =3D mkstemp(name); EXIT_IF(fd < 0, "mkstemp"); rc =3D write(fd, buf, PAGE_SIZE); EXIT_IF(rc < PAGE_SIZE, "write"); rc =3D mlockall(MCL_CURRENT | MCL_FUTURE); EXIT_IF(rc, "mlockall"); map =3D mmap(NULL, PAGE_SIZE, PROT_READ, MAP_PRIVATE, fd, 0); EXIT_IF(!map, "mmap"); rc =3D mprotect(map, PAGE_SIZE, PROT_READ|PROT_WRITE); EXIT_IF(rc, "mprotect"); *map =3D 'a'; =09 return 0; }