NetBSD Problem Report #34722

From  Thu Oct  5 14:06:38 2006
Return-Path: <>
Received: from ( [])
	by (Postfix) with ESMTP id 919A263B8C9
	for <>; Thu,  5 Oct 2006 14:06:38 +0000 (UTC)
Message-Id: <>
Date: Thu,  5 Oct 2006 21:30:20 +0900 (JST)
Subject: pthread can use unlimited amount of stack
X-Send-Pr-Version: 3.95

>Number:         34722
>Category:       lib
>Synopsis:       pthread can use unlimited amount of stack
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    lib-bug-people
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Oct 05 14:10:01 +0000 2006
>Closed-Date:    Fri Mar 23 10:08:05 +0000 2018
>Last-Modified:  Fri Mar 23 10:08:05 +0000 2018
>Originator:     YAMAMOTO Takashi <>
>Release:        NetBSD 4.99.3


System: NetBSD 4.99.3
Architecture: i386
Machine: i386

(i thought i filed this PR sometime ago, but i couldn't find a number.
sorry if it was duplicated.)

1. your thread is interrupted by an upcall.
2. pthread__upcall() handles the upcall and switch back to your thread
   by pthread__upcall_switch.
3. pthread__upcall_switch switches its stack (STACK_SWITCH),
   and eventually calls _md_setcontext_u.
4. if you are unfortunate enough, _md_setcontext_u is interrupted by
   an upcall.  now, it's similar to #1, but with some more stack consumed.
5. if you are really unfortunate, you'll repeat the above sequence
   again and again, and eventually run out stack.

	code inspection.



State-Changed-From-To: open->suspended
State-Changed-When: Wed, 21 Mar 2007 18:48:06 +0000
This should be fixed in -current. Realistically, there is no chance
of it being fixed in a earlier release.

State-Changed-From-To: suspended->closed
State-Changed-When: Fri, 23 Mar 2018 10:08:05 +0000
Close this PR, fixed.


NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.43 2018/01/16 07:36:43 maya Exp $
$NetBSD:,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2017 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.