Tk Source Code

View Ticket
Login
Ticket UUID: 1356961b8cb623f94144e08bf78e7826a724bfd1
Title: wm-transient-1.8 fails on macOS
Type: Bug Version: core-8-6-branch
Submitter: fvogel Created on: 2018-06-30 15:05:03
Subsystem: 66. Aqua Window Operations Assigned To: aku
Priority: 5 Medium Severity: Minor
Status: Closed Last Modified: 2018-07-04 08:41:17
Resolution: Fixed Closed By: fvogel
    Closed on: 2018-07-04 08:41:17
Description:

wm-transient-1.8 fails on macOS

==== wm-transient-1.8 usage FAILED
==== Contents of test case:

    toplevel .master
    frame .master.f
    wm transient .master .master.f

---- Test completed normally; Return code was: 0
---- Return code should have been one of: 1
==== wm-transient-1.8 FAILED

Actually, running the test content in wish:

    toplevel .master
    frame .master.f
    wm transient .master .master.f

segfaults!

User Comments: fvogel added on 2018-07-04 08:41:17:
Merged to core-8-6-branch and trunk.

fvogel added on 2018-07-01 09:08:55:

Yeah fully correct, the Windows code also has this code.

Commit [ba4117fa44] indeed fixes the problem, thanks!


marc_culler (claiming to be Marc Culler) added on 2018-06-30 21:14:42:

The Unix version has code which walks up the window heirarchy until it reaches a real toplevel and then uses that as the proposed master. The analogous code was missing from the Mac version.

I think the segfault was incidental - the real problem was an infinite recursion.

A proposed fix is contained in commit [ba4117fa44].


fvogel added on 2018-06-30 15:45:37:
Call stack is


Process:               wish [42694]
Path:                  /Users/USER/Documents/*/wish
Identifier:            wish
Version:               8.6.8 (8.6.8)
Code Type:             X86-64 (Native)
Parent Process:        bash [686]
Responsible:           wish [42694]
User ID:               503

Date/Time:             2018-06-30 08:18:08.703 -0700
OS Version:            Mac OS X 10.12.6 (16G1314)
Report Version:        12
Anonymous UUID:        A3A9AF18-7DE9-3943-06D6-E5D0B8568586

Sleep/Wake UUID:       165B95AA-957F-4518-BA3B-2B110926F32B

Time Awake Since Boot: 42000 seconds
Time Since Wake:       33000 seconds

System Integrity Protection: enabled

Crashed Thread:        0  Dispatch queue: com.apple.main-thread

Exception Type:        EXC_BAD_ACCESS (SIGSEGV)
Exception Codes:       KERN_PROTECTION_FAILURE at 0x00007fff53b00fd8
Exception Note:        EXC_CORPSE_NOTIFY

Termination Signal:    Segmentation fault: 11
Termination Reason:    Namespace SIGNAL, Code 0xb
Terminating Process:   exc handler [0]

VM Regions Near 0x7fff53b00fd8:
    MALLOC_SMALL           00007fa0aa000000-00007fa0ab000000 [ 16.0M] rw-/rwx SM=PRV  
--> STACK GUARD            00007fff50301000-00007fff53b01000 [ 56.0M] ---/rwx SM=NUL  stack guard for thread 0
    Stack                  00007fff53b01000-00007fff542f6000 [ 8148K] rw-/rwx SM=COW  thread 0

Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0   libobjc.A.dylib               	0x00007fffcaab43b8 (anonymous namespace)::AutoreleasePoolPage::pop(void*) + 776
1   com.apple.AppKit              	0x00007fffb3837c47 NSCGSTransactionGetObjectForKey + 109
2   com.apple.AppKit              	0x00007fffb38385bb NSCGSWindowMark_ + 44
3   com.apple.AppKit              	0x00007fffb38c23da -[_NSCGSWindow setLevel:] + 44
4   com.apple.AppKit              	0x00007fffb3fb5fa6 -[NSWindow _applyWindowLevelWithTagUpdateNeeded:] + 216
5   com.apple.AppKit              	0x00007fffb3fb6277 -[NSWindow _applyWindowLevelWithTagUpdateNeeded:] + 937
6   com.apple.AppKit              	0x00007fffb3fb6277 -[NSWindow _applyWindowLevelWithTagUpdateNeeded:] + 937
7   com.apple.AppKit              	0x00007fffb3fb6277 -[NSWindow _applyWindowLevelWithTagUpdateNeeded:] + 937
8   com.apple.AppKit              	0x00007fffb3fb6277 -[NSWindow _applyWindowLevelWithTagUpdateNeeded:] + 937

and this last line is repeated approximately 500 times

bll added on 2018-06-30 15:32:56:
Should note that that is an invalid wm transient

Linux:
% wm transient .master .master.f
can't make ".master" its own master