From owner-freebsd-bugs@FreeBSD.ORG Thu Nov 18 05:00:54 2004 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2B0AE16A4CE for ; Thu, 18 Nov 2004 05:00:54 +0000 (GMT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id E891243D48 for ; Thu, 18 Nov 2004 05:00:53 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.11/8.12.11) with ESMTP id iAI50rcS027686 for ; Thu, 18 Nov 2004 05:00:53 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.11/8.12.11/Submit) id iAI50r8R027685; Thu, 18 Nov 2004 05:00:53 GMT (envelope-from gnats) Date: Thu, 18 Nov 2004 05:00:53 GMT Message-Id: <200411180500.iAI50r8R027685@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org From: "Simon 'corecode' Schubert" Subject: Re: kern/73092: [patch] Unbreak WINE for 5.x and 6 [patches for both kern and port] X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Simon 'corecode' Schubert List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Nov 2004 05:00:54 -0000 The following reply was made to PR kern/73092; it has been noted by GNATS. From: Simon 'corecode' Schubert To: freebsd-gnats-submit@FreeBSD.org, amistry@am-productions.biz Cc: Subject: Re: kern/73092: [patch] Unbreak WINE for 5.x and 6 [patches for both kern and port] Date: Thu, 18 Nov 2004 05:51:49 +0100 --Apple-Mail-8-39742086 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII; format=flowed I was looking at getting a current wine running on DragonFly and found your patch. In my opinion, this patch fixes the "problem" at the wrong place: wine doesn't want arbitary addresses (mmap(NULL...)), but wants addresses below user_space_limit. Although mmap(2) doesn't provide such a rich set of features to be able to specify an "desired/allowed range", this can be easily done in wine itself: diff -ru work/wine-20041019/dlls/ntdll/virtual.c work.old/wine-20041019/dlls/ntdll/virtual.c --- work/wine-20041019/dlls/ntdll/virtual.c 2004-10-11 22:59:06.000000000 +0200 +++ work.old/wine-20041019/dlls/ntdll/virtual.c 2004-11-18 04:33:04.000000000 +0100 @@ -119,6 +119,7 @@ /* Note: these are Windows limits, you cannot change them. */ # define ADDRESS_SPACE_LIMIT ((void *)0xc0000000) /* top of the total available address space */ # define USER_SPACE_LIMIT ((void *)0x80000000) /* top of the user address space */ +# define LOW_SPACE_LIMIT ((void *)0x110000) /* lower address space limit */ #else static UINT page_shift; static UINT page_mask; @@ -600,7 +601,7 @@ for (;;) { - if ((ptr = wine_anon_mmap( NULL, view_size, VIRTUAL_GetUnixProt(vprot), 0 )) == (void *)-1) + if ((ptr = wine_anon_mmap( LOW_SPACE_LIMIT, view_size, VIRTUAL_GetUnixProt(vprot), 0 )) == (void *)-1) { if (errno == ENOMEM) return STATUS_NO_MEMORY; return STATUS_INVALID_PARAMETER; Just ask mmap to start allocating at a low address. It's not tested a lot, but applications run again. cheers simon -- /"\ \ / \ ASCII Ribbon Campaign / \ Against HTML Mail and News --Apple-Mail-8-39742086 content-type: application/pgp-signature; x-mac-type=70674453; name=PGP.sig content-description: This is a digitally signed message part content-disposition: inline; filename=PGP.sig content-transfer-encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (Darwin) iD8DBQFBnCpmr5S+dk6z85oRAqysAKDCTQaaZY8EYBdxaEsbrI+Pyt7mMwCgxs1v wvmNGslGYV98zf8nnU2HlBk= =2JTS -----END PGP SIGNATURE----- --Apple-Mail-8-39742086--