scsh-users
[Top] [All Lists]

scsh hates me

To: scsh-news@zurich.ai.mit.edu
Subject: scsh hates me
From: briand@aracnet.com
Date: 02 May 2002 21:06:57 -0700
Organization: http://extra.newsguy.com
This is a little long, but trust me, it's worth it.

Maybe this is revision 0.6.6.6 ?

Look at this snippet of code :

                         (and match
                              (let ((user (match:substring match 1))
                                    (cpu (match:substring match 2)))
                                (write user)(newline)
                                (write cpu)(newline)
                                (and user
                                     cpu
                                     (make-exec-results
                                      (string->number cpu) 
                                      (string->number user)
                                      0 
                                      0))))))))
        
Here are the results - there is a lot here.  Don't worry about the
details, the fact that something was printed at all is the important
part.

    ~/src/scheme/bench $ ./bench -o quicktest  
    Processing option file 'quicktest'.
    .....
    Done.



    [BENCHMARK deriv ]

    [ gambit ]             
    Compile times user : 0.92       system : 0.07
    "/home/briand/src/scheme/bench/sys/gambit"

    Error: invalid argument
           (#{Procedure 9200 (regexp-match in posix-regexps)} '#{Regexp} 0 #f 
#f)
    0
    #{Input-fdport #{Input-channel 7}}
    #{Input-fdport #{Input-channel 10}}
    ""
    " 0.02 0.00 0
    "
    #{regexp-match}
    "0.02"
    "0.00"
    #{exec-results}
    user : 0.       system : 0.02


Now for the evil part :  Here is THE ONLY CHANGE I MAKE:

                                     (make-exec-results
                                      (string->number cpu) 
                                      (string->number user)
                                      0 
                                      "a string"))))))))
                                      ^^^^^^^^^^

Now watch the results :

    Processing option file 'quicktest'.
    .....
    Done.



    [BENCHMARK deriv ]

    [ gambit ]             
    Compile times user : 0.95       system : 0.04
    "/home/briand/src/scheme/bench/sys/gambit"

WTF !!!

That's right, the program exits prematurely.  And all I did was change
the 0 to a string...  It works if it is a number, it works if it is a
symbol, it works if it is a list, it works if it is a vector, but if I
change it to a string the program quits before it even gets to that
point.  In fact, if I do something like (car (list "string")) it still
breaks, but (car (list 0)) works.

And a string constant at that.  So there is NO WAY that the program
can be failing above that point if it doesn't fail for all of the
other variable types.

And yes, there are 4 slots in the exec-results record.

scsh hates me.

Brian

P.S. No I can't produce this by itself.  It only does this as part of
the script I am running.  So if I take the exec-results record and
isolate it in a test, it works every time.

P.P.S.  I think the program run, I think there is something strange
going on with buffering of the output, and something is failing and
the output hasn't been flushed yet.  But how in the heck am I going to
figure out what !

-- 

   "There is no right place for the dead to live."

    -- Kai, last of the Brunnen-G


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