Date: Fri, 25 Aug 2006 10:28:55 -0400 From: John Baldwin <jhb@freebsd.org> To: freebsd-current@freebsd.org Cc: Divacky Roman <xdivac02@stud.fit.vutbr.cz>, freebsd-emulation@freebsd.org, Intron is my alias on the Internet <mag@intron.ac> Subject: Re: Linuxulator: Unbreak Mozilla, Firefox and RealPlayer Message-ID: <200608251028.55915.jhb@freebsd.org> In-Reply-To: <20060825084755.GA93151@stud.fit.vutbr.cz> References: <courier.44EE6A8A.00008655@intron.ac> <20060825084755.GA93151@stud.fit.vutbr.cz>
next in thread | previous in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200608251028.55915.jhb>