Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

updating GOP shortly after closing it's parent window generates a Tcl/Tk error #814

Open
umlaeute opened this issue Dec 6, 2019 · 6 comments · May be fixed by #815
Open

updating GOP shortly after closing it's parent window generates a Tcl/Tk error #814

umlaeute opened this issue Dec 6, 2019 · 6 comments · May be fixed by #815
Labels

Comments

@umlaeute
Copy link
Contributor

@umlaeute umlaeute commented Dec 6, 2019

consider a subpatch, that holds a GOP-subpatch with a numberbox.

  • open the subpatch, to see the GOP in all it's glory.
  • send a value to the GOP-subpatch to change the numberbox
  • and immediately (within a few milliseconds) close the subpatch (so the GOP becomes invisible)
  • 💥 you get a nasty Tcl/Tk error-message, and the GUI starts to malfunction:
(Tcl) INVALID COMMAND NAME: invalid command name ".x562c48980850.c"
    while executing
"$tkcanvas itemconfig $tag -text [::pdtk_text::unescape $text]"
    (procedure "pdtk_text_set" line 2)
    invoked from within
"pdtk_text_set .x562c48980850.c .x562c48980850.t562c4897f9e0 {666 }"
    ("uplevel" body line 1)
    invoked from within
"uplevel #0 $docmds"
@umlaeute

This comment has been minimized.

Copy link
Contributor Author

@umlaeute umlaeute commented Dec 6, 2019

the problem seems to be, that the numberbox (in the GOP) uses a queue to update (for throttling updates), and the queue is flushed after the window is closed.
no sanity checks are performed when the queue gets flushed, so we send data to the closed window, leading to the error.

@umlaeute

This comment has been minimized.

Copy link
Contributor Author

@umlaeute umlaeute commented Dec 6, 2019

possible fixes:

  • do sanity checks before sending data (in rtext_senditup)
  • flush the queue before deleting windows.
umlaeute added a commit that referenced this issue Dec 6, 2019
@umlaeute

This comment has been minimized.

Copy link
Contributor Author

@umlaeute umlaeute commented Dec 6, 2019

turns out that force-flushing the GUI-queue is not trivially done, so we just do the sanity checks

@Spacechild1

This comment has been minimized.

Copy link
Contributor

@Spacechild1 Spacechild1 commented Dec 6, 2019

you get a nasty Tcl/Tk error-message, and the GUI starts to malfunction:

I think this is the most troubling part. A bad Tcl message shouldn't break the whole GUI. I've experienced such situations in the past, but could never reproduce it. This bug is the chance to finally fix it!

@umlaeute

This comment has been minimized.

Copy link
Contributor Author

@umlaeute umlaeute commented Dec 7, 2019

forgot to attach a simple patch to trigger the problem (generates an error; gui is not properly malfunctioning thought ;-))

#N canvas 723 361 985 599 12;
#X msg 382 361 vis \$1;
#X msg 382 305 1;
#X obj 382 333 t f;
#X obj 382 387 s pd-\$0-oops;
#N canvas 436 316 284 266 \$0-oops 1;
#N canvas 6 61 450 300 bad_GoP 0;
#X floatatom 104 126 10 0 0 0 - #0-numbox -;
#X coords 0 -1 1 1 100 50 1 100 100;
#X restore 90 82 pd bad_GoP;
#X restore 275 400 pd \$0-oops;
#X obj 382 266 loadbang;
#X obj 243 245 t b f;
#X msg 242 139 666;
#X text 294 142 <- click me;
#X obj 275 322 s \$0-numbox;
#X connect 0 0 3 0;
#X connect 1 0 2 0;
#X connect 2 0 0 0;
#X connect 5 0 1 0;
#X connect 6 0 2 0;
#X connect 6 1 9 0;
#X connect 7 0 6 0;
@umlaeute

This comment has been minimized.

Copy link
Contributor Author

@umlaeute umlaeute commented Dec 7, 2019

and another set of test-patches.
these are the original bug-reports i received, and are not very minimal.
gops.zip

to trigger the problem:

  • open one of the patches
  • click on the toggle to turn on message-generation
  • click the [pd work] subpatch to open it
  • close the [pd work] subpatch to trigger the error
@umlaeute umlaeute added the bug/fix label Dec 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.