[cl-debian] Bug#344415: marked as done (cl-mcclim: is incompatible with recent SBCL's threading API)

Debian Bug Tracking System owner at bugs.debian.org
Fri Dec 23 23:33:10 UTC 2005


Your message dated Fri, 23 Dec 2005 15:17:06 -0800
with message-id <E1Epw9q-0003wj-Uz at spohr.debian.org>
and subject line Bug#344415: fixed in cl-mcclim 0.9.1-3
has caused the attached Bug report to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what I am
talking about this indicates a serious mail system misconfiguration
somewhere.  Please contact me immediately.)

Debian bug tracking system administrator
(administrator, Debian Bugs database)

--------------------------------------
Received: (at submit) by bugs.debian.org; 22 Dec 2005 15:35:30 +0000
>From rvb at progn.org Thu Dec 22 07:35:30 2005
Return-path: <rvb at progn.org>
Received: from progn.org ([217.160.129.69])
	by spohr.debian.org with esmtp (Exim 4.50)
	id 1EpSTa-0000BL-B1
	for submit at bugs.debian.org; Thu, 22 Dec 2005 07:35:30 -0800
Received: from rvb by progn.org with local (Exim 4.50)
	id 1EpSTD-0005uc-Vv
	for submit at bugs.debian.org; Thu, 22 Dec 2005 16:35:08 +0100
Content-Type: multipart/mixed; boundary="===============1929391807=="
MIME-Version: 1.0
From: =?utf-8?q?Ren=C3=A9_van_Bevern?= <rvb at progn.org>
To: Debian Bug Tracking System <submit at bugs.debian.org>
Subject: cl-mcclim: is incompatible with recent SBCL's threading API
X-Mailer: reportbug 3.8
Date: Thu, 22 Dec 2005 16:35:07 +0100
Message-Id: <E1EpSTD-0005uc-Vv at progn.org>
Delivered-To: submit at bugs.debian.org
X-Spam-Checker-Version: SpamAssassin 2.60-bugs.debian.org_2005_01_02 
	(1.212-2003-09-23-exp) on spohr.debian.org
X-Spam-Level: 
X-Spam-Status: No, hits=-7.0 required=4.0 tests=BAYES_01,HAS_PACKAGE 
	autolearn=no version=2.60-bugs.debian.org_2005_01_02

This is a multi-part MIME message sent by reportbug.

--===============1929391807==
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Content-Type: text/plain; charset="UTF-8"
Content-Disposition: inline

Package: cl-mcclim
Severity: normal
Tags: patch etch sid

Since SBCL 0.9.3, there is a new API for threading. The McClim version
in Debian Unstable and Testing still uses the old API and therefore fails
being compiled by recent SBCL versions in these Debian distributions:

; /var/cache/common-lisp-controller/rvb/sbcl/mcclim/Lisp-Dep/mp-sbcl.fasl written
; compilation finished in 0:00:01
WARNING:
   COMPILE-FILE warned while performing #<COMPILE-OP NIL {B825DD9}> on
   #<CL-SOURCE-FILE "mp-sbcl" {B6FD599}>.

debugger invoked on a ASDF:COMPILE-FAILED in thread
#<THREAD "initial thread" {AA83491}>:
  erred while invoking #<COMPILE-OP NIL {B825DD9}> on
  #<CL-SOURCE-FILE "mp-sbcl" {B6FD599}>

Type HELP for debugger help, or (SB-EXT:QUIT) to exit from SBCL.

restarts (invokable by number or by possibly-abbreviated name):
  0: [RETRY ] Retry performing #<ASDF:COMPILE-OP NIL {B825DD9}> on
              #<ASDF:CL-SOURCE-FILE "mp-sbcl" {B6FD599}>.
  1: [ACCEPT] Continue, treating #<ASDF:COMPILE-OP NIL {B825DD9}> on
              #<ASDF:CL-SOURCE-FILE "mp-sbcl" {B6FD599}> as having been
              successful.
  2: [ABORT ] Exit debugger, returning to top level.

The current CVS version of McClim contains updates for the new SBCL threading API.
I am attaching the extracted patch and hereby report that applying these patches
makes SBCL compile McClim cleanly.

Thank you for considering,
	René van Bevern

--===============1929391807==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename="sbcl-threading.diff"

===================================================================
RCS file: /project/mcclim/cvsroot/mcclim/Lisp-Dep/mp-sbcl.lisp,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- mcclim/Lisp-Dep/mp-sbcl.lisp	2005/07/01 14:53:42	1.7
+++ mcclim/Lisp-Dep/mp-sbcl.lisp	2005/07/15 16:36:58	1.8
@@ -56,9 +56,14 @@
 (defvar *all-processes-lock*
   (sb-thread:make-mutex :name "Lock around *ALL-PROCESSES*"))
 
+;; we implement disable-process by making the disablee attempt to lock
+;; *permanent-queue*, which is already locked because we locked it
+;; here.  enable-process just interrupts the lock attempt.
+
 (defvar *permanent-queue*
-  (sb-thread:make-mutex :name "Lock for disabled threads"
-			:data :permanently-queued))
+  (sb-thread:make-mutex :name "Lock for disabled threads"))
+(unless (sb-thread:mutex-value *permanent-queue*)
+  (sb-thread:get-mutex *permanent-queue* :locked nil))
 
 (defun make-process (function &key name)
   (let ((p (%make-process :name name :function function)))
@@ -146,16 +151,15 @@
 (defmacro without-scheduling (&body body)
   `(progn , at body))
 
-(defparameter *atomic-queue*
-  #+xlib xlib::*conditional-store-queue*
-  #-xlib (sb-thread:make-waitqueue :name "atomic incf/decf"))
+(defparameter *atomic-lock*
+  (sb-thread:make-mutex :name "atomic incf/decf"))
 
 (defmacro atomic-incf (place)
-  `(sb-thread::with-spinlock (*atomic-queue*)
+  `(sb-thread:with-mutex (*atomic-lock*)
     (incf ,place)))
 
 (defmacro atomic-decf (place) 
-  `(sb-thread::with-spinlock (*atomic-queue*)
+  `(sb-thread:with-mutex (*atomic-lock*)
     (decf ,place)))
 
 ;;; 32.3 Locks
===================================================================
RCS file: /project/mcclim/cvsroot/mcclim/Lisp-Dep/mp-sbcl.lisp,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- mcclim/Lisp-Dep/mp-sbcl.lisp	2004/02/23 10:48:28	1.6
+++ mcclim/Lisp-Dep/mp-sbcl.lisp	2005/07/01 14:53:42	1.7
@@ -40,41 +40,54 @@
   state
   whostate
   function
-  id)
+  thread)
 
 (defvar *current-process*
-  (%make-process :name "initial process" :function nil :id (sb-thread:current-thread-id)))
+  (%make-process
+   :name "initial process" :function nil
+   :thread
+   #+#.(cl:if (cl:find-symbol "THREAD-NAME" "SB-THREAD") '(and) '(or))
+   sb-thread:*current-thread*
+   #-#.(cl:if (cl:find-symbol "THREAD-NAME" "SB-THREAD") '(and) '(or))
+   (sb-thread:current-thread-id)))
 
 (defvar *all-processes* (list *current-process*))
 
+(defvar *all-processes-lock*
+  (sb-thread:make-mutex :name "Lock around *ALL-PROCESSES*"))
+
 (defvar *permanent-queue*
   (sb-thread:make-mutex :name "Lock for disabled threads"
 			:data :permanently-queued))
 
 (defun make-process (function &key name)
-  (let ((p (%make-process :name name
-			  :function function)))
-    (pushnew p *all-processes*)
+  (let ((p (%make-process :name name :function function)))
+    (sb-thread:with-mutex (*all-processes-lock*)
+      (pushnew p *all-processes*))
     (restart-process p)))
 
 (defun restart-process (p)
   (labels ((boing ()
 	     (let ((*current-process* p))
 	       (funcall (process-function p) ))))
-    (when (process-id p) (sb-thread:terminate-thread p))
-    (when (setf (process-id p) (sb-thread:make-thread #'boing))
+    (when (process-thread p) (sb-thread:terminate-thread p))
+    (when (setf (process-thread p) (sb-thread:make-thread #'boing))
       p)))
 
 (defun destroy-process (process)
-  ;;; ew threadsafety
-  (setf *all-processes* (delete process *all-processes*))
-  (sb-thread:terminate-thread (process-id process)))
+  (sb-thread:with-mutex (*all-processes-lock*)
+    (setf *all-processes* (delete process *all-processes*)))
+  (sb-thread:terminate-thread (process-thread process)))
 
 (defun current-process ()
   *current-process*)
 
 (defun all-processes ()
-  *all-processes*)
+  ;; we're calling DELETE on *ALL-PROCESSES*.  If we look up the value
+  ;; while that delete is executing, we could end up with nonsense.
+  ;; Better use a lock (or call REMOVE instead in DESTROY-PROCESS).
+  (sb-thread:with-mutex (*all-processes-lock*)
+    *all-processes*))
 
 ;;; people should be shot for using these, honestly.  Use a queue!
 (declaim (inline yield))
@@ -113,17 +126,17 @@
       (setf (process-whostate *current-process*) old-state))))
 
 (defun process-interrupt (process function)
-  (sb-thread:interrupt-thread (process-id process) function))
+  (sb-thread:interrupt-thread (process-thread process) function))
 
 (defun disable-process (process)
   (sb-thread:interrupt-thread
-   (process-id process)
+   (process-thread process)
    (lambda ()
      (catch 'interrupted-wait (sb-thread:get-mutex *permanent-queue*)))))
 
 (defun enable-process (process)
   (sb-thread:interrupt-thread
-   (process-id process) (lambda () (throw 'interrupted-wait nil))))
+   (process-thread process) (lambda () (throw 'interrupted-wait nil))))
 
 (defun process-yield ()
   (sleep .1))

--===============1929391807==--

---------------------------------------
Received: (at 344415-close) by bugs.debian.org; 23 Dec 2005 23:21:00 +0000
>From katie at ftp-master.debian.org Fri Dec 23 15:21:00 2005
Return-path: <katie at ftp-master.debian.org>
Received: from katie by spohr.debian.org with local (Exim 4.50)
	id 1Epw9q-0003wj-Uz; Fri, 23 Dec 2005 15:17:06 -0800
From: Milan Zamazal <pdm at debian.org>
To: 344415-close at bugs.debian.org
X-Katie: $Revision: 1.65 $
Subject: Bug#344415: fixed in cl-mcclim 0.9.1-3
Message-Id: <E1Epw9q-0003wj-Uz at spohr.debian.org>
Sender: Archive Administrator <katie at ftp-master.debian.org>
Date: Fri, 23 Dec 2005 15:17:06 -0800
X-Spam-Checker-Version: SpamAssassin 2.60-bugs.debian.org_2005_01_02 
	(1.212-2003-09-23-exp) on spohr.debian.org
X-Spam-Level: 
X-Spam-Status: No, hits=-6.0 required=4.0 tests=BAYES_00,HAS_BUG_NUMBER 
	autolearn=no version=2.60-bugs.debian.org_2005_01_02

Source: cl-mcclim
Source-Version: 0.9.1-3

We believe that the bug you reported is fixed in the latest version of
cl-mcclim, which is due to be installed in the Debian FTP archive:

cl-mcclim-doc_0.9.1-3_all.deb
  to pool/main/c/cl-mcclim/cl-mcclim-doc_0.9.1-3_all.deb
cl-mcclim-examples_0.9.1-3_all.deb
  to pool/main/c/cl-mcclim/cl-mcclim-examples_0.9.1-3_all.deb
cl-mcclim_0.9.1-3.diff.gz
  to pool/main/c/cl-mcclim/cl-mcclim_0.9.1-3.diff.gz
cl-mcclim_0.9.1-3.dsc
  to pool/main/c/cl-mcclim/cl-mcclim_0.9.1-3.dsc
cl-mcclim_0.9.1-3_all.deb
  to pool/main/c/cl-mcclim/cl-mcclim_0.9.1-3_all.deb



A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 344415 at bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Milan Zamazal <pdm at debian.org> (supplier of updated cl-mcclim package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster at debian.org)


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Format: 1.7
Date: Fri, 23 Dec 2005 21:33:06 +0100
Source: cl-mcclim
Binary: cl-mcclim-doc cl-mcclim-examples cl-mcclim
Architecture: source all
Version: 0.9.1-3
Distribution: unstable
Urgency: low
Maintainer: Milan Zamazal <pdm at debian.org>
Changed-By: Milan Zamazal <pdm at debian.org>
Description: 
 cl-mcclim  - Common Lisp graphic user interface toolkit
 cl-mcclim-doc - Graphic user interface package for Common Lisp programs
 cl-mcclim-examples - Common Lisp graphic user interface toolkit
Closes: 344415
Changes: 
 cl-mcclim (0.9.1-3) unstable; urgency=low
 .
   * Support for new SBCL threading API added; thanks to
     René van Bevern <rvb at progn.org>; closes: #344415.
   * Standards 3.6.2 (no real change).
Files: 
 3f30d75991e26589dcbce2c61923159a 631 devel optional cl-mcclim_0.9.1-3.dsc
 59f96c36a693050069ca2646e8134264 6505 devel optional cl-mcclim_0.9.1-3.diff.gz
 00be2d80bde6867386945c0b56b18701 1969136 devel optional cl-mcclim_0.9.1-3_all.deb
 52f0fd3249f622bc9f3b25fa743bb1cf 32076 devel optional cl-mcclim-examples_0.9.1-3_all.deb
 285ff06f149403c34322172cef813214 172298 devel optional cl-mcclim-doc_0.9.1-3_all.deb

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)

iD8DBQFDrF9akSkk/j3Cm0ERAqF8AKDFLuXkAeZSQ1KhDaGqHK4eJq1QNwCggLA0
Eebx4amDo3fNfXfwlW1enlM=
=gCFy
-----END PGP SIGNATURE-----





More information about the Cl-debian mailing list