Repository navigation
On Windows Hush writes a small log file, panics too, since it has no console - #289
Conversation
… too, since it has no console
…ch launch's start, and its docs say what it covers
Review (
|
… too, since it has no console
…ch launch's start, and its docs say what it covers
Review (
|
What changed
hush.login the data folder as well as stderr, about 1 MB: the line that would pass it first moves the file tohush.log.1(replacing the one there) and starts a new one. While that move is refused (another program has a file open without delete sharing, as a viewer following the log may), lines go on inhush.logpast the cap rather than nowhere, and the next line tries again. AHUSH_DATA_DIRrun writes it in that folder. (core/sig-core/src/logging.rs:LogFile,keep_in;inittees the fmt layer's writer to it on Windows only.)Hush started version=…(logged right afterkeep_in): a bug report says which version wrote it, and the release check has a line it can require.main's first line: the desktop app now starts the core's log first thing (sig_core::logging::init(), whichClient::openused to be the first to call). The data folder isn't known that early, so lines wait in memory (1 MB at most) untilapp::folder()has settled it, then go into the file first. Waiting is on purpose: makingHushbeforehome()has run would stop its one-time move of an old "Hush Desktop" folder into its place.panicked at <file>:<line>:<col>: <message>through the same scrubbed log (so into the file), then calls std's hook as before.keep_inis logged to stderr only.hush.login the app's data folder with itsHush startedline, and prints it; the stderr capture is renamedstderr.logso the two aren't confused. Nothing else in the workflow changed (same pinned actions, permissions and token scope).hush.logandhush.log.1to a bug report (Download: a panic in Hush is in it, not a native crash), and how the log works there (Development).home.rs: theshortcut:saying its warnings were lost before the core's log was up is gone (the log is up first now), andleft_alone's doc no longer says nothing is logged before the core opens.macOS and Linux: no file, no panic hook. The one difference there is that the log starts at
main's first line, not at the core's open, sohome()'s two warnings (the old login item, the old key) now reach Console.app / stderr instead of being dropped.Why
Owner's decision of 2026-11-29: since #285 the Windows build has
windows_subsystem = "windows", so launched from Explorer, the Start menu or the Run key the log and any panic went nowhere, and a failure before the window opened left no trace.Panic messages: what I checked
Every
panic!,expect,unwrap,unreachable!andassert!outside tests incore/sig-coreandcore/desktop: each carries a fixed text ("the window opens", "HMAC takes any key length", ...) or, in one case, a database file's path (ProjectionDb's encryption assert); none formats a message, a name or a number. Panics from dependencies (GPUI'sRefCell already borrowed, an index out of bounds) carry their own code's text. Either way, the line goes through the sameScrubas every log line, which blanks service ids, keys and other long hex, phone numbers and byte dumps (the panic test checks a UUID is blanked).How it was tested
logging.rs), each seen failing against a stub (no rotation, nothing kept waiting, no hook) and passing with the change:lines_wait_for_the_folder_and_go_first_into_its_file: lines logged beforeopen_inreach the file first, as many as fit in the cap; nothing is made before the folder is known.past_its_cap_the_log_starts_over_keeping_the_one_before: the file is there from the start, fills to exactly the cap, then becomeshush.log.1; a secondLogFileon the folder (the next launch) goes on in the same file; only one older file is kept; a line longer than the cap goes in whole, alone.a_panic_is_logged_with_its_place_and_scrubbed: a real panic, caught, logs a line withpanicked at sig-core/src/logging.rs:<line>:and its message with the service id in it blanked, and no line has the raw id.a_log_that_cant_be_moved_goes_on_past_its_cap: a non-empty folder in place ofhush.log.1makes the move fail on any OS; the line past the cap stays inhush.log, and the next line moves it once it can. It failed before that fix (the line was dropped) and passes after.logging.rsas it is (by symlink) andmain.rs's new lines, with the core'sCargo.lockversions:cargo clippy --offline --target x86_64-pc-windows-msvc --lib --bins -- -D warningsis clean, and a deliberately wrong use of the Windows-only static fails there, which shows that code is compiled.make format(no changes),make checkpasses on a1e5b2c (fmt, both clippy runs, 386 + 550 tests). The workflow's YAML parses (actionlint isn't installed here; the change is PowerShell lines in an existing step). The macOS--snapshotrun (which goes through the new start ofmain) rendered all 88 screens; chat-light looked at, unchanged.test-287-1pre-release ran it on a throwaway branch: this PR's head (db2a2ad) plus one temporary probe commit (a panic on demand inmain, behind an env var, and an extra workflow step). The release, its tag and the branch were deleted after the run; the probe never touched this PR's branch.hush.exestill running after 20 s, andhush-data\hush.logheldINFO hush: Hush started version=test-287-1and GPUI's threeRefCell already borrowederrors, line for line what stderr got.hush.exestarted withStart-Processand no redirect (no stderr, as from Explorer),HUSH_PROBE_PANIC=1: it exited 101, and itshush.logheldHush startedthenERROR sig_core::logging: panicked at desktop\src\main.rs:48:9: a probe panic. So the file is written underwindows_subsystemwith no console, and the panic hook reaches it.Closes #287