Subject: Re: serious bug introduced in Linux compatibility
To: Emmanuel Dreyfus <p99dreyf@criens.u-psud.fr>
From: Jaromír <jdolecek@netbsd.org>
List: tech-kern
Date: 03/24/2001 10:29:55
Note linux_e_proc_exec() is also called via linux_e_proc_fork().
The e_proc_fork() hook is called in fork1(), before the child's
vmspace is set up (i.e. before call uvm_fork() - it has to be this
way, since child uses completely different MD exit path from
uvm_fork()).

So it's expected that the new process's vmspace would be invalid
or NULL at time linux_e_proc_fork() is called. I have what I think
is almost correct solution already (see "hard lockups with -current
and Netscape" thread on current-users@); will commit it shortly.

Yeah, the bug was introduced in the recent brk-related commit.
BTW, the brk() handling is not thread aware; all the
threads should share single brk() value, since they also
share vmspace, so that part of p_emuldata should be shared
between threads. This may need a change to interface of e_proc_fork()
hook, so that it would know fork1() flags and may act accordingly.

Jaromir

Emmanuel Dreyfus wrote:
> > Yes, it looks like something is broken. However, the last person
> > to touch the Linux compat code in this area was you..
> 
> I made more test, and it's probably my fault. If I removed the changes I
> added on version 1.46 of linux_exec.c, and it does not panic anymore.
> 
> Anyway, I still think there is another problem somewhere else: I
> upgraded to -current two days ago to test for that bug. Before
> upgrading, I already have the change in linux_exec.c, but I had no
> kernel panic problems. So I think that there are two differents problems
> that end up in a kernel panic. 
> 
> I've replied to kern/12455, and I'll do more tests this weekend to
> understand where this is comming from.
> 
> -- 
> Emmanuel Dreyfus.  Cette signature vous est fournie telle quelle, sans 
> aucune garantie de fonctionnement. En la lisant, vous acceptez 
> implicitement tous les degats qu'elle pourrait causer, materiellement 
> ou logiciellement.                   p99dreyf@criens.u-psud.fr 
> 


-- 
Jaromir Dolecek <jdolecek@NetBSD.org>      http://www.ics.muni.cz/~dolecek/
 ***  Wanna a real operating system ? Go and get NetBSD, dammit!  ***