Tk Source Code

View Ticket
Login
2026-10-08
13:15 • Closed ticket [9814507d]: font measure \u4000 crashes on macOS with XQuartz plus 5 other changes artifact: 73f5210b user: serhiy.storchaka
2024-11-13
20:55 • Closed ticket [36e379c0]: macOS Ventura, X11 build with XQuartz: crash in XLoadQueryFont plus 7 other changes artifact: 8ce4555b user: jan.nijtmans
20:41
(cherry-pick) Workaround for [36e379c01b]: macOS Ventura, X11 build with XQuartz: crash in XLoadQueryFont check-in: 5c47c3c2 user: jan.nijtmans tags: core-8-6-branch
2024-11-06
10:22
(cherry-pick) Workaround for [36e379c01b]: macOS Ventura, X11 build with XQuartz: crash in XLoadQueryFont. Some more code formatting, backported from 9.0 check-in: 9c7fbcd9 user: jan.nijtmans tags: core-8-branch
2024-09-22
20:23
Workaround for [36e379c01b]: macOS Ventura, X11 build with XQuartz: crash in XLoadQueryFont check-in: d2f53df7 user: jan.nijtmans tags: trunk, main
2024-09-20
19:19 • Ticket [36e379c0] macOS Ventura, X11 build with XQuartz: crash in XLoadQueryFont status still Open with 3 other changes artifact: dd73fc99 user: jan.nijtmans
18:56
Try a workaround for [36e379c01b] (Which - actually - is a bug in XQuarz) closed check-in: 7f20f599 user: jan.nijtmans tags: bug-36e379c01b
2024-09-15
10:41 • Ticket [36e379c0] macOS Ventura, X11 build with XQuartz: crash in XLoadQueryFont status still Open with 3 other changes artifact: cf119416 user: fvogel
2024-08-17
09:13 • Ticket [36e379c0]: 3 changes artifact: c2ddb7b4 user: fvogel
08:57 • Ticket [36e379c0]: 3 changes artifact: ab7de1ec user: fvogel
2024-07-28
07:36
Add XQuartzKnownBug constraint to two tests in entry.test and two corresponding tests in spinbox.test since [36e379c01b] (crash in XLoadQueryFont) kicks in when running them. check-in: c3eb4d5f user: fvogel tags: less_tests_constraints
2024-07-01
12:25
Disable entry-3.24 testcase on XQuartz. See: [36e379c01b], which is now visible in GITHUB. check-in: 36b34450 user: jan.nijtmans tags: trunk, main
12:19
Disable entry-3.24 testcase on XQuartz. See: [36e379c01b], which is now visible in GITHUB. check-in: 8646cd4e user: jan.nijtmans tags: core-8-6-branch
12:13 • Ticket [36e379c0] macOS Ventura, X11 build with XQuartz: crash in XLoadQueryFont status still Open with 3 other changes artifact: 9b8852b1 user: jan.nijtmans
2023-07-18
19:38 • Ticket [36e379c0]: 3 changes artifact: f700983d user: fvogel
2023-01-08
09:32 • Ticket [36e379c0]: 3 changes artifact: 270418a1 user: fvogel
09:32 • Ticket [36e379c0]: 3 changes artifact: 29bf148d user: fvogel
2023-01-07
21:19 • Open ticket [36e379c0]. artifact: 41704be8 user: fvogel
2022-12-19
16:44 • Ticket [36e379c0]: 5 changes artifact: 631c7f9c user: SVIDevelopment
2022-11-23
07:31 • Closed ticket [36e379c0]. artifact: a35399fc user: fvogel
00:56 • Ticket [36e379c0]: 3 changes artifact: 28de21e6 user: chrstphrchvz
2022-10-29
11:49 • New ticket [36e379c0]. artifact: ac06c804 user: fvogel

Ticket UUID: 36e379c01b599fa6afb5d1af7a8c38cd892112c0
Title: macOS Ventura, X11 build with XQuartz: crash in XLoadQueryFont
Type: Bug Version: core-8-6-branch
Submitter: fvogel Created on: 2022-10-29 11:49:57
Subsystem: 46. Unix Fonts Assigned To: fvogel
Priority: 5 Medium Severity: Minor
Status: Closed Last Modified: 2024-11-13 20:55:05
Resolution: Fixed Closed By: jan.nijtmans
    Closed on: 2024-11-13 20:55:05
Description:

Example code:

  package require Tk
  entry .e
  .e insert end "\u4e4e"

Running this on macOS Ventura with an X11 build using XQuartz, it triggers:

X Error of failed request:  BadValue (integer parameter out of range for operation)
  Major opcode of failed request:  45 (X_OpenFont)
  Value in failed request:  0x200011
  Serial number of failed request:  107
  Current serial number in output stream:  108

then execution stops.

The Tk source code does not call X_OpenFont. However I have traced this down to GetScreenFont(). The following call in tkUnixFont.c:2808 generates the message and aborts:

	fontStructPtr = XLoadQueryFont(display, buf);

The error message and execution stop happen before this call returns. The solution is therefore not about checking the fontStructPtr return value for NULL.

When the problem shows up, the value in buf is -apple-geneva-medium-r-normal--12-*-*-*-*-*-iso10646-1

This looks odd because this font definition seems to be provided by XListFonts(), i.e. the X11 server itself provided it.

Note that the example code above is a trimmed down version of test entry-3.24, which crashes on macOS Ventura when run in an X11 build with XQuartz.

User Comments: jan.nijtmans added on 2024-11-13 20:55:05:

The workaround appears to work quite well, I now merged this to all branches.

Closing.


jan.nijtmans added on 2024-09-20 19:19:15:

Sounds like a [7f20f59927a212d2|good idea]


fvogel added on 2024-09-15 10:41:53:

Another way of working around this XQuartz problem without putting more and more constraints on tests is [b128b1a3]. Next time I merge branch less_tests_constraints into core-8-6-branch this will get propagated.


fvogel added on 2024-08-17 09:13:16:
I have observed that this issue triggers or doesn't trigger depending on the mac used to run the tests. It may trigger on the CI runner but not on a real mac, or vice-versa. This is not a stable observation however, I did't manage to dentify what exactly makes the problem disappear or re-appear.

Instead of flagging numerous tests with 'failsOnXQuarz' one could perhaps try to add more fonts in the mac-build.yml workflow file, at least until the problem is fixed in XQuartz itself.

fvogel added on 2024-08-17 08:57:19:

For the record: there is a branch bug-36e379c01b dealing with this ticket.


jan.nijtmans added on 2024-07-01 12:13:59:

It looks like this XQuartz problem popped up on GITHUB:

https://github.com/tcltk/tk/actions/runs/9739591285

Can we just disable - for now - those testcases which trigger the problem?


fvogel added on 2023-07-18 19:38:08:

Hmmm... can't reproduce anymore. XQuartz 2.8.5 (xorg-server 21.1.6).

The XQuartz bug is still open.


fvogel added on 2023-01-08 09:32:34:
Still happening with the latest XQuartz 2.8.4 (xorg-server 21.1.6) dated 2022-12-24.

fvogel added on 2023-01-07 21:19:53:

Thanks for the pointer.

I can again reproduce this with 8.6 on macOS Ventura with --disable-aqua --disable-xft by running:

  package require Tk
  pack [entry .e]
  .e insert end 乎

The Xquartz about box says: XQuartz 2.8.3 (xorg-server 21.1.4).


SVIDevelopment added on 2022-12-19 16:44:11:
This seems to be an issue in Xquartz, see https://github.com/XQuartz/XQuartz/issues/216

fvogel added on 2022-11-23 07:31:22:
Hmm, this does not happen anymore after fossil updating Tcl and Tk to core-8-6-branches (which should not have any link to the issue).

XQuartz about box says: XQuartz 2.82. (xorg-server 1.20.14). Maybe this got upgraded since I reported the crash, I'm unsure.

chrstphrchvz added on 2022-11-23 00:56:39:

What XQuartz distribution/release version was used, in case that is relevant?