Quantcast

misc/95103: panic after mtx_destroy() on locked spinlock

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

misc/95103: panic after mtx_destroy() on locked spinlock

Tomas Olsson

>Number:         95103
>Category:       misc
>Synopsis:       panic after mtx_destroy() on locked spinlock
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:      
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Mar 30 11:10:14 GMT 2006
>Closed-Date:
>Last-Modified:
>Originator:     Tomas Olsson
>Release:        5.5-BETA4
>Organization:
Stacken Computer Club
>Environment:
FreeBSD lab04.lab.it.su.se 5.5-BETA4 FreeBSD 5.5-BETA4 #0: Mon Mar 13 23:12:57 UTC 2006     [hidden email]:/usr/obj/usr/src/sys/GENERIC  i386

>Description:
MUTEX(9) man page, under mtx_destroy() says:
    It is permissible to have a single hold count on a mutex when it is destroyed.

This does not seem to be the case when the mutex is a MTX_SPIN lock. I get a panic very soon after I call mtx_destroy() during kld unload unless the lock is released. Page fault in user mode seems to be a common panic "cause" for this.

With a MTX_DEF it appears to work according to docs.
>How-To-Repeat:
{
struct mtx lock;
mtx_init(&lock, "foo", NULL, MTX_SPIN);
mtx_lock_spin(&lock);
mtx_destroy(&lock);
}
(tried during kld unload)
>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:
_______________________________________________
[hidden email] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-bugs
To unsubscribe, send any mail to "[hidden email]"
Loading...