Fails to launch when built with Clang Control Flow Integrity (CFI)
Under Chimera Linux which uses LLVM 15.0.7 as the primary package building toolchain, if I build my package of buffyboard
with hardening = ["vis", "cfi"]
the following crash can be observed when launching buffyboard
:
$ doas buffyboard
Could not update current terminal size: Invalid argument
Could not update current terminal size: Invalid argument
unable to add device to libinput context: No such file or directory
Trace/breakpoint trap (core dumped)
$ doas lldb -c core
(lldb) target create --core "core"
Core file '/home/deathmist/core' (aarch64) was loaded.
(lldb) bt
* thread #1, name = 'buffyboard', stop reason = signal SIGTRAP
* frame #0: 0x0000005583276b10 buffyboard`lv_draw_rect(coords=0x0000007ff54b6fc8, clip=<unavailable>, dsc=0x0000007ff54b6f70) at lv_draw_rect.c:0
frame #1: 0x000000558329e320 buffyboard`draw_main(e=<unavailable>) at lv_btnmatrix.c:775:9
frame #2: 0x000000558329ccac buffyboard`lv_btnmatrix_event(class_p=<unavailable>, e=0x0000007ff54b7150) at lv_btnmatrix.c:648:9
frame #3: 0x0000005583266dd0 buffyboard`event_send_core [inlined] lv_obj_event_base(class_p=0x0000000000000000, e=0x0000007ff54b7150) at lv_event.c:97:5
frame #4: 0x0000005583266d94 buffyboard`event_send_core(e=0x0000007ff54b7150) at lv_event.c:414:11
frame #5: 0x0000005583268ed0 buffyboard`lv_refr_obj [inlined] lv_event_send(obj=0x00000055832d0f60, event_code=LV_EVENT_DRAW_MAIN, param=0x0000007ff54b7148) at lv_event.c:74:20
frame #6: 0x0000005583268ec0 buffyboard`lv_refr_obj(obj=0x00000055832d0f60, mask_ori_p=0x0000007ff54b72f0) at lv_refr.c:713:9
frame #7: 0x0000005583268c18 buffyboard`lv_refr_obj_and_children(top_p=0x00000055832d0f60, mask_p=0x0000007ff54b72f0) at lv_refr.c:648:5
frame #8: 0x0000005583268970 buffyboard`lv_refr_area_part(area_p=<unavailable>) at lv_refr.c:580:5
frame #9: 0x00000055832679e0 buffyboard`_lv_disp_refr_timer at lv_refr.c:488:13
frame #10: 0x00000055832678d0 buffyboard`_lv_disp_refr_timer [inlined] lv_refr_areas at lv_refr.c:399:13
frame #11: 0x00000055832677cc buffyboard`_lv_disp_refr_timer(tmr=<unavailable>) at lv_refr.c:220:5
frame #12: 0x0000005583296b54 buffyboard`lv_timer_handler at lv_timer.c:313:59
frame #13: 0x00000055832969ec buffyboard`lv_timer_handler at lv_timer.c:109:16
frame #14: 0x0000005583254e0c buffyboard`main [inlined] lv_task_handler at lv_api_map.h:37:12
frame #15: 0x0000005583254e08 buffyboard`main(argc=<unavailable>, argv=<unavailable>) at main.c:343:9
frame #16: 0x0000007fa8e64948
Enabling hidden visibility (hardening = ["vis"]
) alone isn't enough to cause this fwiw.
Here's also the core file (extracts from ~400 KiB -> 300 MiB): core.gz