From owner-freebsd-bugs Wed Dec 18 0:20: 8 2002 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 0A0E137B401 for ; Wed, 18 Dec 2002 00:20:07 -0800 (PST) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4F70F43EC2 for ; Wed, 18 Dec 2002 00:20:06 -0800 (PST) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.6/8.12.6) with ESMTP id gBI8K1x3040756 for ; Wed, 18 Dec 2002 00:20:01 -0800 (PST) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.6/8.12.6/Submit) id gBI8K1qt040755; Wed, 18 Dec 2002 00:20:01 -0800 (PST) Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id B696C37B401 for ; Wed, 18 Dec 2002 00:12:50 -0800 (PST) Received: from HAL9000.homeunix.com (12-232-220-15.client.attbi.com [12.232.220.15]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1484543ED1 for ; Wed, 18 Dec 2002 00:12:45 -0800 (PST) (envelope-from das@HAL9000.homeunix.com) Received: from HAL9000.homeunix.com (localhost [127.0.0.1]) by HAL9000.homeunix.com (8.12.6/8.12.5) with ESMTP id gBI8CcnZ046437; Wed, 18 Dec 2002 00:12:38 -0800 (PST) (envelope-from das@HAL9000.homeunix.com) Received: (from das@localhost) by HAL9000.homeunix.com (8.12.6/8.12.5/Submit) id gBI8CbsN046436; Wed, 18 Dec 2002 00:12:37 -0800 (PST) (envelope-from das) Message-Id: <200212180812.gBI8CbsN046436@HAL9000.homeunix.com> Date: Wed, 18 Dec 2002 00:12:37 -0800 (PST) From: David Schultz To: FreeBSD-gnats-submit@FreeBSD.org Cc: Varshavchick Alexander X-Send-Pr-Version: 3.113 Subject: bin/46341: apps linked against pthreads break when KVA_PAGES changes Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org >Number: 46341 >Category: bin >Synopsis: apps linked against pthreads break when KVA_PAGES changes >Confidential: yes >Severity: non-critical >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Wed Dec 18 00:20:01 PST 2002 >Closed-Date: >Last-Modified: >Originator: David Schultz >Release: 4.7-STABLE >Organization: >Environment: >Description: Revision 1.35 of src/lib/libc_r/uthread/uthread_init.c was supposed to make applications linked against libc_r continue to work without recompiling after changing KVA_PAGES. The following patches fill in a detail to make the feature actually work. For details, see the thread on hackers@ with subject 'maxusers and random system freezes'. (This problem was fixed in -CURRENT, perhaps by accident, when the stack allocation code was substantially reorganized.) >How-To-Repeat: >Fix: Tested-by: Varshavchick Alexander Index: uthread/uthread_init.c =================================================================== RCS file: /home/ncvs/src/lib/libc_r/uthread/uthread_init.c,v retrieving revision 1.23.2.10 diff -u -r1.23.2.10 uthread_init.c --- uthread/uthread_init.c 2002/10/22 14:44:03 1.23.2.10 +++ uthread/uthread_init.c 2002/12/06 13:41:06 @@ -245,6 +245,8 @@ len = sizeof (int); if (sysctl(mib, 2, &_usrstack, &len, NULL, 0) == -1) _usrstack = (void *)USRSTACK; + _next_stack = _usrstack - PTHREAD_STACK_INITIAL - + PTHREAD_STACK_DEFAULT - (2 * PTHREAD_STACK_GUARD); /* * Create a red zone below the main stack. All other stacks are * constrained to a maximum size by the paramters passed to >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message