Tk Source Code

View Ticket
Login
Ticket UUID: 8c3620752cd048b5c57aea84c8e15fa855b72d78
Title: "wm forget ." segfaults
Type: Bug Version: 9.0.3
Submitter: erikleunissen Created on: 2026-03-25 08:28:56
Subsystem: 65. Generic Window Operations Assigned To: nobody
Priority: 5 Medium Severity: Severe
Status: Closed Last Modified: 2026-03-27 14:49:16
Resolution: Fixed Closed By: jan.nijtmans
    Closed on: 2026-03-27 14:49:16
Description:
Observed with Tk9.0.3 on MS Windows and macOS/aqua.
To be reproduced by invoking:

> wish
% wm forget .

For each windowing system, the ensuing crash report, containing a stack trace,
is attached.
User Comments: jan.nijtmans added on 2026-03-27 14:49:16:

So, I did the windows part too (and make sure it really fixes the crash!)

Done [74183ad460eb6ef6|here]


erikleunissen added on 2026-03-26 08:04:31:
I confirm that the crash doesn't occur anymore with branch bug-8c3620752c at
commit [4f77fbcac5].

marc_culler (claiming to be Marc Culler) added on 2026-03-25 21:44:07:
I pushed a fix for aqua as branch bug-8c3620752c.

The fix just avoids using winPtr->parentPtr when it is a NULL pointer.

I will leave the Windows case for someone who knows their way around the
Windows code.

marc_culler (claiming to be Marc Culler) added on 2026-03-25 19:57:31:
That command is something which I had not heard about before.  So I
looked at the manual.

The manual entry for wm forget says:

"wm forget window
    The window will be unmapped from the screen and will no longer be managed
    by wm."

The manual entry for wm withdraw says:

"wm withdraw window
    Arranges for window to be withdrawn from the screen. This causes the
    window to be unmapped and forgotten about by the window manager."

What is supposed to be the difference between those two things?

oehhar added on 2026-03-25 10:45:20:

I remember that we had a patch to trap this, origin from Androwish. I may be wrong... Will look later, Harald


Attachments: