scsh-users
[Top] [All Lists]

Re: scsh 0.6.0 (possible) bug

To: Martin Gasbichler <gasbichl@informatik.uni-tuebingen.de>
Subject: Re: scsh 0.6.0 (possible) bug
From: Sriram Thaiyar <sri@asu.edu>
Date: Tue, 23 Oct 2001 14:28:48 -0700
Cc: scsh-bugs@zurich.ai.mit.edu
Sender: sthaiyar@general2.asu.edu
[apologies to Martin for replying to him without inserting my
bug report]

I have put down whatever came to my head, that IMO could be a possible
cause of the bug.  So some things might excessive...

I am working under the AFS system (andrew file system?).  IIRC,
building some gnu programs (bash?), had an optional `--with-afs'
option.  Could this be a source of the problem?


Here is output from `uname -a':

SunOS general1 5.7 Generic_106541-12 sun4u sparc SUNW,Ultra-60

But inside scsh-0.6 directory the machine file is a link to solaris:

  lrwxr-xr-x   1 sthaiyar sthaiyar        9 Oct 19 02:02 machine -> ./solaris

I don't know the difference between Sunos & Solaris....


**********************************************************************
Actually, entering the expression into a fresh scsh-0.6 alpha, not
only fails, but *every* expression after that fails:

welcome to scsh-0.6 alpha 
> (with-cwd "/tmp"
 (filter (lambda (file) (= (file-owner file) (user-uid)))
            (directory-files)))

Error: exception
       wrong-type-argument
       (return-from-callback "scheme_stat" <Error while displaying condition.>
1> (run (uname -a))

Error: exception
       gc-protection-mismatch
       (call-external-value "scm_envvec")
2> (run (ls))

Error: exception
       gc-protection-mismatch
       (call-external-value "scm_envvec")
3> (with-cwd (expand-file-name "~")
     (filter (lambda (file) (= (file-owner file) (user-uid)))
             (directory-files)))

Error: exception
       gc-protection-mismatch
       (return-from-callback "scheme_stat")
4> (file-readable? ".")

Error: exception
       gc-protection-mismatch
       (return-from-callback "scheme_stat")
5> ,exit

Process scheme finished

**********************************************************************
Not sure what group/owner id's are.  Tried the `id' command.
Hopefully, that is what you want; see below:

welcome to scsh-0.6 alpha 
> (run (uname -a))
SunOS general1 5.7 Generic_106541-12 sun4u sparc SUNW,Ultra-60
0
> (define error-file #f)
> (with-cwd "/tmp"
    (filter (lambda (file)
              (set! error-file file)
              (= (file-owner file) (user-uid)))
            (directory-files)))

Error: exception
       wrong-type-argument
       (return-from-callback "scheme_stat" <Error while displaying condition.>
1> error-file
"krb5cc_133683"
1> (run (ls -l ,(string-append "/tmp/" error-file)))
-rw-------   1 pvijay1  root         1157 Oct 22 22:16 /tmp/krb5cc_133683
0
1> (run (id pvijay1))
uid=133683(pvijay1) gid=133683(pvijay1)
0
1> (run (id ,(user-login-name)))
uid=39521(sthaiyar) gid=39521(sthaiyar)
0
1> ,exit

Process scheme finished

**********************************************************************
welcome to scsh-0.6 alpha 

> (with-cwd "/tmp/"   ;; trying with a slash at the end;
                      ;; shouldn't make any difference but doesn't
                      ;; hurt to try
 (filter (lambda (file) (= (file-owner file) (user-uid)))
            (directory-files)))
'("krb5cc_39521")
> (with-cwd "/tmp"
 (filter (lambda (file) (= (file-owner file) (user-uid)))
            (directory-files)))

Error: exception
       wrong-type-argument
       (return-from-callback "scheme_stat" '#{Random object})
1> (with-cwd "/tmp/"
 (filter (lambda (file) (= (file-owner file) (user-uid)))
            (directory-files)))

Process scheme segmentation Fault (core dumped)
**********************************************************************
Making (somewhat) sure that (directory-files) isn't the root of all
problems:

welcome to scsh-0.6 alpha 
> (let ((results '()))
    (do ((i 10 (- i 1)))
        ((zero? i) results)
      (let ((n-files (with-cwd "/tmp" (length (directory-files)))))
        (set! results (cons n-files results)))))
'(3752 3752 3752 3752 3752 3752 3752 3752 3752 3752)

**********************************************************************
Oops, there goes my theory of file permissions having to do with
anything:

In buffer, "t.scm":

(with-cwd "/tmp"
  (filter (lambda (file)
            (cond ((file-readable? file)
                   (set! error-file file)
                   (= (user-uid) (file-owner file)))
                  (else #f)))
          (directory-files)))

;;; error-file define previously
1> error-file
"krb5cc_39521"
1> (user-uid) ;; I am the owner of this file.
39521
1> (define t "/tmp/krb5cc_39521")
1> (file-owner t)

Error: exception
       gc-protection-mismatch
       (return-from-callback "scheme_stat")
2> 

**********************************************************************
I did rebuild scsh 0.6, but the same thing happens:

[followed the steps in CVS_README]

$ ./go
welcome to scsh-0.6 alpha 
> (with-cwd "/tmp" (filter (lambda (f) (= (file-owner f) (user-uid))) 
> (directory-files)))

Error: exception
       wrong-type-argument
       (return-from-callback "scheme_stat" <Error while displaying condition.>
1> 



  * Martin Gasbichler <gasbichl@informatik.uni-tuebingen.de> writes:

    >>>>> "Sriram" == Sriram Thaiyar <sri@asu.edu> writes:
    
    Sriram> I have a small script which deletes all my temporary files under 
/tmp
    Sriram> (Something similar what Olin has in the Scsh Manual).  This works 
under
    Sriram> Scsh 0.5.3, but doesn't under Scsh 0.6.0, which I picked up from the
    Sriram> CVS on Friday, October 19.  I am running it under SunOS 5.7.
    
    Sriram> This is the core of the script, which returns all files belonging to
    Sriram> me under /tmp:
    
    Sriram>   (with-cwd "/tmp"
    >> (filter (lambda (file) (= (file-owner file) me)) ; me = (user-uid)
    Sriram>         (directory-files)))
    
    Sriram> Under Scsh 0.6.0 this error message is printed:
    
    Sriram>   Error: exception
    Sriram>      wrong-type-argument
    Sriram>      (return-from-callback "scheme_stat" '#{Random object})
    
    Sriram> Sometimes this is printed:
    
    Sriram>   Error: exception
    Sriram>      wrong-type-argument
    Sriram>      (return-from-callback "scheme_stat" <Error while displaying 
condition.>
    
    Sriram> And at other times, it crashes:
    
    Sriram>   Process scheme segmentation Fault (core dumped)
    
    I used SunOS 5.7 , but I cannot reproduce this at all.
    
    Do you get this error if you just enter
    
    (with-cwd "/tmp"
     (filter (lambda (file) (= (file-owner file) (user-uid)))
            (directory-files)))
    
    directly after the start of scsh 0.6?
    
    
    Sriram> The script works fine under Scsh 0.5.3 and I have used it at least 
two
    Sriram> to three times a week since 0.5.3's release.
    
    Sriram> I found out that certain files aren't readable under /tmp.  Maybe 
this
    Sriram> is causing the problem:
    
    >> (define a)
    >> (with-cwd "/tmp/"
    >> (filter (lambda (f)
    Sriram>             ;; Find out the file that causes the problem
    Sriram>             (set! a f)
    Sriram>             (= (file-owner f) (user-uid)))
    Sriram>           (directory-files)))
    
    >> a
    Sriram>   "krb5cc_109161"
    
    Can you mail me the exact permissions and owner/group information of this 
file?
    
    >> (file-readable? "/tmp/krb5cc_109161")
    Sriram>   Error: exception
    >> gc-protection-mismatch
    >> (return-from-callback "scheme_stat")
    
    This gc-protection-mismatch is probably only an outcome of the error
    above. I guess you don't get it if you enter the expression directly
    after the start of scsh?
    
    Sriram> Under Scsh 0.5.3:
      
    >> (file-readable? "/tmp/krb5cc_109161")  ;; The above file
    Sriram>   #f
    
    Sriram> Hopefully this is kinda clear.  If not please email me.  I did read
    Sriram> the source code, but it wasn't of any help.
    
    
    -- 
    Martin

<Prev in Thread] Current Thread [Next in Thread>