首页 > 解决方案 > TT_Load_Glyph_Header python 崩溃

问题描述

我正在运行一个带有 python/cython 后端的家庭构建的烧瓶 webapp。在 macOS 11.4 上的 webapp 运行时,会发生突然的系统崩溃。我怀疑崩溃是由于使用以下命令将 matplotlib 图形转换为 html

tmpfile = BytesIO()
fig.savefig(tmpfile, format='png', transparent=True, bbox_inches='tight', pad_inches=0.1)
encoded = base64.b64encode(tmpfile.getvalue()).decode('utf8')
html = "<img src='data:image/png;base64,{}'>".format(encoded)

崩溃报告中的重要部分

Process:               Python [9500]
Path:                  /Library/Frameworks/Python.framework/Versions/3.8/Resources/Python.app/Contents/MacOS/Python
Identifier:            Python
Version:               3.8.6 (3.8.6)
Code Type:             X86-64 (Native)
Parent Process:        zsh [583]
Responsible:           Terminal [574]
User ID:               501

Date/Time:             2021-10-01 21:19:10.090 -0500
OS Version:            macOS 11.4 (20F71)
Report Version:        12
Bridge OS Version:     5.4 (18P4663)
Anonymous UUID:        101A3E01-C670-EEBE-7C56-88149744B9CC


Time Awake Since Boot: 27000 seconds

System Integrity Protection: enabled

Crashed Thread:        12

.
.
.

Thread 12 Crashed:
0   ft2font.cpython-38-darwin.so    0x000000010f6e9224 TT_Load_Glyph_Header + 84
1   ft2font.cpython-38-darwin.so    0x000000010f6da174 load_truetype_glyph + 692
2   ft2font.cpython-38-darwin.so    0x000000010f6d97c9 TT_Load_Glyph + 505
3   ft2font.cpython-38-darwin.so    0x000000010f6d8e3b tt_glyph_load + 315
4   ft2font.cpython-38-darwin.so    0x000000010f6cc039 FT_Load_Glyph + 873
5   ft2font.cpython-38-darwin.so    0x000000010f7349d9 af_loader_load_g + 153
6   ft2font.cpython-38-darwin.so    0x000000010f7346cc af_loader_load_glyph + 412
7   ft2font.cpython-38-darwin.so    0x000000010f73449c af_autofitter_load_glyph + 188
8   ft2font.cpython-38-darwin.so    0x000000010f6cc001 FT_Load_Glyph + 817
9   ft2font.cpython-38-darwin.so    0x000000010f6c624f PyFT2Font_set_text(PyFT2Font*, _object*, _object*) + 1135


.
.
.

Thread 12 crashed with X86 Thread State (64-bit):
  rax: 0x0000000000000002  rbx: 0x0000000000000061  rcx: 0x000070001bf0ab20  rdx: 0x00007fcc7c9d3ea0
  rdi: 0x000070001bf0ab20  rsi: 0x00007fcc7c9d3d50  rbp: 0x000070001bf0a8f0  rsp: 0x000070001bf0a8f0
   r8: 0x0000000000002200   r9: 0x00007fcca8474568  r10: 0x00007fcca8474560  r11: 0x000000002b5cb730
  r12: 0x0000000000000057  r13: 0x00007fcc9d66a3b8  r14: 0x0000000000000044  r15: 0x00007fcca8474430
  rip: 0x000000010f6e9224  rfl: 0x0000000000010202  cr2: 0x0000000000000000

如果有帮助,这是 webapp 转换为 html 的图形类型。非常忙于希腊字母! 在此处输入图像描述

我更新了 matplotlib 及其所有依赖项。恐怕这是macos问题......任何建议都会有所帮助。

标签: pythonmacosmatplotlib

解决方案


推荐阅读