[Python-bugs-list] [ python-Bugs-641215 ] Fascinating Text.see() SEGV
noreply@sourceforge.net
noreply@sourceforge.net
Wed, 20 Nov 2002 14:51:46 -0800
Bugs item #641215, was opened at 2002-11-20 08:28
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=641215&group_id=5470
Category: Tkinter
>Group: 3rd Party
>Status: Closed
Resolution: None
Priority: 5
Submitted By: Graham Horler (grahamh)
Assigned to: Nobody/Anonymous (nobody)
Summary: Fascinating Text.see() SEGV
Initial Comment:
Hi Pythoneers,
OS: GNU/Linux 2.4.16, Debian 3.0
Python:
2.1.3 (#1, Apr 20 2002, 10:14:34)
[GCC 2.95.4 20011002 (Debian prerelease)] on linux2
After my large Python/Tkinter application did a SEGV, I
chopped out code till I was left with this little beauty:
#!/usr/bin/python
# An interesting bug in the Tk Text widget
#
# To find where the bug is, go:
# gdb python
# (gdb) run textsee.py
# The output I get is:
# Program received signal SIGSEGV, Segmentation fault.
# [Switching to Thread 1024 (LWP 13789)]
# 0x403162ce in TkTextSeeCmd () from
/usr/lib/libtk8.3.so.1
from Tkinter import *
root = Tk()
# If this font is any bigger, it's OK
# If this bd is any smaller, it's OK
t = Text(root, font=("Helvetica", 8, "normal"), bd=16)
# Packing actually makes no difference
t.pack()
# If this string is any shorter, it's OK
t.insert(END, "Hello")
# This see() method SEGVs
t.see(END)
# We never get here
root.mainloop()
# EOF
It does the same under python1.5.2 (#0, Jan 12 2002,
11:51:45) [GCC 2.95.4 20011006 (Debian prerelease)]
on linux2.
I have not tried it under windows
I'm not a tcl programmer, so have not tested using tcl.
(This script attached as a file for your edification)
Pythonically yours.
----------------------------------------------------------------------
>Comment By: Neal Norwitz (nnorwitz)
Date: 2002-11-20 17:51
Message:
Logged In: YES
user_id=33168
I'm closing this bug, since it is definitely Tk. Here's the
tcl code which crashes:
$ wish
% text .t -font { Helvetica 8 normal } -bd 16
.t
% .t insert end Hello
% .t see end
Segmentation fault (core dumped)
I'm running Tcl/Tk 8.3.3 on Redhat Linux 7.2. Please file a
bug report with Tcl/Tk. I think they can be found at:
http://sf.net/projects/tcltk
----------------------------------------------------------------------
Comment By: Graham Horler (grahamh)
Date: 2002-11-20 09:10
Message:
Logged In: YES
user_id=543663
Actually, packing does make all the difference, if you call
update() or update_idletasks on the text widget or root (or any
widget, even one that is not packed|placed|gridded).
So, the bug seems to be: calling see() on a Text widget (I have
not tested others) that is not visible yet does a SEGV.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=641215&group_id=5470