Bug 100701 - emulators/wine triggers internal error in libpthread
Summary: emulators/wine triggers internal error in libpthread
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Gerald Pfeifer
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-07-22 05:10 UTC by Michael Nottebrock
Modified: 2007-08-11 18:31 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Nottebrock freebsd_committer freebsd_triage 2006-07-22 05:10:15 UTC
	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
Comment 1 Michael Nottebrock freebsd_committer freebsd_triage 2006-07-22 05:25:15 UTC
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)
Comment 2 Michael Nottebrock freebsd_committer freebsd_triage 2006-07-22 19:36:55 UTC
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)
Comment 3 Daniel Eischen freebsd_committer freebsd_triage 2006-07-24 20:20:21 UTC
State Changed
From-To: open->closed

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.
Comment 4 Mark Linimon freebsd_committer freebsd_triage 2006-07-25 03:39:10 UTC
State Changed
From-To: closed->suspended

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. 


Comment 5 Mark Linimon freebsd_committer freebsd_triage 2006-07-25 03:39:10 UTC
Responsible Changed
From-To: freebsd-threads->gerald
Comment 6 Gerald Pfeifer freebsd_committer freebsd_triage 2007-08-11 18:29:29 UTC
State Changed
From-To: suspended->closed

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.