gcl-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gcl-devel] Re: Chasing down a compiler bug


From: Matt Kaufmann
Subject: [Gcl-devel] Re: Chasing down a compiler bug
Date: Tue, 24 Feb 2004 16:33:09 -0600

Hi, Camm --

I have a feeling that what I'm about to suggest already occurred to you (or
maybe something simpler did), and you've already ruled it out.  That said:

I wonder if you could just print every call, like this:

(defun remove-after-last-directory-separator (p)
  (format t "(remove-after-last-directory-separator ~s)~%" p)
  (let* ((p-rev (reverse p))
         (posn (position *directory-separator* p-rev)))
    (if posn
        (subseq p 0 (1- (- (length p) posn)))
      (er hard 'remove-after-last-directory-separator
          "Implementation error!  Unable to handle a directory string."))))

The last such format issued before an error would at least lead to the
offending call.

Sorry if I missed your point though (as I suspect I did).  Feel free to try
asking again.

Here's an alternate idea that is superseded by my suggestion above, but since
it's what I first thought of I figure I might as well mention it:

(defvar *my-stream* (open "xxx" :direction :input))

(defun my-assert (x)
  (or (eval x)
      (error "Assertion failed, ~s" x)))

Then at the end of the run:

(load "xxx")

An error would at least show that it's not GCL's fault.

(defun remove-after-last-directory-separator (p)
  (let* ((p-rev (reverse p))
         (posn (progn (format t
                              "(my-assert (equal '~s (reverse '~s)))~%"
                              p-rev p)
                      (position *directory-separator* p-rev))))
    (format t
            "(my-assert (equal '~s (position *directory-separator* '~s)))~%"
            posn p-rev)
    (if posn
        (subseq p 0 (1- (- (length p) posn)))
      (er hard 'remove-after-last-directory-separator
          "Implementation error!  Unable to handle a directory string."))))

-- Matt
   Cc: address@hidden, address@hidden
   From: Camm Maguire <address@hidden>
   Date: 24 Feb 2004 17:14:04 -0500
   User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2
   Content-Type: text/plain; charset=us-ascii

   Greetings!  There is what in all likelihood appears to be a gcc
   optimization bug on hppa which is erratically causing the acl2 full
   test to fail when any optimization at all is enabled.  Some runs of
   the book certifier pass, others fail, but when they fail, it is in
   precisely the same point:

   (defun remove-after-last-directory-separator (p)
     (let* ((p-rev (reverse p))
            (posn (position *directory-separator* p-rev)))
       (if posn
           (subseq p 0 (1- (- (length p) posn)))
         (er hard 'remove-after-last-directory-separator
             "Implementation error!  Unable to handle a directory string."))))

   Evidently posn is nil at times when it shouldn't be.

   I want to make sure this is not gcl's fault, preferably before
   release. 

   In any case, acl2 is so well isolated from the underlying lisp that I
   am hard pressed to simply set a gdb break point at this failure.  I
   can't use format, error, anything I can trap.  Do you have any advice? 

   Take care,
   -- 
   Camm Maguire                                         address@hidden
   ==========================================================================
   "The earth is but one country, and mankind its citizens."  --  Baha'u'llah




reply via email to

[Prev in Thread] Current Thread [Next in Thread]