[cl-gtk2-devel] debugging cl-gtk applications

Peter Keller psilord at cs.wisc.edu
Wed Aug 24 15:10:23 UTC 2011


On Wed, Aug 24, 2011 at 03:25:45PM +0200, Maciej Katafiasz wrote:
> On Wed, Aug 24, 2011 at 02:02, Peter Keller <psilord at cs.wisc.edu> wrote:
> > When I use cl-gtk with sbcl, sometimes I write a bug where I define a
> > slot with an incorrect signature.
> >
> > What SBCL does at this point is that the thread containing the wrong code
> > dumps a message (usually "wrong number of arguments 2", etc being the
> > entirety of it even with debug and safety at 3 and speed optimize at 0)
> > and stops, but the REPL apparently doesn't notice.
> >
> > So, I then have this stopped thread hanging out in the background. How
> > does one access the correct thread to figure out a backtrace for the
> > failure?
> 
> Which platform are you using? 

Linux primarily, however the windows knowledge you provided is very useful
as I was hoping my code could be run on a windows machine as well.

> There are two things to consider here:
> 
> 2) On Linux there's currently an undetermined SBCL bug which somehow
> manifests itself very often in presence of semi-complex CL-GTK2 code.
> The end result is that after the first time the offending code is
> executed, thread handling fails silently and catastrophically,
> including the complete inability to interrupt other threads (which
> also precludes the debugger from noticing anything going wrong). It's
> very possible that you're seeing this. In this case, there's not much
> to be done except a long and torturous debugging session to fix SBCL.
> Perhaps trying the same on CCL instead could help in the short term,
> but I must admit that I've only thought about migrating my code to
> CCL, not actually done so. Another not-really workaround is to restart
> SBCL and make sure you only run the suspect on a completely fresh
> image, *once*. If you do go down that route, you really, really want
> to SAVE-LISP-AND-DIE with as much of everything preloaded as possible.

This does help a lot--thanks! I'll go over to the sbcl help list with
my problem and your explanation and see if they have any insight into
how to debug it in more detail.

What I've been doing is the latter "not-really workaround" route and it
increases my development time a very annoying amount.

Is it possible to run cl-gtk applications in a single threaded manner so
I can at least debug my application?

Thank you.

-pete






More information about the cl-gtk2-devel mailing list