From lofi@freebsd.org  Sat Jul 22 04:03:51 2006
Return-Path: <lofi@freebsd.org>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 9375216A4DA
	for <FreeBSD-gnats-submit@freebsd.org>; Sat, 22 Jul 2006 04:03:51 +0000 (UTC)
	(envelope-from lofi@freebsd.org)
Received: from mail-in-07.arcor-online.net (mail-in-07.arcor-online.net [151.189.21.47])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 8B02C43D45
	for <FreeBSD-gnats-submit@freebsd.org>; Sat, 22 Jul 2006 04:03:50 +0000 (GMT)
	(envelope-from lofi@freebsd.org)
Received: from mail-in-08-z2.arcor-online.net (mail-in-08-z2.arcor-online.net [151.189.8.20])
	by mail-in-07.arcor-online.net (Postfix) with ESMTP id 5995419E962
	for <FreeBSD-gnats-submit@freebsd.org>; Sat, 22 Jul 2006 06:03:49 +0200 (CEST)
Received: from mail-in-09.arcor-online.net (mail-in-09.arcor-online.net [151.189.21.49])
	by mail-in-08-z2.arcor-online.net (Postfix) with ESMTP id 4EBB655437
	for <FreeBSD-gnats-submit@freebsd.org>; Sat, 22 Jul 2006 06:03:49 +0200 (CEST)
Received: from lofi.dyndns.org (dslb-084-061-132-249.pools.arcor-ip.net [84.61.132.249])
	by mail-in-09.arcor-online.net (Postfix) with ESMTP id 0D825401365
	for <FreeBSD-gnats-submit@freebsd.org>; Sat, 22 Jul 2006 06:03:49 +0200 (CEST)
Received: from kiste.my.domain (root@kiste.my.domain [192.168.8.4])
	by lofi.dyndns.org (8.13.4/8.13.3) with ESMTP id k6M43jHj021348
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO)
	for <FreeBSD-gnats-submit@freebsd.org>; Sat, 22 Jul 2006 06:03:46 +0200 (CEST)
	(envelope-from lofi@freebsd.org)
Received: from kiste.my.domain (lofi@localhost [127.0.0.1])
	by kiste.my.domain (8.13.6/8.13.4) with ESMTP id k6M43jjU045237
	for <FreeBSD-gnats-submit@freebsd.org>; Sat, 22 Jul 2006 06:03:45 +0200 (CEST)
	(envelope-from lofi@kiste.my.domain)
Received: (from lofi@localhost)
	by kiste.my.domain (8.13.6/8.13.4/Submit) id k6M43i4D045236;
	Sat, 22 Jul 2006 06:03:44 +0200 (CEST)
	(envelope-from lofi)
Message-Id: <200607220403.k6M43i4D045236@kiste.my.domain>
Date: Sat, 22 Jul 2006 06:03:44 +0200 (CEST)
From: Michael Nottebrock <lofi@freebsd.org>
Reply-To: Michael Nottebrock <lofi@freebsd.org>
To: FreeBSD-gnats-submit@freebsd.org
Cc: gerald@FreeBSD.org
Subject: Wine triggers internal error in libpthread
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         100701
>Category:       ports
>Synopsis:       emulators/wine triggers internal error in libpthread
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    gerald
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat Jul 22 04:10:15 GMT 2006
>Closed-Date:    Sat Aug 11 17:31:19 GMT 2007
>Last-Modified:  Sat Aug 11 17:31:19 GMT 2007
>Originator:     Michael Nottebrock
>Release:        FreeBSD 5.5-RELEASE-p1 i386
>Organization:
>Environment:
System: FreeBSD kiste 5.5-RELEASE-p1 FreeBSD 5.5-RELEASE-p1 #1: Sat Jul 22 02:57:55 CEST 2006 root@kiste:/usr/obj/usr/src/sys/KISTE-SMP i386


	
>Description:
	WINE (in win2k+ emulation mode) triggers an internal error in libpthread when
	trying to run various applications (such as Firefox). 
>How-To-Repeat:
	1.) Install emulators/wine
	2.) Run winecfg to generate basic configuration. Acknowledge configuration program
	    with Ok without changing any settings.
	3.) fetch 'http://sunsite.rediris.es/pub/mozilla.org/firefox/releases/.5.0.4/win32/en-US/Firefox Setup 1.5.0.4.exe'
	4.) Run wine 'Firefox Setup 1.5.0.4.exe'. Complete the installer with default choices.
	5.) Run wine ~/.wine/drive_c/Program\ Files/Mozilla\ Firefox/firefox.exe

>Fix:

	


>Release-Note:
>Audit-Trail:

From: Michael Nottebrock <lofi@freebsd.org>
To: bug-followup@freebsd.org, lofi@freebsd.org
Cc:  
Subject: Re: threads/100701: Wine triggers internal error in libpthread
Date: Sat, 22 Jul 2006 06:25:15 +0200

 Additional note: When running Firefox with 'wine-kthread' instead (also 
 installed by the wine port), the error changes to
 
 Fatal error 'Uninitialized mutex in pthread_mutex_trylock_basic' at line 496 
 in file /usr/src/lib/libpthread/thread/thr_mutex.c (errno = 2)

From: Michael Nottebrock <lofi@freebsd.org>
To: bug-followup@freebsd.org, lofi@freebsd.org
Cc:  
Subject: Re: threads/100701: Wine triggers internal error in libpthread
Date: Sat, 22 Jul 2006 20:36:55 +0200

 Forgot to include the original error message:
 
 Fatal error 'thr_resume_wrapper: thread has returned from _thread_switch' at 
 line 1125 in file /usr/src/lib/libpthread/thread/thr_kern.c (errno = 22)
State-Changed-From-To: open->closed 
State-Changed-By: deischen 
State-Changed-When: Mon Jul 24 19:20:21 UTC 2006 
State-Changed-Why:  
This is not a problem with the threads library.  WINE is known 
to abuse usage of %gs which is reserved for use by the threads 
library. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=100701 
State-Changed-From-To: closed->suspended 
State-Changed-By: linimon 
State-Changed-When: Tue Jul 25 02:39:10 UTC 2006 
State-Changed-Why:  
After some further discussion on the mailing lists (q.v.), the conclusion 
seems to be that Wine on FreeBSD is going to need to be modified to work 
with the thread libraries.  I'm going to mark this 'suspended' until 
someone can figure out an appropriate shim to do this.  The problem is 
serious and extant, so IMHO it shouldn't really be closed. 


Responsible-Changed-From-To: freebsd-threads->gerald 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Tue Jul 25 02:39:10 UTC 2006 
Responsible-Changed-Why:  

http://www.freebsd.org/cgi/query-pr.cgi?pr=100701 
State-Changed-From-To: suspended->closed 
State-Changed-By: gerald 
State-Changed-When: Sat Aug 11 17:29:29 UTC 2007 
State-Changed-Why:  
I just realized that this was addressed by a change I committed earlier 
this week: 

date: 2007/08/07 04:33:40;  author: gerald;  state: Exp;  lines: +6 -1 
Switch to libthr as the default threading library on versions of FreeBSD 
where it isn't the default yet.  Wine wants all threads to be 
PTHREAD_SCOPE_SYSTEM (visible by kernel) so wineserver can access threads 
inside wine processes.  With libthr all threads are PTHREAD_SCOPE_SYSTEM 
by default.  With libkse the initial thread is not which prevents wineserver 
from sending signals to it directly, for instance. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=100701 
>Unformatted:
