Date: Wed, 18 Dec 2002 00:12:37 -0800 (PST) From: David Schultz <dschultz@uclink.Berkeley.EDU> To: FreeBSD-gnats-submit@FreeBSD.org Cc: Varshavchick Alexander <alex@metrocom.ru> Subject: bin/46341: apps linked against pthreads break when KVA_PAGES changes Message-ID: <200212180812.gBI8CbsN046436@HAL9000.homeunix.com>
next in thread | raw e-mail | index | archive | help
>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 <alex@metrocom.ru> 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200212180812.gBI8CbsN046436>