chicken-janitors
[Top][All Lists]
Advanced

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

[Chicken-janitors] Re: [Chicken-bugs] #326: Crash in libchicken.so when


From: Chicken Scheme
Subject: [Chicken-janitors] Re: [Chicken-bugs] #326: Crash in libchicken.so when using the tinyclos egg
Date: Wed, 19 Sep 2007 16:43:00 -0000

#326: Crash in libchicken.so when using the tinyclos egg
--------------------------------------------+-------------------------------
Reporter:  asandroq                         |        Owner:                
    Type:  defect                           |       Status:  new           
Priority:  critical                         |    Component:  core libraries
 Version:  2.7                              |   Resolution:                
Keywords:  segfault linux amd64 libchicken  |  
--------------------------------------------+-------------------------------
Comment (by chust):

 I found the precise reason for this problem: class-of from tinyclos calls
 ##sys#generic-structure? on its argument before checking whether the
 argument is actually (void), which results in a crash in case (void) is
 passed to class-of.

 This problem is very easy to fix by rearranging the condition clauses in
 class-of into a different execution order. Here's a patch:
 {{{
 Index: tinyclos-base.scm
 ===================================================================
 --- tinyclos-base.scm   (revision 6070)
 +++ tinyclos-base.scm   (working copy)
 @@ -701,6 +701,7 @@
          [(boolean? x)                   <boolean>]
          [(char? x)                      <char>]
          [(eof-object? x)                <end-of-file>]
 +        [(%undefined? x)                <void>]
          [(symbol? x)                    <symbol>]
          [(%instance? x)                 (%instance-class x)]
          [(%entity? x)                   (%entity-class x)]
 @@ -714,7 +715,6 @@
          [(%tagged-pointer? x)           (tagged-pointer-class-of x)]
          [(%swig-pointer? x)             <swig-pointer>]
          [(%locative? x)                 <locative>]
 -        [(%undefined? x)                <void>]
          [(%structure? x)
           (case (%structure-tag x)
             [(environment)               <environment>]
 }}}

 I have checked this into the SVN trunk version of TinyCLOS, but it would
 be good if someone with more insight into TinyCLOS could check that this
 change is harmless and has no bad side effects before it's applyed to some
 tagged version.

-- 
Ticket URL: <http://trac.callcc.org/ticket/326#comment:9>
Chicken Scheme <http://www.call-with-current-continuation.org/>
The CHICKEN Scheme-to-C compiler

reply via email to

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