From: Tilo Seebeck
Subject: poll: common errors in Lisp / Scheme
Date: 
Message-ID: <2p5l7aEm31@uni-erlangen.de>
This poll is part of a project at the university of Erlangen about
enhancing debugging technology. In order to support the search
for bugs, we need to know, which errors require big effort 
to be found.

We don't want to examine problems of novice programmers in order
to build a tutorial system. Our intend is to think of new ways to
support expert's debugging.

What we need now, is an overview of common errors of expert programmers.
At university of Erlangen, the chair for AI is the only one to use
Lisp/Scheme, so our pool of experienced programmers is rather small
to get this information. Therefore we ask for your collaboration:

Please remember the last bug you found (or any other you could think
of which you consider common or hard to find) and try to answer
the following questions. 

* What was the bug itself? (i.e wrong parameter, misspelled identifier
etc.)
* What was the error it caused? (i.e. some code never executed, wrong
code executed, code executed on bad data etc)
* What was the symptom of it? (i.e. wrong output, exception, OS-exeption,
infinite runtime etc.)

Please reply here, or to the below given e-mail address.
Thank you.

---------------------------------------------------------------
                                         _/_/_/_/_/   _/_/_/_/
            Tilo Seebeck                    _/      _/
                                           _/       _/_/_/
 ········@cip.informatik.uni-erlangen.de  _/             _/
                                         _/  _/  _/_/_/_/
---------------------------------------------------------------

From: Ray Fink
Subject: Re: poll: common errors in Lisp / Scheme
Date: 
Message-ID: <2p73vo$9rb@mica.inel.gov>
········@cip.informatik.uni-erlangen.de (Tilo Seebeck) writes:
>Please remember the last bug you found (or any other you could think
>of which you consider common or hard to find) and try to answer
>the following questions. 
>
>* What was the bug itself? (i.e wrong parameter, misspelled identifier
>etc.)

Large Lisp program that linked in (via foreign function interface) 
a large number of C functions for Motif display interface.  The bug
was an incorrect C compiler flag in the makefile for the target machine
and operating system.  Most functions worked; a couple did not.

>* What was the error it caused? (i.e. some code never executed, wrong
>code executed, code executed on bad data etc)

Foreign function (in C) called with a bad pointer.

>* What was the symptom of it? (i.e. wrong output, exception, OS-exeption,
>infinite runtime etc.)

Core dump and Lisp exit.

This particular instance (mis-compilation of C sources) isn't necessarily
common, but I present it as typical of a more general class of very
stubborn bugs in Lisp:  those that involve linked-in foreign functions
or libraries, trying to trace scrambled foreign pointers.  Over 
the past couple years, I've run into several of these and they usually 
cost me several days to debug.  Ouch!

Ray Fink -- Idaho National Engineering Laboratory -- Idaho Falls ID 
	···@inel.gov			208-525-5431
From: Jeff Dalton
Subject: Re: poll: common errors in Lisp / Scheme
Date: 
Message-ID: <CooC1I.C75@cogsci.ed.ac.uk>
In article <··········@uni-erlangen.de> ········@cip.informatik.uni-erlangen.de (Tilo Seebeck) writes:
>
>Please remember the last bug you found (or any other you could think
>of which you consider common or hard to find) and try to answer
>the following questions. 

Ok, here's one.

>* What was the bug itself? (i.e wrong parameter, misspelled identifier
etc.)

The bug was using (null (cdr x)) as a shortcut for (= (length x) 1)
without ensuring that x was a cons.  I dealt with this by defining
a function length=1, with the aim of avoiding temptation in the
future. (Maybe it should be called singleton-p or something, I don't 
know.)

>* What was the error it caused? (i.e. some code never executed, wrong
>code executed, code executed on bad data etc)

It would have caused the wrong code to be executed, on data it
wasn't expecting.

>* What was the symptom of it? (i.e. wrong output, exception, OS-exeption,
>infinite runtime etc.)

There were no symptoms, because I noticed it when reading the code
before the error case managed to occur.

In fact, I changed some cases where the bug couldn't result, because
an earlier COND clause had established that x was a cons.  But I
thought that COND clause might later change.

---

I'll try to keep a record of bugs as I encounter them and send it
along.

-- jeff
From: Simon E Spero
Subject: Re: poll: common errors in Lisp / Scheme
Date: 
Message-ID: <2ph04q$hej@bigblue.oit.unc.edu>
One thing that always drives me mad is when I redefine or delete a method, 
reload the file, and don't realise that the old definition is still in the
system ready to slip itself into the effective-method list. 

It's stupid, but it's really really annoying.