*BSD News Article 81969


Return to BSD News archive

Path: euryale.cc.adfa.oz.au!newshost.carno.net.au!harbinger.cc.monash.edu.au!news.mel.connect.com.au!munnari.OZ.AU!news.ecn.uoknor.edu!feed1.news.erols.com!howland.erols.net!psinntp!psinntp!pubxfer.news.psi.net!usenet
From: Luoqi Chen <luoqi@watermarkgroup.com>
Newsgroups: comp.emulators.ms-windows.wine,comp.unix.bsd.freebsd.misc
Subject: Re: Wine960928 crashed FreeBSD 2.1.5
Date: Thu, 31 Oct 1996 18:27:13 -0500
Organization: The Watermark Group
Lines: 51
Message-ID: <3279341C.7E62@watermarkgroup.com>
References: <32762988.167EB0E7@watermarkgroup.com> <558ouv$2a1@prds-grn.demon.co.uk>
NNTP-Posting-Host: 38.246.139.33
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Mailer: Mozilla 3.0 (Macintosh; I; PPC)
Xref: euryale.cc.adfa.oz.au comp.emulators.ms-windows.wine:5847 comp.unix.bsd.freebsd.misc:30336

Thomas D.G. Sandford wrote:
> 
> Luoqi Chen (luoqi@watermarkgroup.com) wrote:
> : Wine crashes my machine whenever I try to do "wine -help", or try to
> : run any non-existing file. It seemed that the CPU reset without any
> : panicking message. Does anyone else have this problem? Is it unique to
> : FreeBSD? How does wine crash the system without causing a panic?
> 
> : The last message on screen was "wine: can't exec '-help'". I looked
> : at wine source code, there is only a printf statement followed by
> : an exit. Printf didn't show maybe because it's still in buffer.
> : The only way exit could crash the system was the atexit calles,
> : which include a XChangeKeyboard and winsock cleanup, none looked
> : likely to be the cause. I'm really puzzled. Any help is appreciated.
> 
> It is (I think) a FreeBSD problem. It occurs when wine executes the fork()
> in loader/module.c
> 
> Actually it does usually cause a printed panic (panic: setrunqueue) - but
> the panic message appears on vt1, whereas you are looking at vt4 (the X vt).
> You can see the panic message by running wine from vt1 thus:
> 
> <on vt1>
> startx &
> <when X has started, switch back to vt1 with <ctrl><alt><f1> >
> setenv DISPLAY :0.0
> wine nosuchfile
> 
> The same problem occurs with FreeBSD 2.1.0-RELEASE, and I have logged it with
> the FreeBSD development team (kern/1118).
> 
After some research, I think I now understand what has gone wrong.
During a fork(),
user ldt table is NOT copied, instead the child will inherit the pointer
to the
same table. When one process tries to use a selector the other has
altered, a fault
is then signaled (segment not present fault?). I don't know how it ends
up at
a setrunqueue panic though.

The fix would be duplicate the ldt table during fork(). In addition to
this fix,
I am working on related changes including, deallocation of ldt table
after exit and
set it to default when exec(). I will post the patch after I have done
testing.
(BTW, could anyone tell me how to contribute the patch to the
development team?)

-lq