chicken-janitors
[Top][All Lists]
Advanced

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

Re: [Chicken-janitors] #855: `make-pathname' causes a segfault when give


From: Chicken Trac
Subject: Re: [Chicken-janitors] #855: `make-pathname' causes a segfault when given a list of non-strings as first argument
Date: Fri, 25 May 2012 19:10:08 -0000

#855: `make-pathname' causes a segfault when given a list of non-strings as 
first
argument
-----------------------------+----------------------------------------------
  Reporter:  mario           |       Owner:  ckeen        
      Type:  defect          |      Status:  reopened     
  Priority:  critical        |   Milestone:  4.8.0        
 Component:  core libraries  |     Version:  4.7.x        
Resolution:                  |    Keywords:  make-pathname
-----------------------------+----------------------------------------------

Comment(by mario):

 Here's a code snippet that can be used to reproduce the problem (based on
 file.scm's conc-dirs):

 {{{
 $ cat conc-dirs.scm
 (define (conc-dirs dirs)
   (let loop ((strs dirs))
     (if (null? strs)
         ""
         (let ((s1 (car strs)))
           (if (zero? (string-length s1))
               (loop (cdr strs))
               (loop (cdr strs)))))))

 (print (conc-dirs '(#f)))
 }}}

 {{{
 $ csc conc-dirs.scm && ./conc-dirs

 Error: (string-length) bad argument type: #f

         Call history:

         conc-dirs.scm:10: conc-dirs             <--

 $ csc -specialize conc-dirs.scm && ./conc-dirs
 Segmentation fault (core dumped)
 }}}

 However, it works as expected if I just remove the let binding:

 {{{
 $ cat conc-dirs2.scm
 (define (conc-dirs dirs)
   (let loop ((strs dirs))
     (if (null? strs)
         ""
         (if (zero? (string-length (car strs)))
             (loop (cdr strs))
             (loop (cdr strs))))))

 (print (conc-dirs '(#f)))
 }}}

 {{{
 $ csc -specialize conc-dirs2.scm && ./conc-dirs2

 Error: (string-length) bad argument type: #f

         Call history:

         conc-dirs2.scm:9: conc-dirs             <--
 }}}

-- 
Ticket URL: <http://bugs.call-cc.org/ticket/855#comment:6>
Chicken Scheme <http://www.call-with-current-continuation.org/>
Chicken Scheme is a compiler for the Scheme programming language.

reply via email to

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