| Ticket UUID: | b4214b47120e23fc75ec806b20d2ddfb0845b2d4 | |||
| Title: | Segfault on unexpected <Destroy> event | |||
| Type: | Bug | Version: | 8.6.1 | |
| Submitter: | tombert | Created on: | 2014-04-02 09:21:15 | |
| Subsystem: | 69. Events | Assigned To: | fvogel | |
| Priority: | 6 | Severity: | Minor | |
| Status: | Closed | Last Modified: | 2018-01-19 20:41:49 | |
| Resolution: | Fixed | Closed By: | fvogel | |
| Closed on: | 2018-01-19 20:41:49 | |||
| Description: |
MinGW64, Win7:
A toplevel is created inside an oo class like:
...
toplevel $_me -background $tkcolour::windowbg
#bind $_me <Destroy> [list catch {puts ___xxxxxxxxxxxxxx.x.x.x.x.xxxxxxxxxxxxxxx___}]
bind $_me <Destroy> [list catch [callback destroy]]
...
The destroy event is fired during my object/GUI creation and forces a segfault. See stack below.
I already tried to create a simple tcl/tk example but it does not crash that way.
So the reason is clear to me - there is access to an object which is deleted, triggered by the event (see line #12).
What's not clear to me is why the <Destroy> event is fired?
When I replace the "destroy" with the "puts" I see lots of outputs in the console. In my understanding this should also not be?
thx
(gdb)
#0 Tcl_GetString (objPtr=0x0) at d:/CM.git/tcltk86/dcompile/tcl/generic/tclObj.c:1598
#1 0x000000006197fd10 in MenuVarProc (clientData=0x3e9d530, interp=0x1c94720,
name1=0x3e25830 "::oo::Obj74::_layoutAutoOpen", name2=0x0, flags=192)
at ./../generic/tkMenu.c:2492
#2 0x0000000067586279 in TclCallVarTraces (iPtr=0x1c94720, arrayPtr=0x0, varPtr=0x22e6d0,
part1=0x3e25830 "::oo::Obj74::_layoutAutoOpen", part2=0x0, flags=192, leaveErrMsg=0)
at d:/CM.git/tcltk86/dcompile/tcl/generic/tclTrace.c:2675
#3 0x0000000067585db9 in TclObjCallVarTraces (iPtr=0x1c94720, arrayPtr=0x0, varPtr=0x22e6d0,
part1Ptr=0x427e480, part2Ptr=0x0, flags=64, leaveErrMsg=0, index=-1)
at d:/CM.git/tcltk86/dcompile/tcl/generic/tclTrace.c:2517
#4 0x000000006758ff21 in UnsetVarStruct (varPtr=0x3e38640, arrayPtr=0x0, iPtr=0x1c94720,
part1Ptr=0x427e480, part2Ptr=0x0, flags=0, index=-1)
at d:/CM.git/tcltk86/dcompile/tcl/generic/tclVar.c:2504
#5 0x0000000067594672 in TclDeleteNamespaceVars (nsPtr=0x3e3a4f0)
at d:/CM.git/tcltk86/dcompile/tcl/generic/tclVar.c:5332
#6 0x000000006753b5af in TclTeardownNamespace (nsPtr=0x3e3a4f0)
at d:/CM.git/tcltk86/dcompile/tcl/generic/tclNamesp.c:1118
#7 0x000000006753b4bf in Tcl_DeleteNamespace (namespacePtr=0x3e3a4f0)
at d:/CM.git/tcltk86/dcompile/tcl/generic/tclNamesp.c:1028
#8 0x000000006753a7f2 in Tcl_PopCallFrame (interp=0x1c94720)
at d:/CM.git/tcltk86/dcompile/tcl/generic/tclNamesp.c:421
#9 0x000000006756c7de in InterpProcNR2 (data=0x427d8b8, interp=0x1c94720, result=0)
at d:/CM.git/tcltk86/dcompile/tcl/generic/tclProc.c:1880
#10 0x000000006741c8c1 in TclNRRunCallbacks (interp=0x1c94720, result=0, rootPtr=0x427d6a0)
at d:/CM.git/tcltk86/dcompile/tcl/generic/tclBasic.c:4390
#11 0x000000006741c059 in Tcl_EvalObjv (interp=0x1c94720, objc=2, objv=0x1c9abc0, flags=2097168)
at d:/CM.git/tcltk86/dcompile/tcl/generic/tclBasic.c:4121
#12 0x000000006741e7d5 in TclEvalEx (interp=0x1c94720,
script=0x22ed00 "catch {::oo::Obj74::my destroy}\nttk::notebook::TLCleanup .oowin1_.containerFra
me.notebook.mcsettings.table_.tframe.table.hdr.t.f.l0", numBytes=131, flags=131072, line=1,
clNextOuter=0x0,
outerScript=0x22ed00 "catch {::oo::Obj74::my destroy}\nttk::notebook::TLCleanup .oowin1_.contain
erFrame.notebook.mcsettings.table_.tframe.table.hdr.t.f.l0")
at d:/CM.git/tcltk86/dcompile/tcl/generic/tclBasic.c:5259
#13 0x000000006741db79 in Tcl_EvalEx (interp=0x1c94720,
script=0x22ed00 "catch {::oo::Obj74::my destroy}\nttk::notebook::TLCleanup .oowin1_.containerFra
me.notebook.mcsettings.table_.tframe.table.hdr.t.f.l0", numBytes=131, flags=131072)
at d:/CM.git/tcltk86/dcompile/tcl/generic/tclBasic.c:4924
#14 0x00000000618f86dc in Tk_BindEvent (bindPtr=0x1d2d430, eventPtr=0x22f050, tkwin=0x4283110,
numObjects=0, objectPtr=0x22eed8) at ./../generic/tkBind.c:1492
#15 0x000000006192ebde in TkBindEventProc (winPtr=0x4283110, eventPtr=0x22f050)
at ./../generic/tkCmds.c:316
#16 0x0000000061940dba in Tk_HandleEvent (eventPtr=0x22f050) at ./../generic/tkEvent.c:1363
#17 0x00000000619cff07 in Tk_DestroyWindow (tkwin=0x4283110) at ./../generic/tkWindow.c:1432
#18 0x000000006192f15d in Tk_DestroyObjCmd (clientData=0x1cf2b40, interp=0x1c94720, objc=2,
objv=0x1c9a8f0) at ./../generic/tkCmds.c:497
#19 0x000000006741c832 in Dispatch (data=0x5845658, interp=0x1c94720, result=0)
at d:/CM.git/tcltk86/dcompile/tcl/generic/tclBasic.c:4357
#20 0x000000006741c8c1 in TclNRRunCallbacks (interp=0x1c94720, result=0, rootPtr=0x0)
at d:/CM.git/tcltk86/dcompile/tcl/generic/tclBasic.c:4390
#21 0x000000006741f3e5 in TclEvalObjEx (interp=0x1c94720, objPtr=0x675585f6 <Tcl_GetString>,
flags=131072, invoker=0x0, word=0) at d:/CM.git/tcltk86/dcompile/tcl/generic/tclBasic.c:5956
#22 0x000000006741f376 in Tcl_EvalObjEx (interp=0x1c94720, objPtr=0x675585f6 <Tcl_GetString>,
flags=131072) at d:/CM.git/tcltk86/dcompile/tcl/generic/tclBasic.c:5937
#23 0x000000006750a51b in Tcl_RecordAndEvalObj (interp=0x1c94720, cmdPtr=0x3b7fde0, flags=131072)
at d:/CM.git/tcltk86/dcompile/tcl/generic/tclHistory.c:190
#24 0x00000000618c2991 in InterpreterObjCmd (clientData=0x1ce1780, interp=0x3001f50, objc=3,
objv=0x31ae358) at ./../generic/tkConsole.c:821
#25 0x000000006741c832 in Dispatch (data=0x3b7f308, interp=0x3001f50, result=0)
at d:/CM.git/tcltk86/dcompile/tcl/generic/tclBasic.c:4357
#26 0x000000006741c8c1 in TclNRRunCallbacks (interp=0x3001f50, result=0, rootPtr=0x0)
at d:/CM.git/tcltk86/dcompile/tcl/generic/tclBasic.c:4390
#27 0x000000006741c059 in Tcl_EvalObjv (interp=0x3001f50, objc=1, objv=0x31ae080, flags=2097168)
at d:/CM.git/tcltk86/dcompile/tcl/generic/tclBasic.c:4121
#28 0x000000006741e7d5 in TclEvalEx (interp=0x3001f50,
script=0x22f750 "\n .console mark set insert {end - 1c}\n tk::ConsoleInsert .console \"\\n\"\n
tk::ConsoleInvoke\n break\n ", numBytes=101, flags=131072, line=4,
clNextOuter=0x0,
outerScript=0x22f750 "\n .console mark set insert {end - 1c}\n tk::ConsoleInsert .console \
"\\n\"\n tk::ConsoleInvoke\n break\n ")
at d:/CM.git/tcltk86/dcompile/tcl/generic/tclBasic.c:5259
#29 0x000000006741db79 in Tcl_EvalEx (interp=0x3001f50,
script=0x22f750 "\n .console mark set insert {end - 1c}\n tk::ConsoleInsert .console \"\\n\"\n
tk::ConsoleInvoke\n break\n ", numBytes=101, flags=131072)
at d:/CM.git/tcltk86/dcompile/tcl/generic/tclBasic.c:4924
#30 0x00000000618f86dc in Tk_BindEvent (bindPtr=0x33007d0, eventPtr=0x3cfe040, tkwin=0x35558d0,
numObjects=0, objectPtr=0x22f928) at ./../generic/tkBind.c:1492
#31 0x000000006192ebde in TkBindEventProc (winPtr=0x35558d0, eventPtr=0x3cfe040)
at ./../generic/tkCmds.c:316
#32 0x0000000061940dba in Tk_HandleEvent (eventPtr=0x3cfe040) at ./../generic/tkEvent.c:1363
#33 0x0000000061941490 in WindowEventProc (evPtr=0x3cfe030, flags=-3)
at ./../generic/tkEvent.c:1753
#34 0x000000006754116b in Tcl_ServiceEvent (flags=-3)
at d:/CM.git/tcltk86/dcompile/tcl/generic/tclNotify.c:670
#35 0x0000000067541595 in Tcl_DoOneEvent (flags=-3)
at d:/CM.git/tcltk86/dcompile/tcl/generic/tclNotify.c:967
#36 0x0000000061941aa0 in Tk_MainLoop () at ./../generic/tkEvent.c:2131
#37 0x000000006197a640 in Tk_MainExW (argc=-1, argv=0x365600, appInitProc=0x4015ba <Tcl_AppInit>,
interp=0x1c94720) at ./../generic/tkMain.c:381
#38 0x00000000004015af in wWinMain (hInstance=0x400000, hPrevInstance=0x0,
lpszCmdLine=0x5f389a L"bin/main.tcl", nCmdShow=10) at winMain.c:150
#39 0x00000000004013c9 in __fu0__set_invalid_parameter_handler ()
#40 0x0000000000400000 in ?? ()
#41 0x0000000000000000 in ?? ()
| |||
| User Comments: |
fvogel added on 2018-01-19 20:41:49:
Merged to core-8-6-branch and trunk. fvogel added on 2018-01-13 13:54:03: Fixed in a bugfix branch, see [95cf2308]. fvogel added on 2018-01-10 20:26:43: Definitely a duplicate I think. Will fix, thanks for the pointer. stu added on 2018-01-10 07:41:30: Grr. Mime-types. Here [657c389120] stu added on 2018-01-10 07:38:00: Looks like the same bug as here [657c389120]. dgp added on 2014-10-15 15:06:49: status? dkf added on 2014-04-16 09:56:15: Remember that all widgets within a toplevel also have the name of the toplevel as one of their bindtags. This is to enable things like hotkeys, but does mean that many <Destroy> events get sent to that toplevel. Distinguish between them with the %W substitution, perhaps like this:
bind $_me <Destroy> [list if {"%W" eq [winfo toplevel %W]} [callback destroy]]
I'm more worried by why this is crashing. Is that duplicatable with a less complex script?
| |||
Home
Timeline
Branches
Tags
Forum
Tickets
Download
Wiki