From owner-freebsd-emulation@FreeBSD.ORG Fri Aug 25 14:48:32 2006 Return-Path: X-Original-To: freebsd-emulation@freebsd.org Delivered-To: freebsd-emulation@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id F11E616A4E0; Fri, 25 Aug 2006 14:48:32 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from server.baldwin.cx (66-23-211-162.clients.speedfactory.net [66.23.211.162]) by mx1.FreeBSD.org (Postfix) with ESMTP id 38B0D43D6D; Fri, 25 Aug 2006 14:48:25 +0000 (GMT) (envelope-from jhb@freebsd.org) Received: from zion.baldwin.cx (zion.baldwin.cx [192.168.0.7]) (authenticated bits=0) by server.baldwin.cx (8.13.6/8.13.6) with ESMTP id k7PEmJ7K076037; Fri, 25 Aug 2006 10:48:19 -0400 (EDT) (envelope-from jhb@freebsd.org) From: John Baldwin To: freebsd-current@freebsd.org Date: Fri, 25 Aug 2006 10:28:55 -0400 User-Agent: KMail/1.9.1 References: <20060825084755.GA93151@stud.fit.vutbr.cz> In-Reply-To: <20060825084755.GA93151@stud.fit.vutbr.cz> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200608251028.55915.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-2.0.2 (server.baldwin.cx [192.168.0.1]); Fri, 25 Aug 2006 10:48:19 -0400 (EDT) X-Virus-Scanned: ClamAV 0.88.3/1728/Fri Aug 25 01:55:58 2006 on server.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-4.4 required=4.2 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.1.3 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on server.baldwin.cx Cc: freebsd-emulation@freebsd.org Subject: Re: Linuxulator: Unbreak Mozilla, Firefox and RealPlayer X-BeenThere: freebsd-emulation@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Development of Emulators of other operating systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Aug 2006 14:48:33 -0000 On Friday 25 August 2006 04:47, Divacky Roman wrote: > On Fri, Aug 25, 2006 at 11:12:10AM +0800, Intron is my alias on the Internet wrote: > > Debugging is somewhat MUCH MORE DIFFICULT than rewriting. > > > > Here is the minimum patch that can only unbreak Mozilla 1.7.12 (GTK 1), > > Firefox 1.0.7 and RealPlayer 10.0.7.785 (playing video) > > (sysctl compat.linux.osrelease=2.6.16). > > > > It doesn't mean problems of clone(2) have been fixed. Actually, clone(2), > > set_thread_area(2) and get_thread_area(2) are mis-interpreted. > > > > Adobe Reader 7.0.8 hasn't been completely unbroken yet. Problems around > > it seem to be more complicated. > > > > My patch (against /sys/i386/linux/linux_machdep.c of CVS revision 1.53): > > > > http://ftp.intron.ac/tmp/linux_machdep.c.1.53.diff > > + p2->p_pptr = td->td_proc->p_pptr; > > I already did this but differently: > > if (args->flags & (CLONE_PARENT|CLONE_THREAD)) { > struct linux_getppid_args gpa; > struct proc *pp; > > (void) linux_getppid(td, &gpa); > pp = pfind(td->td_retval[0]); > if (pp == NULL) { > printf("shit\n"); > return 0; > } > PROC_LOCK(p2); > p2->p_pptr = pp; > PROC_UNLOCK(p2); > PROC_UNLOCK(pp); > } > > also, linux also sets pgrp with CLONE_THREAD. Umm, if you want to reparent a proc you should use the proc_reparent() function instead of just hacking on p_pptr. You also need to hold the proctree_lock when modifying p_pptr anyway. -- John Baldwin