[Tkinter-discuss] My (small) program crashes on windows and linux. Why?

Chris Niekel chris at niekel.net
Wed Feb 15 07:29:05 CET 2006

On Tue, Feb 14, 2006 at 10:44:22PM +0100, Amanjit Gill wrote:
> Chris Niekel wrote:
> >Indeed, changing it to column=d/100 works as well. column and row should
> >
> >be < 9999, otherwise it crashes. Not a real problem ofcourse.

> Hi there, I took a look at the Tk sourcecode, its limited by default .. see
> http://cvs.sourceforge.net/viewcvs.py/tktoolkit/tk/generic/tkGrid.c?view=markup
> //* * Data structures are allocated dynamically to support arbitrary 
> sized * tables. However, the space is proportional to the highest 
> numbered slot * with some non-default property. This limit is used to 
> head off mistakes and * denial of service attacks by limiting the amount 
> of storage required. *//
> #*define* MAX_ELEMENT 10000
> and
> .\tkGrid.c:2216:   
>  if (slot < 0 || slot >= MAX_ELEMENT) {
>    return TCL_ERROR;
>  }

Should I have discovered the TCL_ERROR somewhere then? Is that propagated
through Tkinter? The grid-examples don't use it. 

Since Tcl/tk seems to set the limit, and return an error, I'd think it's a
bug in Tkinter to crash for it. An exception raised at the right time would
be nice. I

I've submitted a bug-report for the crash (and fixed my code).

> Cheers,
> Amanjit

Thanks for your help!

Chris Niekel

    I've been down so long, if I'd cheer up, I'd still be depressed.
            - Lisa Simpson, Moanin' Lisa Blues.

More information about the Tkinter-discuss mailing list