Re: panic after ifioctl/if_clone_destroy

2018-08-11 Thread Roman Bogorodskiy
Hans Petter Selasky wrote: > On 8/11/18 9:44 AM, Roman Bogorodskiy wrote: > >Hans Petter Selasky wrote: > > > >> On 08/06/18 21:43, Matthew Macy wrote: > >>> The struct thread is typesafe. The problem is that the link is no longer > >>> typesafe now that it’s not part of the thread. Thanks

Re: panic after ifioctl/if_clone_destroy

2018-08-11 Thread Hans Petter Selasky
On 8/11/18 9:44 AM, Roman Bogorodskiy wrote: Hans Petter Selasky wrote: On 08/06/18 21:43, Matthew Macy wrote: The struct thread is typesafe. The problem is that the link is no longer typesafe now that it’s not part of the thread. Thanks for pointing this out. I’ll commit a fix later

Re: panic after ifioctl/if_clone_destroy

2018-08-11 Thread Roman Bogorodskiy
Hans Petter Selasky wrote: > On 08/06/18 21:43, Matthew Macy wrote: > > The struct thread is typesafe. The problem is that the link is no longer > > typesafe now that it’s not part of the thread. Thanks for pointing this > > out. I’ll commit a fix later today. > > > > Is there a patch yet? >

Re: panic after ifioctl/if_clone_destroy

2018-08-08 Thread Hans Petter Selasky
On 08/06/18 21:43, Matthew Macy wrote: The struct thread is typesafe. The problem is that the link is no longer typesafe now that it’s not part of the thread. Thanks for pointing this out. I’ll commit a fix later today. Is there a patch yet? --HPS

Re: panic after ifioctl/if_clone_destroy

2018-08-06 Thread Matthew Macy
The struct thread is typesafe. The problem is that the link is no longer typesafe now that it’s not part of the thread. Thanks for pointing this out. I’ll commit a fix later today. -M On Mon, Aug 6, 2018 at 02:39 Hans Petter Selasky wrote: > Hi Matthew, > > On 08/06/18 10:02, Hans Petter

Re: panic after ifioctl/if_clone_destroy

2018-08-06 Thread Roman Bogorodskiy
Hans Petter Selasky wrote: > Hi Roman, > > Can you try the attached patch? > > --HPS Thanks for the patch, works fine so far. I'll give it more testing in the next few days. Roman Bogorodskiy signature.asc Description: PGP signature

Re: panic after ifioctl/if_clone_destroy

2018-08-06 Thread Hans Petter Selasky
Hi Matthew, On 08/06/18 10:02, Hans Petter Selasky wrote: - if ((tdwait = TAILQ_FIRST(>er_tdlist)) != NULL && - TD_IS_RUNNING(tdwait->et_td)) { At least the TD_IS_RUNNING() check is invalid. The "tdwait" structure is in the control of the other CPU and

Re: panic after ifioctl/if_clone_destroy

2018-08-06 Thread Hans Petter Selasky
Hi Roman, Can you try the attached patch? --HPS Index: sys/kern/subr_epoch.c === --- sys/kern/subr_epoch.c (revision 336962) +++ sys/kern/subr_epoch.c (working copy) @@ -232,33 +232,14 @@ struct epoch_thread *tdwait; struct

Re: panic after ifioctl/if_clone_destroy

2018-08-06 Thread Hans Petter Selasky
Hi, I think the problem is the thread pointed to by tdwait exited. I would say it is not allowed to peek into the other records threads, because they may change under the hood and are not protected by the current context. if (record->er_cpuid != curcpu) { This optimisation is

Re: panic after ifioctl/if_clone_destroy

2018-08-05 Thread Matthew Macy
If you could give me a self-contained reproducer that would expedite a fix. Thanks. -M On Sun, Aug 5, 2018 at 08:36 Roman Bogorodskiy wrote: > Running -CURRENT r336863 on amd64. Get the following panic right after > (or during) boot: > > Fatal trap 12: page fault while in kernel mode > cpuid =