6452185 fmd can deadlock on exit if fmd-self-diagnosis is processing an ereport during module unload
--- a/usr/src/cmd/fm/fmd/common/fmd.c Tue Jul 25 13:52:56 2006 -0700
+++ b/usr/src/cmd/fm/fmd/common/fmd.c Tue Jul 25 14:29:01 2006 -0700
@@ -514,11 +514,15 @@
* hold the dispq lock as a writer while doing so since it uses d_self.
*/
if (dp->d_self != NULL) {
+ fmd_module_t *self;
+
(void) pthread_rwlock_wrlock(&dp->d_disp->dq_lock);
- fmd_module_unload(dp->d_self);
- fmd_module_rele(dp->d_self);
+ self = dp->d_self;
dp->d_self = NULL;
(void) pthread_rwlock_unlock(&dp->d_disp->dq_lock);
+
+ fmd_module_unload(self);
+ fmd_module_rele(self);
}
/*