AISpot
所屬事件:llama.cpp 修復深層巢狀 JSON 與語法遞迴棧溢位崩潰(1 個來源 · 2 則報導)

2026 年 10 月 25 日,llama.cpp 接連發布 b11871 與 b11882 兩個建置,修補請求解析中的遞迴棧溢位問題。b11871 在遞迴遍歷請求 JSON 之前先檢查巢狀深度,超過 128 層直接返回 400,避免請求導致 HTTP 執行緒棧溢位、讓 llama-server 崩潰;據發布說明,s… 看完整事件

llama.cpp 修復深層巢狀 JSON 致服務崩潰

llama.cpp releases版本更新地端推論開發工具開源

llama.cpp 發布 b11871,在遞迴遍歷前先檢查 JSON 巢狀深度,超過 128 層直接返回 400,避免請求打爆 HTTP 執行緒棧、讓 llama-server 崩潰。此前 schema builder、jinja 引擎與決策程式碼都遞迴遍歷請求 JSON,macOS 上幾百層深的工具 schema 就會觸發 SIGBUS,Linux 約一萬層觸發 SIGSEGV。

原標題:b11871
閱讀原文

同一事件共有 2 則報導(1 個來源),看事件全貌

評分45 / 45(平均 45,門檻 60)
狀態未入選

原文

chat : reject JSON nested more than 128 levels before walking it ( #30242 ) chat : reject JSON nested more than 128 levels before walking it The schema builder, the jinja engine and the decision code walk request JSON with recursion. A request nested deep enough overflows the stack of the HTTP thread and llama-server dies (SIGBUS on macOS, SIGSEGV on Linux): for a tool schema from a few hundred levels on macOS and about 10000 on Linux. Check the depth first and answer 400 past 128 levels: the chat inputs in common_chat_templates_apply (tools, tool-call arguments, chat_template_kwargs, json_schema), the json_schema of /completion, and the whole /v1/systemone body. A gemma4 tool result that is too deep stays text. fix the root, not the call side Co-authored-by: Xuan Son Nguyen [email protected] Website: https://llama.app Attestations: https://github.com/ggml-org/llama.cpp/attestations/59557647 macOS/iOS: macOS Apple Silicon (arm64) macOS Apple Silicon (arm64, KleidiAI enabled) DISABLED macOS Intel (x64) iOS XCFramework Linux: Ubuntu x64 (CPU) Ubuntu arm64 (CPU) Ubuntu s390x (CPU) Ubuntu x64 (Vulkan) Ubuntu arm64 (Vulkan) Ubuntu x64 (CUDA 12) - CUDA 12.8 libraries Ubuntu x64 (CUDA 13) - CUDA 13.4 libraries Ubuntu arm64 (CUDA 13) - CUDA 13.4 libraries Ubuntu x64 (ROCm 10.0) Ubuntu x64 (OpenVINO) Ubuntu x64 (SYCL FP32) Ubuntu x64 (SYCL FP16) Linux arm64 (Snapdragon: CPU, Adreno GPU, Hexagon NPU) - setup guide Android: Android arm64 (CPU) Android arm64 (Snapdragon: CPU, Adreno GPU, Hexagon NPU) - setup guide Windows: Windows x64 (CPU) Windows arm64 (CPU) Windows arm64 (OpenCL Adreno) Windows x64 (CUDA 12) - CUDA 12.4 DLLs Windows x64 (CUDA 13) - CUDA 13.4 DLLs Windows arm64 (CUDA 13) - CUDA 13.4 DLLs Windows x64 (Vulkan) Windows arm64 (Vulkan) Windows x64 (OpenVINO) Windows x64 (SYCL) Windows x64 (ROCm 10.0) openEuler: DISABLED openEuler x86 (310p) openEuler x86 (910b, ACL Graph) openEuler aarch64 (310p) openEuler aarch64 (910b, ACL Graph) UI: UI

相關報導

llama.cpp releasesAI 評分37

llama.cpp b11539 應用上游深層巢狀 JSON 補丁

llama.cpp 發布 b11539 建置,唯一程式碼改動是應用來自上游的深層巢狀 JSON 補丁(#30253)。各平台預編譯包照常提供,覆蓋 macOS/iOS、Ubuntu(CPU、Vulkan、CUDA 12/13、ROCm 10.0、OpenVINO、SYCL)、Android、Windows 以及 openEuler。其中 macOS Apple Silicon 的 KleidiAI 啟用版和 openEuler 建置本次被標記為 DISABLED。

llama.cpp releasesAI 評分53

llama.cpp 修復特殊 token 轉義導致的 server 崩潰

llama.cpp 修復了 llama-server 在轉義特殊 token 時會被單個請求打崩的棧溢位問題。此前 d1-omni 與 kev 兩個 prompt 用 std::regex_replace 處理請求文字里的 "<|name|>",libstdc++ 會按名字的每個字元遞迴,輸入 "<|" 加 30000 個字母即可撐爆 HTTP 執行緒棧,程序以 SIGSEGV 退出。

llama.cpp releasesAI 評分48

llama.cpp 修復 Ling 3.0 解析器忽略 json_schema 的問題

llama.cpp 合併 PR #29813,讓 Ling 3.0 解析器開始遵循 inputs.json_schema。此前 Ling 3.0 只為工具呼叫建置語法,response_format 請求不受約束;新實現加入優先於工具的回應格式語法路徑,並在啟用思考時要求先輸出 think 塊、JSON 回應後不允許追加散文。該修復對應 issue #29652,隨新版建置覆蓋 macOS、Linux、Windows、Android 等平台。

llama.cpp releasesAI 評分20

llama.cpp 修復 server 因 n_batch 超限導致的 abort

llama.cpp 合併 PR #29903,通過將 n_batch 限制為不超過 n_ubatch 來修復 server 崩潰問題,對應 issue #29902。該修復由 Claude 輔助完成,並移除了相關測試與 embeddings 條件。新版本已覆蓋 macOS、Linux、Windows、Android 等平台,包括 Apple Silicon、CUDA、ROCm、Vulkan 等後端。

llama.cpp releasesAI 評分46

llama.cpp 修復 jinja tojson 浮點數精度丟失

llama.cpp 新建置 b11622 修復了 jinja 模板 tojson 的浮點數輸出。此前 tojson 通過 C++ 流列印浮點,只有 6 位有效數字且省略 .0,48.858844 會變成 48.8588、1.0 變成 1,影響工具定義、工具呼叫引數和其他模板輸出。現在改為輸出能讀回同一數值的最短數字,與 Python 的 json.dumps 一致,float 的 string 與 safe 過濾器也共用這段邏輯。