pfa019.001 regression UNINTERN leaks symbol into FASL

Madhu <[email protected]> Fri, 26 Dec 2008 18:39:42 +0530
Newsgroups gmane.lisp.allegro
Message-ID <[email protected]>
--=-=-=


,----
| Date Posted: Wed Nov 12 16:01:26 PST 2008
| Patch names: update/pfa019.001
| Description: Fix to unintern which was incorrectly testing for
|   matching symbols based on symbol-name. Also fixes shadowing-import
|   which was not importing argument symbols that were accessible, but
|   not present, in the specified package.
| Impact: recommended
`----

This change seems to leave a literal uninterned symbol around in the
compilation environment and fasl file.  Attached is a test file and
dribble output showing the steps to illustrate the problem.  

[I'm noticed this on acl81_express linux86 in the cl-http acl port. The
 EVAL-WHEN enveloping the forms in the test file are there to mimic the
 problem there, but are not important.  The problem can be worked around
 by not passing a literal symbol to the unintern call.] --Madhu


--=-=-=
Content-Disposition: inline; filename=test-pfa019001.lisp

(in-package "CL-USER")

(eval-when (load eval compile)
  (when (find-package "FOO-PACKAGE")
    (delete-package (find-package "FOO-PACKAGE")))
  (when (find-package "BAR-PACKAGE")
    (delete-package (find-package "BAR-PACKAGE"))))

(defpackage "FOO-PACKAGE"
  (:export "BAR-SYMBOL"))

(defpackage "BAR-PACKAGE"
  (:export "BAR-SYMBOL"))

(eval-when (load eval compile)
  (unintern 'foo-package:bar-symbol :FOO-PACKAGE))

(defpackage "FOO-PACKAGE"
  (:import-from "BAR-PACKAGE" "BAR-SYMBOL"))

--=-=-=
Content-Disposition: inline; filename=dribble-pfa019001.txt

CL-USER(20): (load "test-pfa019001.lisp")
; Loading test-pfa019001.lisp
T
CL-USER(21): (compile-file "test-pfa019001.lisp")
;;; Compiling file test-pfa019001.lisp
;;; Writing fasl file test-pfa019001.fasl
;;; Fasl write complete
#P"/home/madhu/test-pfa019001.fasl"
NIL
NIL
CL-USER(22): (load "test-pfa019001")
; Fast loading test-pfa019001.fasl
Error: Importing these symbols into the FOO-PACKAGE package causes a name
       conflict:
(BAR-PACKAGE:BAR-SYMBOL)
  [condition type: PACKAGE-ERROR]

Restart actions (select using :continue):
 0: Import these symbols with Shadowing-Import.
 1: retry the load of test-pfa019001
 2: skip loading test-pfa019001
 3: recompile /home/madhu/test-pfa019001.lisp
 4: Return to Top Level (an "abort" restart).
 5: Abort entirely from this (lisp) process.
[1c] CL-USER(23): (dribble)

--=-=-=--