From owner-freebsd-bugs Fri Mar 17 5:20: 7 2000 Delivered-To: freebsd-bugs@freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.ORG [204.216.27.21]) by hub.freebsd.org (Postfix) with ESMTP id 3FF5437BDAA for ; Fri, 17 Mar 2000 05:20:01 -0800 (PST) (envelope-from gnats@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.9.3/8.9.2) id FAA85994; Fri, 17 Mar 2000 05:20:01 -0800 (PST) (envelope-from gnats@FreeBSD.org) Received: from rccr1.rccr.cremona.it (rccr1.rccr.cremona.it [194.20.53.49]) by hub.freebsd.org (Postfix) with ESMTP id B305437BD86 for ; Fri, 17 Mar 2000 05:19:31 -0800 (PST) (envelope-from mirko.viviani@rccr.cremona.it) Received: from mailman.endymion.com (rccr1.rccr.cremona.it [194.20.53.49] (may be forged)) by rccr1.rccr.cremona.it (8.9.3/8.9.3) with SMTP id OAA05556 for ; Fri, 17 Mar 2000 14:16:16 +0100 Message-Id: <200003171316.OAA05556@rccr1.rccr.cremona.it> Date: Fri, 17 Mar 2000 14:16:17 +0000 From: mirko.viviani@rccr.cremona.it To: FreeBSD-gnats-submit@freebsd.org Subject: gnu/17433: libobjc locks mutex before deallocating it Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org >Number: 17433 >Category: gnu >Synopsis: libobjc locks mutex before deallocating it >Confidential: no >Severity: serious >Priority: high >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Fri Mar 17 05:20:00 PST 2000 >Closed-Date: >Last-Modified: >Originator: Mirko Viviani >Release: FreeBSD 3.4-STABLE i386 >Organization: >Environment: >Description: In the 4.0-RELEASE (and lower) libobjc there is a but in the posix thread implementation. It locks the mutex before deallocating it. Anyway in 4.0 is libobjc compiled with thr-posix.c ? I haven't tested 4.0 yet, but I hope yes. >How-To-Repeat: Run any of the GNUstep application that uses threads linked with libobjc compiled with thr-posix support. >Fix: src/contrib/gcc/objc/thr.c - objc_mutex_deallocate() should be changed to: int objc_mutex_deallocate(objc_mutex_t mutex) { int depth; /* Valid mutex? */ if (!mutex) return -1; #if 0 /* Acquire lock on mutex */ depth = objc_mutex_lock(mutex); #endif depth = 1; /* Call backend to destroy mutex */ if (__objc_mutex_deallocate(mutex)) return -1; /* Free the mutex structure */ objc_free(mutex); /* Return last depth */ return depth; } >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message