Tk Source Code

View Ticket
Login
2026-10-08
15:39 • Ticket [fb13231f] Messagebox can crash app on mac status still Open with 3 other changes artifact: f04fe5ab user: chrstphrchvz
2022-03-02
15:39 • Closed ticket [1b286c99]: crash on tk_messageBox call plus 5 other changes artifact: b79cfd29 user: nab
2021-03-23
19:31 • Ticket [815f779d] macOS crashes status still Open with 3 other changes artifact: efd5b536 user: chrstphrchvz
2019-03-22
05:50 • Ticket [1b286c99] crash on tk_messageBox call status still Open with 3 other changes artifact: cfd89ea9 user: nab
04:13 • Ticket [1b286c99]: 3 changes artifact: 334edc40 user: nab
02:47 • Ticket [1b286c99]: 4 changes artifact: 07ea5fc8 user: marc_culler
2019-03-21
15:42 • New ticket [1b286c99]. artifact: 08b96f37 user: nab

Ticket UUID: 1b286c99aef5183365641ba2de55446e57deac94
Title: crash on tk_messageBox call
Type: Bug Version: aqua
Submitter: nab Created on: 2019-03-21 15:42:31
Subsystem: 38. [tk_messageBox] Assigned To: nobody
Priority: 5 Medium Severity: Minor
Status: Closed Last Modified: 2022-03-02 15:39:17
Resolution: Out of Date Closed By: nab
    Closed on: 2022-03-02 15:39:17
Description:
Hi,
I got a crash today with bug-0d63621b6c branch
https://pastebin.com/F9a0umLn

on exit, my app call tk_messageBox to ask if user want to save his work.
today, I've opened/closed my app 100x, it only happened once

++
User Comments: nab added on 2019-03-22 05:50:17:
well...
looking closer at this crash, after the tk_messageBox, I open a toplevel that's saying goodBye.
maybe it's this last toplevel that crashed...
I'll delay (or remove it) it's display and report you if I have such a crash again.

++

nab added on 2019-03-22 04:13:58:
here's a paste of beforequitCommand, the one that trigger tk_messageBox
https://pastebin.com/8qmxzB5q

and beforquit is called by Cmd-Q binding of the exit proc: 
if {[tk windowingsystem] eq "aqua"} {
    rename exit __exit
    proc exit {} {
        beforequit
    }
}

marc_culler (claiming to be Marc Culler) added on 2019-03-22 02:47:33:
You wouldn't, by any chance, be opening a message box in an idle task would you?
That would be a big no-no.  In order to allow Tk to do any drawing at all it was
necessary to run some idle tasks (hopefully just display procs) inside of the
drawRect method. Your crash report indicates that the exception was caused by
calling runModal from inside the drawRect method.