aarch64: SIGILL on BTI-enabled CPUs: #12536 fixed lib/flb_libco but the binary links lib/monkey/deps/flb_libco
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 63/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- c
- Lĩnh vực
- operating-systems
Hướng nghiên cứu
Bản sửa nằm trong bản sao vendored lib/monkey/deps/flb_libco/aarch64.c, nơi phần cuối của khối asm co_switch_aarch64 vẫn kết thúc bằng br x17. Hãy so sánh với lib/flb_libco/aarch64.c, file đã được #12536 đổi thành ret x17, và xác nhận rằng build CMake chỉ biên dịch bản sao của monkey. Hoàn thành khi file monkey khớp với file đã sửa và build aarch64 với -mbranch-protection=standard vượt qua bài kiểm tra runtime BTI; cần một CPU hỗ trợ BTI để tái hiện SIGILL.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Bug Report
Describe the bug
On an aarch64 CPU that implements BTI, a fluent-bit binary built with -mbranch-protection=standard gets SIGILL in the output worker thread (flb-out-forward) at the first flush.
#12536 fixed this in lib/flb_libco/aarch64.c by changing the end of co_switch_aarch64 from br x17 to ret x17. But fluent-bit does not link that copy: the build compiles the libco bundled with monkey, lib/monkey/deps/flb_libco/libco.c. Monkey's aarch64.c still ends with br x17 in v5.1.5, v5.2.0 and master, so the binary still crashes.
To Reproduce
Build fluent-bit for aarch64 with -mbranch-protection=standard in CFLAGS. This is the Yocto/OpenEmbedded default for aarch64, and the binary gets the AArch64 feature: BTI, PAC GNU property.
Run on a CPU with BTI (bti in /proc/cpuinfo, e.g. Neoverse V2/V3, Cortex-A720; we hit it on NVIDIA Jetson Thor):
fluent-bit -i dummy -o forward -p host=127.0.0.1 -p port=24299 -f 1
The process dies with SIGILL within a second:
Thread 4 "flb-out-forward" received signal SIGILL, Illegal instruction.
bl co_switch
=> ldr x21, [x21, #40]
$_siginfo.si_code is 1. The faulting PC is the instruction after bl co_switch, reached by the br x17 at the end of co_switch_aarch64, which is not a BTI landing pad.
Expected behavior
No SIGILL; coroutine switches work as on CPUs without BTI.
Your Environment
Version used: v5.0.2. The same br x17 is in monkey's copy in v5.1.5, v5.2.0 and master.
Environment name and version: Yocto / OpenEmbedded (meta-oe fluentbit_5.0.2.bb), GCC with -mbranch-protection=standard
Server type and version: NVIDIA Jetson Thor (Neoverse V3AE, Armv9), Linux 6.8
Operating System and version: Yocto-based embedded Linux
Filters and plugins: reproduced with dummy → forward; any output that flushes in a coroutine should hit it
Additional context
Only one libco object is built: lib/monkey/deps/flb_libco/CMakeFiles/co.dir/libco.c.o.
After the #12536 change, lib/flb_libco/aarch64.c and lib/monkey/deps/flb_libco/aarch64.c are otherwise identical.
The fix: apply the same one-line change to monkey's copy (and to monkey upstream):
--- a/lib/monkey/deps/flb_libco/aarch64.c
+++ b/lib/monkey/deps/flb_libco/aarch64.c
@@ -58,7 +58,7 @@ asm (
" ldp x28, x29, [x0, #144]\n"
" ldp x16, x17, [x0, #160]\n"
" mov sp, x16\n"
-
" br x17\n"
-
);" ret x17\n" ".previous\n"
With this applied to v5.0.2, the crash is gone on Jetson Thor and records are forwarded normally.
Longer term, there should be a single copy of libco, or the BTI runtime test added in #12536 should also build monkey's copy, so the two cannot diverge again.
- Ngôn ngữ chính
- C
- Star
- 8.2k
- Fork
- 2k
- Merge trung bình
- 3 ngày 13 giờ
- Pull request đã merge (30 ngày)
- 93
Chuẩn bị môi trường
Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.
- Có Dockerfile hoặc tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của fluent/fluent-bit
-
in_tail: files falsely detected as rotated on macOS with threaded inputs, causing duplicate recordsCó thể đã có người làm @kevin9327 đã nhận 2 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
fluent/fluent-bit#12780 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
status: waiting-for-triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
fluent/fluent-bit#12683 · 2 bình luận · 6 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
fluent/fluent-bit#12657 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
http: Transfer-Encoding chunked plus Content-Length hangs forever (CL branch shadows the chunked path)Có thể đã có người làm @sarankumar1325 đã nhận 15 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
fluent/fluent-bit#12656 · 3 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
fluent/fluent-bit#12649 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của fluent/fluent-bit
Issue tương tự
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
Maintainer thường phản hồi trong vòng 1 ngày
-
good first issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
dfa1/rocksdb-ffm#292 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
SPIDevice selects an active-high device as soon as it is createdCó thể đã có người làm @mikeysklar đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 73/100
adafruit/circuitpython#11869 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 78/100
gnif/LookingGlass#1352 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
Maintainer thường phản hồi trong vòng 1 ngày