Subject: kern/36008: Remaining pthread problems after newlock2 merge
To: None <kern-bug-people@netbsd.org, gnats-admin@netbsd.org,>
From: None <kilbi@kilbi.de>
List: netbsd-bugs
Date: 03/14/2007 14:15:05
>Number:         36008
>Category:       kern
>Synopsis:       Remaining pthread problems after newlock2 merge
>Confidential:   no
>Severity:       critical
>Priority:       high
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Mar 14 14:15:05 +0000 2007
>Originator:     Markus W Kilbinger
>Release:        NetBSD 4.99.15
>Organization:
>Environment:
	
	
System: NetBSD q 4.99.15 NetBSD 4.99.15 (Q.MP) #0: Wed Mar 14 08:57:38 MET 2007  kilbi@q:/usr/src/sys/arch/i386/compile/Q.MP i386
Architecture: i386
Machine: i386
>Description:
	-current (kernel with its pthread lib) still has severe
	pthread related problems after the newlock2 branch was merged.
	I noticed this first when running (pkgsrc/comms/)asterisk
	which was no longer accepting all incoming calls.

	As noted by "Blair Sadewitz" <blair.sadewitz@gmail.com> a more
	informative demonstration of this problem can be produced by
	running (pkgsrc/lang/)perl5 'make test' after its compilation
	which yields on my machine (only ext/threads logs shown):

	  ext/threads/shared/t/0nothread............ok
	  ext/threads/shared/t/av_refs..............Unbalanced scopes: 4 more ENTERs than LEAVEs
	  FAILED--expected 11 tests, saw 9
	  ext/threads/shared/t/av_simple............ok
	  ext/threads/shared/t/blessed..............ok
	  ext/threads/shared/t/cond.................Unbalanced scopes: 4 more ENTERs than LEAVEs
	  FAILED--expected 31 tests, saw 17
	  ext/threads/shared/t/disabled.............ok
	  ext/threads/shared/t/hv_refs..............ok
	  ext/threads/shared/t/hv_simple............ok
	  ext/threads/shared/t/no_share.............ok
	  ext/threads/shared/t/shared_attr..........ok
	  ext/threads/shared/t/sv_refs..............ok
	  ext/threads/shared/t/sv_simple............ok
	  ext/threads/shared/t/wait.................ok
	  ext/threads/t/basic.......................Out of memory!
	  FAILED--expected 19 tests, saw 8
	  ext/threads/t/end.........................Unbalanced scopes: 4 more ENTERs than LEAVEs
	  Unbalanced saves: 15 more saves than restores
	  Unbalanced context: 2 more PUSHes than POPs
	  FAILED--expected 6 tests, saw 5
	  ext/threads/t/join........................ok
	  ext/threads/t/libc........................ok
	  ext/threads/t/list........................ok
	  ext/threads/t/problems....................ok
	  ext/threads/t/stress_cv...................ok
	  ext/threads/t/stress_re...................ok
	  ext/threads/t/stress_string...............ok
	  ext/threads/t/thread......................Unbalanced scopes: 5 more ENTERs than LEAVEs
	  Unbalanced saves: 22 more saves than restores
	  Unbalanced context: 3 more PUSHes than POPs
	  FAILED--expected 31 tests, saw 10

	As a reference I compiled perl5 on an amd64 machine running
	NetBSD 4.0_BETA2 and ran 'make test':

	  ext/threads/shared/t/0nothread............ok
	  ext/threads/shared/t/av_refs..............ok
	  ext/threads/shared/t/av_simple............ok
	  ext/threads/shared/t/blessed..............ok
	  ext/threads/shared/t/cond.................ok
	  ext/threads/shared/t/disabled.............ok
	  ext/threads/shared/t/hv_refs..............ok
	  ext/threads/shared/t/hv_simple............ok
	  ext/threads/shared/t/no_share.............ok
	  ext/threads/shared/t/shared_attr..........ok
	  ext/threads/shared/t/sv_refs..............ok
	  ext/threads/shared/t/sv_simple............ok
	  ext/threads/shared/t/wait.................ok
	  ext/threads/t/basic.......................ok
	  ext/threads/t/end.........................ok
	  ext/threads/t/join........................ok
	  ext/threads/t/libc........................ok
	  ext/threads/t/list........................ok
	  ext/threads/t/problems....................ok
	  ext/threads/t/stress_cv...................ok
	  ext/threads/t/stress_re...................ok
	  ext/threads/t/stress_string...............ok
	  ext/threads/t/thread......................ok

	All these test were passed successfully.
>How-To-Repeat:
	Compile pkgsrc/lang/perl5 on a -current system (kernel and
	libpthread* after the newlock2 merge) and run perl5's 'make
	test' to see its failures in the ext/threads part.
>Fix:
	Unknown.

>Unformatted: