NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: kern/54922: 9.99.45@20200202 panic: diagnostic assertion linux ldconfig triggers vpp != NULL in exit1()->radixtree.c line 674



The following reply was made to PR kern/54922; it has been noted by GNATS.

From: Andrew Doran <ad%netbsd.org@localhost>
To: Joerg Sonnenberger <joerg%bec.de@localhost>
Cc: gnats-bugs%netbsd.org@localhost, kardel%netbsd.org@localhost
Subject: Re: kern/54922: 9.99.45@20200202 panic: diagnostic assertion linux
 ldconfig triggers vpp != NULL in exit1()->radixtree.c line 674
Date: Sat, 8 Feb 2020 21:09:18 +0000

 Thank you Joerg.  Here is a more complete patch with locking etc., largely
 cut'n'paste.  I can't commit it right now; if someone else wants to, please
 do so.
 
 	http://www.netbsd.org/~ad/2020/linux.diff
 
 Andrew
 
 On Wed, Feb 05, 2020 at 01:04:57AM +0100, Joerg Sonnenberger wrote:
 
 > On Tue, Feb 04, 2020 at 11:40:01PM +0000, Andrew Doran wrote:
 > > The following reply was made to PR kern/54922; it has been noted by GNATS.
 > > 
 > > From: Andrew Doran <ad%netbsd.org@localhost>
 > > To: gnats-bugs%netbsd.org@localhost
 > > Cc: 
 > > Subject: Re: kern/54922: 9.99.45@20200202 panic: diagnostic assertion linux
 > >  ldconfig triggers vpp != NULL in exit1()->radixtree.c line 674
 > > Date: Tue, 4 Feb 2020 23:36:14 +0000
 > > 
 > >  It looks like I missed two cases where the LID is being changed on the fly:
 > >  in linux_e_proc_exec() and linux_e_proc_fork().  Wouldn't think compat code
 > >  would be doing something like that, but there it is.  Ugh.
 > 
 > I've run into this as well. The attached patch seems to work.
 > 
 > Joerg
 
 > diff -r 7bd8a382b8db sys/compat/linux/common/linux_exec.c
 > --- a/sys/compat/linux/common/linux_exec.c	Thu Jan 30 21:39:28 2020 +0100
 > +++ b/sys/compat/linux/common/linux_exec.c	Wed Feb 05 01:04:22 2020 +0100
 > @@ -130,6 +130,10 @@
 >  	KASSERT(p->p_nlwps == 1);
 >  	l = LIST_FIRST(&p->p_lwps);
 >  	mutex_enter(p->p_lock);
 > +	if (l->l_lid != p->p_pid) {
 > +		radix_tree_remove_node(&p->p_lwptree, (uint64_t)(l->l_lid - 1));
 > +		radix_tree_insert_node(&p->p_lwptree, (uint64_t)(p->p_pid - 1), l);
 > +	}
 >  	l->l_lid = p->p_pid;
 >  	mutex_exit(p->p_lock);
 >  }
 > @@ -152,6 +156,10 @@
 >  
 >  	KASSERT(p2->p_nlwps == 1);
 >  	l2 = LIST_FIRST(&p2->p_lwps);
 > +	if (l2->l_lid != p2->p_pid) {
 > +		radix_tree_remove_node(&p2->p_lwptree, (uint64_t)(l2->l_lid - 1));
 > +		radix_tree_insert_node(&p2->p_lwptree, (uint64_t)(p2->p_pid - 1), l2);
 > +	}
 >  	l2->l_lid = p2->p_pid;
 >  	led1 = l1->l_emuldata;
 >  	led2 = l2->l_emuldata;
 


Home | Main Index | Thread Index | Old Index