aw-query/aw-transform: deep-nesting stack overflow, backslash strings, silent lexer truncation and 6 more (bug-hunt follow-ups)
Maintainer thường phản hồi trong vòng 1 ngày
@TimeToBuildBob đang làm issue này rồi.
Từ ngày 24/11/2026.
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 15/100
Hướng nghiên cứu
Nine separate follow-ups, not one task: pick a single numbered item and leave the rest. Items 1-3 live in the aw-query lexer and parser — the reproducer queries are in the issue text, and tests/regex_fuzz.rs already records the backslash gap; item 5 points at the TODO in interpret.rs. For the transforms (8-9), period_union, merge_events_by_keys, flood and filter_period_intersect in aw-transform are where durations are summed, and heartbeat already has an overflow-refusal test to copy. Done means the named reproducer no longer fails and cargo test passes for the touched crate.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Follow-ups from a verified bug hunt over aw-query and aw-transform at ea6f09c. The fixed items are in #880 (transform) and #881 (query panics). These remain, best first. Each one marked reproduced was run against aw_query::query on master.
Query language
- Deep nesting aborts the server (reproduced).
return 1+1+…+1;with 100k terms (about 200 KB) overflows a 2 MiB thread stack and aborts the whole process (fatal runtime error: stack overflow, SIGABRT).catch_unwindcan't catch that. The parser builds the left-recursivebinoptree on its heap stack, and theninterpret_expr, the generatedDropforBox<Expr>, and serde all recurse once per level. A parse-time depth limit is the robust fix, because an iterative evaluator wouldn't cover the recursive drop. Reach: any local process, since the request needsContent-Type: application/json, which blocks cross-origin pages. - A string ending in a backslash breaks the whole query (reproduced).
return ["a\\", "b"];givesParsingError. The string token regex"([^"]|(\\"))*"has no\\escape, so\"keeps the string open. aw-webui collapses\\to\in the categories JSON (queries.ts), so a category regex ending in an escaped backslash (for example a Windows path likeC:\\Users\\) makes every categorised view fail.tests/regex_fuzz.rsnotes that\\isn't handled. A fix has to stay compatible with that aw-webui workaround. - An unlexable character silently ends the program (reproduced).
return 1;\n@ return 2;returns1with no error. plex returnsNonewhen no rule matches, andLexer::nexttreats that as end of input. A non-breaking space or a smart quote pasted between statements does the same, and silently drops the rest of the query. - All binary operators share one precedence level (reproduced; design question).
return 1 + 2 * 3;gives9, andreturn 2 == 1 + 1;is anInvalidTypeerror. Everybinopproduction isbinop OP func. If flat left-to-right is intended it should be documented; otherwise*///%should bind tighter than+/-, and those tighter than==. returndoesn't exit (reproduced; possibly intended).if True { return 1; } return 2;gives2.returnonly assignsRETURN(there's aTODOininterpret.rs).- Self-concatenation has no size bound (traced). Statements like
a = a + a;double a string or list each time. About 30 of them reach gigabytes, and the 300 s budget is only checked between statements, so a sub-1 KB query can OOM the server. TIMEINTERVALis a reassignable variable (traced). A query that overwrites it reads outside the requested period, but its result is cached and invalidated under the requested period. That can serve stale data to clients that do this. aw-webui doesn't.
Transforms (traced, not run)
- Merged durations can exceed the serializable range.
period_union,merge_events_by_keysandfloodadd durations with+=, so two valid ~200-year events can sum pastnum_nanoseconds(). The later.unwrap()inaw-models(calculate_endtime,get_nanos) then panics the request.heartbeatalready refuses this (test_heartbeat_refuses_merge_that_overflows_duration). This needs events over 146 years long, which only an import can create. filter_period_intersectpasses negative-duration events through.{ts 5s, dur -2s}against[0s, 10s)is returned unchanged by the "a within b" branch.flooddrops these deliberately, so queries that don't flood first can lose time. The import endpoint doesn't reject negative durations.
- Ngôn ngữ chính
- Rust
- Star
- 322
- Fork
- 107
- Merge trung bình
- 2 ngày 16 giờ
- Pull request đã merge (30 ngày)
- 25
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
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 ActivityWatch/aw-server-rust
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
ActivityWatch/aw-server-rust#883 · 1 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 80/100
ActivityWatch/aw-server-rust#872 ·
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 78/100
ActivityWatch/aw-server-rust#798 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
query: categorize rules can pin unbounded memory in the regex cache and run past query_timeoutCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 22/100
ActivityWatch/aw-server-rust#893 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
aw-client CLI ignores aw-client.toml host/portCó thể đã có người làm @TimeToBuildBob đã nhận 1 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 35/100
ActivityWatch/aw-server-rust#888 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của ActivityWatch/aw-server-rust
Issue tương tự
-
renaming a provider to a taken name fails with a raw sql errorCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mởarea:storage kind:bug priority:p3 ready
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
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 62/100
expo/exact#1716 · 1 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 72/100
Maintainer thường phản hồi trong vòng 1 ngày
-
XLSX files cannot be imported into Adobe InDesign due to missing AppVersion in extended propertiesĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
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 82/100
qingjian-team/qingjian#1181 ·
Maintainer thường phản hồi trong vòng 2 ngày