Skip to content

[macOS Intel] choose-fonts segfault on viewing several different fonts #7734

Description

@paschun

Describe the bug
Several fonts in the choose-fonts dialog cause segfault after trying to select/view them with arrow keys.

To Reproduce
Steps to reproduce the behavior:

  • kitten choose-fonts
  • press arrow key down/up to Azeret or Monaspace
  • bam, segfault while the font is trying to display
Environment details
kitty 0.36.0 (d8db17c513) created by Kovid Goyal
Darwin C 23.6.0 Darwin Kernel Version 23.6.0: Mon Jul 29 21:13:00 2024;
ProductName:            macOS ProductVersion:           14.6.1 BuildVersion:            23G93
OpenGL: '4.1 INTEL-22.5.11' Detected version: 4.1

Paths:
  kitty: /Applications/kitty.app/Contents/MacOS/kitty
  base dir: /Applications/kitty.app/Contents/Resources/kitty
  extensions dir: /Applications/kitty.app/Contents/Resources/Python/lib/kitty-extensions
  system shell: /usr/local/bin/fish

Config options different from defaults:
exe_search_path:
{'/usr/local/bin': '/usr/local/bin'}
shell                         /usr/local/bin/fish --login --interactive
shell_integration             frozenset({'no-sudo', 'enabled'})
symbol_map:
        U+e000 - U+e00a → Symbols Nerd Font Mono
        U+e0a0 - U+e0a3 → Symbols Nerd Font Mono
        U+e0b0 - U+e0c8 → Symbols Nerd Font Mono
        U+e0ca - U+e0ca → Symbols Nerd Font Mono
        U+e0cc - U+e0d7 → Symbols Nerd Font Mono
        U+e200 - U+e2a9 → Symbols Nerd Font Mono
        U+e300 - U+e3e3 → Symbols Nerd Font Mono
        U+e5fa - U+e6b5 → Symbols Nerd Font Mono
        U+e700 - U+e7c5 → Symbols Nerd Font Mono
        U+ea60 - U+ec1e → Symbols Nerd Font Mono
        U+ed00 - U+f2ff → Symbols Nerd Font Mono
        U+f300 - U+f375 → Symbols Nerd Font Mono
        U+f400 - U+f533 → Symbols Nerd Font Mono
        U+f0001 - U+f1af0 → Symbols Nerd Font Mono


Important environment variables seen by the kitty process:
        PATH                                /Applications/kitty.app/Contents/MacOS:/opt/local/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
        LANG                                en_US.UTF-8
        SHELL                               /usr/local/bin/fish
        USER                                myuser

Additional context
Segfault still happens with kitty --config=NONE kitten choose-fonts
However it prints a log upon launching choose-fonts dialog:
[2.593] WARNING: Your system's OpenGL implementation does not have glCopyImageSubData, falling back to a slower implementation

Segfault from Console.app
Process:               kitty [3782]
Path:                  /Applications/kitty.app/Contents/MacOS/kitty
Identifier:            net.kovidgoyal.kitty
Version:               0.36.0 (0.36.0)
Code Type:             X86-64 (Native)
Parent Process:        kitten [3781]
Responsible:           kitty [642]
User ID:               501

OS Version:            macOS 14.6.1 (23G93)

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

Exception Type:        EXC_BAD_ACCESS (SIGSEGV)
Exception Codes:       KERN_INVALID_ADDRESS at 0x0000000103ea8000
Exception Codes:       0x0000000000000001, 0x0000000103ea8000

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

VM Region Info: 0x103ea8000 is not in any region.  Bytes after previous region: 1  Bytes before following region: 98304
      REGION TYPE                    START - END         [ VSIZE] PRT/MAX SHRMOD  REGION DETAIL
      mapped file                 103e8e000-103ea8000    [  104K] r--/rw- SM=COW  Object_id=6395b1e2
--->  GAP OF 0x18000 BYTES
      __TEXT                      103ec0000-103ed4000    [   80K] r-x/rwx SM=COW  /Applications/kitty.app/Contents/Resources/Python/lib/kitty-extensions/_ctypes.so

Thread 0 Crashed::  Dispatch queue: com.apple.main-thread
0   libsystem_platform.dylib      	    0x7ff8111a6609 _platform_memmove$VARIANT$Haswell + 41
1   Python                        	       0x104b2cb81 PyBytes_FromStringAndSize + 225
2   Python                        	       0x104d0fe8e va_build_stack + 158
3   Python                        	       0x104b3da4e _PyObject_CallFunctionVa + 94
4   Python                        	       0x104b3e074 _PyObject_CallFunction_SizeT + 164
5   Python                        	       0x104bf63c0 unicode_decode_call_errorhandler_writer + 224
6   Python                        	       0x104bf3764 unicode_decode_utf8 + 2468
7   Python                        	       0x104d0ea51 do_mkvalue + 1121
8   Python                        	       0x104d0fc60 _Py_BuildValue_SizeT + 208
9   kitty.fast_data_types.so      	       0x10402d4e6 0x104013000 + 107750
10  Python                        	       0x104c9008a _PyEval_EvalFrameDefault + 72842
11  Python                        	       0x104c7d38b PyEval_EvalCode + 299
12  Python                        	       0x104d28533 run_mod + 147
13  Python                        	       0x104d2b7bc PyRun_StringFlags + 108
14  Python                        	       0x104c789fa builtin_exec + 698
15  Python                        	       0x104ba7d7b cfunction_vectorcall_FASTCALL_KEYWORDS + 75
16  Python                        	       0x104c8da4c _PyEval_EvalFrameDefault + 63052
17  Python                        	       0x104c7d38b PyEval_EvalCode + 299
18  Python                        	       0x104c788fd builtin_exec + 445
19  Python                        	       0x104ba7d7b cfunction_vectorcall_FASTCALL_KEYWORDS + 75
20  Python                        	       0x104c8da4c _PyEval_EvalFrameDefault + 63052
21  Python                        	       0x104d555bc pymain_run_module + 268
22  Python                        	       0x104d54e68 pymain_run_python + 1192
23  Python                        	       0x104d54977 Py_RunMain + 23
24  kitty                         	       0x103550819 0x10354a000 + 26649
25  kitty                         	       0x10354f91b main + 2411
26  dyld                          	    0x7ff810dee345 start + 1909

Thread 1:
0   libsystem_pthread.dylib       	    0x7ff811175ac0 start_wqthread + 0

Thread 2:
0   libsystem_pthread.dylib       	    0x7ff811175ac0 start_wqthread + 0


Thread 0 crashed with X86 Thread State (64-bit):
  rax: 0x00007f7e6c700020  rbx: 0x0000000100000004  rcx: 0x00000000ffff48dc  rdx: 0x0000000100000004
  rdi: 0x00007f7e6c70b748  rsi: 0x0000000103ea8000  rbp: 0x00007ff7bc9b2420  rsp: 0x00007ff7bc9b2420
   r8: 0x0000000100001000   r9: 0x0000000000000064  r10: 0x0000000000000003  r11: 0x00007f7d68863748
  r12: 0x0000000000000001  r13: 0x00007ff7bc9b2480  r14: 0x00007f7e6c700000  r15: 0x0000000103e9c8d8
  rip: 0x00007ff8111a6609  rfl: 0x0000000000010202  cr2: 0x0000000103ea8000
  
Logical CPU:     2
Error Code:      0x00000004 (no mapping for user data read)
Trap Number:     14

Thread 0 instruction stream:
  c1 48 83 c1 10 3d ff ff-00 00 74 db f7 d0 0f bc  .H...=....t.....
  c0 48 01 c1 48 0f b6 44-0f f0 4c 0f b6 44 0e f0  .H..H..D..L..D..
  4c 29 c0 5d c3 90 90 90-90 90 90 90 90 90 90 90  L).]............
  90 90 90 90 90 90 90 55-48 89 e5 49 89 fb 49 29  .......UH..I..I)
  f3 48 89 f8 49 39 d3 72-1b 48 83 fa 60 76 2f 48  .H..I9.r.H..`v/H
  81 fa 00 40 00 00 0f 82-cb 00 00 00 48 89 d1 fc  ...@........H...
 [f3]a4 5d c3 48 39 fe 74-f9 48 01 d6 48 01 d7 48  ..].H9.t.H..H..H	<==
  83 fa 60 0f 82 8c 01 00-00 e9 a9 01 00 00 48 83  ..`...........H.
  fa 10 76 56 c5 f8 10 4c-16 f0 48 83 ea 20 76 2a  ..vV...L..H.. v*
  c5 fc 10 06 c5 fc 11 07-48 83 c6 20 48 83 c7 20  ........H.. H.. 
  48 83 ea 20 72 14 c5 fc-10 06 c5 fc 11 07 48 83  H.. r.........H.
  c6 20 48 83 c7 20 48 83-ea 20 48 83 c2 10 7e 0c  . H.. H.. H...~.

Binary Images:
       0x103ae4000 -        0x103aebfff _struct.so (*) <36f2da63-cdc8-35bc-9555-a6fd23d074cd> /Applications/kitty.app/Contents/Resources/Python/lib/kitty-extensions/_struct.so
       0x103ec0000 -        0x103ed3fff _ctypes.so (*) <886e6b4f-4d74-32b9-8724-6f859fca0708> /Applications/kitty.app/Contents/Resources/Python/lib/kitty-extensions/_ctypes.so
       0x103acc000 -        0x103ad7fff array.so (*) <e5eea57f-8e9d-328f-91e5-e966b2bc0532> /Applications/kitty.app/Contents/Resources/Python/lib/kitty-extensions/array.so
       0x103981000 -        0x103984fff fcntl.so (*) <96d8436c-ead0-3e75-b6a9-3bb3886e89c1> /Applications/kitty.app/Contents/Resources/Python/lib/kitty-extensions/fcntl.so
       0x104013000 -        0x104252fff kitty.fast_data_types.so (*) <c1000c51-6520-39ea-86eb-7803544533d1> /Applications/kitty.app/Contents/Resources/Python/lib/kitty-extensions/kitty.fast_data_types.so
       0x104723000 -        0x10481afff libharfbuzz.0.dylib (*) <a309fadb-0909-3382-9f2e-7b1221d8dfd2> /Applications/kitty.app/Contents/Frameworks/libharfbuzz.0.dylib
       0x103ce3000 -        0x103d22fff libpng16.16.dylib (*) <f0566d16-31a1-37f2-bf2b-7aabc79d8f2a> /Applications/kitty.app/Contents/Frameworks/libpng16.16.dylib
       0x103c41000 -        0x103ca8fff liblcms2.2.dylib (*) <f3635d1a-d368-3ee3-a626-b4301706d231> /Applications/kitty.app/Contents/Frameworks/liblcms2.2.dylib
       0x106d20000 -        0x1071cffff libcrypto.3.dylib (*) <af64a9f7-30db-3942-bc0e-7adc976721cc> /Applications/kitty.app/Contents/Frameworks/libcrypto.3.dylib
       0x103abc000 -        0x103abffff _opcode.so (*) <e38aee40-4600-3a01-9983-028c5945d1e0> /Applications/kitty.app/Contents/Resources/Python/lib/kitty-extensions/_opcode.so
       0x1039a4000 -        0x1039affff _sha2.so (*) <7fc9c21b-36a2-3ffa-884d-ff622dc90b26> /Applications/kitty.app/Contents/Resources/Python/lib/kitty-extensions/_sha2.so
       0x103926000 -        0x103929fff _random.so (*) <46539064-e03e-3362-8163-6e82a7a624f3> /Applications/kitty.app/Contents/Resources/Python/lib/kitty-extensions/_random.so
       0x1038fb000 -        0x1038fefff _bisect.so (*) <5281fe82-c46b-3870-b42d-7bd2b539b217> /Applications/kitty.app/Contents/Resources/Python/lib/kitty-extensions/_bisect.so
       0x1038e3000 -        0x1038eefff math.so (*) <638df229-d7fa-32c4-b081-98515a4ea331> /Applications/kitty.app/Contents/Resources/Python/lib/kitty-extensions/math.so
       0x103912000 -        0x103919fff _lzma.so (*) <c3c00c9f-62d2-345d-a62c-bc268cecad6f> /Applications/kitty.app/Contents/Resources/Python/lib/kitty-extensions/_lzma.so
       0x1038b5000 -        0x1038b8fff _bz2.so (*) <38ab0074-b8e6-3c67-b89c-f917aa95d524> /Applications/kitty.app/Contents/Resources/Python/lib/kitty-extensions/_bz2.so
       0x1038a1000 -        0x1038a8fff zlib.so (*) <7f0957d9-9379-3e3b-9584-c8549b9b3bdd> /Applications/kitty.app/Contents/Resources/Python/lib/kitty-extensions/zlib.so
       0x103942000 -        0x103965fff libz.1.dylib (*) <1f5e7a32-25c9-3fd5-a980-38f46b94fcd4> /Applications/kitty.app/Contents/Frameworks/libz.1.dylib
       0x1038cf000 -        0x1038d6fff _json.so (*) <03e74ca4-8ab1-3c30-9390-28ede7a33ddc> /Applications/kitty.app/Contents/Resources/Python/lib/kitty-extensions/_json.so
       0x104a98000 -        0x104ed3fff org.python.python (3.12.3, (c) 2001-2023 Python Software Foundation.) <920491a4-c6bb-3f1c-8a2b-0812f5f5d2b3> /Applications/kitty.app/Contents/Frameworks/Python.framework/Versions/3.12/Python
       0x10354a000 -        0x103565fff net.kovidgoyal.kitty (0.36.0) <15fbae25-9d82-37c7-8a21-f58ac3377e76> /Applications/kitty.app/Contents/MacOS/kitty
    0x7ff8111a5000 -     0x7ff8111afff7 libsystem_platform.dylib (*) <4ea5bbf7-8ce1-37ab-916b-d14ffd7d2b4b> /usr/lib/system/libsystem_platform.dylib
    0x7ff810de8000 -     0x7ff810e7881f dyld (*) <18f658dd-20f3-324d-b7ac-8a9c60b574b3> /usr/lib/dyld
               0x0 - 0xffffffffffffffff ??? (*) <00000000-0000-0000-0000-000000000000> ???
    0x7ff811174000 -     0x7ff81117fff7 libsystem_pthread.dylib (*) <d70de43a-2804-340a-804c-5d316c1e013b> /usr/lib/system/libsystem_pthread.dylib


Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions