Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 25 Jun 2007 22:31:46 +0300
From:      Danny Braniss <danny@cs.huji.ac.il>
To:        Julian Elischer <julian@elischer.org>
Cc:        freebsd-hackers@freebsd.org, freebsd-current@FreeBSD.ORG
Subject:   Re: KSE was Re: open/close/ioctl api change? 
Message-ID:  <E1I2uHq-000DkP-E7@cs1.cs.huji.ac.il>
In-Reply-To: Your message of Mon, 25 Jun 2007 12:20:06 -0700 .

next in thread | raw e-mail | index | archive | help
> Danny Braniss wrote:
> >> Danny Braniss wrote:
> >>>> actually it's the struct thread *tp where my problems are,
> >>>> this code works fine under 6.2, and did work till some days ago under current.
> >>>>
> >>>> static int
> >>>> iscsi_open(struct cdev *dev, int flags, int otype, struct thread *td)
> >>>> {
> >>>> ...
> >>>> 	debug(3, "td->td_proc=%p", td->td_proc);
> >>>> 	debug(3, "td->td_proc->p_pid=%d pid=%d",
> >>>> 	   td->td_proc->p_pid, curproc->p_pid);
> >>>> ...
> >>>>
> >>>> the first debug prints out td->td_proc=0 and the next one panics.
> >>> found the problem, 'option KSE' which is defined now in DEFAULTS,
> >>> and i'm compiling a module! which does not include DEFAULTS!
> >>>
> >> even so it shouldnt' happen..
> >>
> > why? I'm compiling outside the source tree.
> > I agree that it shouldn't, specially, since it took me a long
> > time to find the problem :-), but I can't see how config options
> > can be exported. Unless, the make file is made aware of the KERNCONF file.
> 
> there should be no place in the source at any time where a thread 
> that is not on the free list could have a td_proc of NULL.
> it doesn't matter about where a module came from etc.. the fact that
> it happened is a bug somewhere.

Julian,
I compiled the kernel, and DEFAULT contains
	option KSE
then I compiled the loadable module, outside the source tree, where
KSE is not defined, the thread structure has #ifdef KSE ... #endif
so my module sees a different thread structure. The real arguable issue
is that the #ifdef KSE is below the *td_proc, So td->proc should not
be affected by the ifdef. BTW, it was NULL when compiled for i386,
garbage for amd64.

	danny







Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?E1I2uHq-000DkP-E7>