On Thu 17 Dec 2009 at 01:58PM, Edward Pilatowicz wrote: > lgtm. > ed > > On Thu, Dec 17, 2009 at 07:17:50PM +0100, Frank Batschulat (Home) wrote: > > May I have 2 code reviewers for: > > > > 6911329 Incorrect code in kstat_delete causes panic > > http://cr.opensolaris.org/~batschul/onnvkstat/ > > > > Description > > > > A colleague was looking into a crash and the reason turned out to be a > > NULL pointer dereference in kstat_delete(): > > > > kstat_delete(kstat_t *ksp) > > { kmutex_t *lp; > > ekstat_t *e = (ekstat_t *)ksp; > > zoneid_t zoneid = e->e_zone.zoneid; > > kstat_zone_t *kz; > > > > if (ksp == NULL) > > return; > > > > Note that there is a dereference of 'ksp' [via 'e'] before the check for > > ksp being NULL. > > > > unfortunately we don't have a dump/stacktrace anymore to inspect who > > called kstat_delete(NULL) and why.
Do we really think that ksp being NULL is a invalid condition? If it's invalid, then why not add an assertion, so we can root-cause. Or has this if (ksp == NULL) been there forever and ever and there are drivers abusing it? I see a bunch of cmn_err's in kstat_create-- are there log files from the machine which might indicate that there was a kstat_create which returned NULL? -dp -- Daniel Price, Solaris Kernel Engineering http://blogs.sun.com/dp _______________________________________________ zones-discuss mailing list zones-discuss@opensolaris.org