Skip to content

Commit f465e94

Browse files
committed
Launcher: its own sentence is not scrubbed as a recovery phrase; probe gives the dry run a repository for the code links
1 parent d3d6bbf commit f465e94

2 files changed

Lines changed: 14 additions & 10 deletions

File tree

‎.github/workflows/msix-probe.yml‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,8 @@ jobs:
180180
$report = Join-Path $PWD "report.txt"
181181
Remove-Item $report -ErrorAction SilentlyContinue
182182
$env:LAPSECOIN_LAUNCHER_CHILD = $child
183+
# a target, so the report knows its repository for the code links (a dry run sends nothing)
184+
$env:LAPSECOIN_CRASH_REPO = "Lapsecoin/core"; $env:LAPSECOIN_CRASH_TOKEN = "dry-run"
183185
$env:LAPSECOIN_CRASH_DRYRUN = $report
184186
if ($optOut) { $env:LAPSECOIN_CRASH_REPORTS = "0" } else { Remove-Item env:LAPSECOIN_CRASH_REPORTS -ErrorAction SilentlyContinue }
185187
$p = Start-Process "launcher-out\lapsecoin-launch.exe" -ArgumentList $arguments -Wait -PassThru
@@ -191,7 +193,7 @@ jobs:
191193
if (-not $r.Report) { $failures += "a fault exit code was not reported" }
192194
else {
193195
Write-Host $r.Report
194-
if ($r.Report -notmatch "0xC0000135") { $failures += "the report does not name the exit code" }
196+
if ($r.Report -notmatch "launcher: the program ended with exit code 0xC0000135 after") { $failures += "the report does not say what happened to the program" }
195197
if ($r.Report -notmatch "Crash Lc0000135") { $failures += "the report has no signature in its title" }
196198
foreach ($secret in $env:USERNAME, $env:USERPROFILE, "bid.catch", "203.0.113.7", "hunter2", "2026-10-21") {
197199
if ($r.Report -match [regex]::Escape($secret)) { $failures += "the report still holds '$secret'" }

‎launcher/Launch.cs‎

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -121,22 +121,24 @@ static void Report(string dir, int code, string refused, TimeSpan lived)
121121

122122
string hex = "0x" + unchecked((uint)code).ToString("X8");
123123
string sig = refused != null ? "Lstart" + code : "L" + hex.Substring(2).ToLowerInvariant();
124-
string what = refused != null ? refused : "the program ended with exit code " + hex + " after " + (int)lived.TotalSeconds + " s";
124+
// The launcher's own sentence is built from numbers and is not run through Clean (a run of
125+
// ordinary words looks like a recovery phrase); what Windows said is.
126+
string what = refused != null ? Clean(refused, 160) : "the program ended with exit code " + hex + " after " + (int)lived.TotalSeconds + " s";
125127

126128
string logDir = DataDir();
127129
string steps = FreshTail(logDir, "lapsecoin-start.log", 15);
128130
string crashLog = Path.Combine(logDir, "lapsecoin-crash.log");
129131
string earlier = CrashLogSinceSent(logDir);
130132

131-
StringBuilder trace = new StringBuilder();
132-
trace.AppendLine("launcher: " + what);
133-
if (earlier.Length > 0) { trace.AppendLine(); trace.AppendLine("the program's own crash log:"); trace.AppendLine(earlier); }
133+
StringBuilder seen = new StringBuilder();
134+
if (earlier.Length > 0) { seen.AppendLine(); seen.AppendLine("the program's own crash log:"); seen.AppendLine(earlier); }
134135
string events = RecentEvents();
135-
if (events.Length > 0) { trace.AppendLine(); trace.AppendLine("Windows events in the last 3 minutes:"); trace.AppendLine(events); }
136+
if (events.Length > 0) { seen.AppendLine(); seen.AppendLine("Windows events in the last 3 minutes:"); seen.AppendLine(events); }
136137

137-
string title = Clean("Crash " + sig + ": launcher: " + what, 120).Replace("\r", " ").Replace("\n", " ");
138-
string[] timed = RelativeTimes(Clean(trace.ToString(), MaxTrace + MaxEvents + 400), Clean(steps, MaxSteps));
139-
string body = BuildBody(sig, what, timed[0], timed[1], repo);
138+
string title = ("Crash " + sig + ": launcher: " + what).Replace("\r", " ").Replace("\n", " ");
139+
if (title.Length > 120) title = title.Substring(0, 120);
140+
string[] timed = RelativeTimes(Clean(seen.ToString(), MaxTrace + MaxEvents + 400), Clean(steps, MaxSteps));
141+
string body = BuildBody(sig, what, "launcher: " + what + "\n" + timed[0], timed[1], repo);
140142

141143
if (!string.IsNullOrEmpty(dryRun))
142144
{
@@ -151,7 +153,7 @@ static string BuildBody(string sig, string what, string trace, string steps, str
151153
StringBuilder b = new StringBuilder();
152154
b.AppendLine("Reported automatically by the LapseCoin launcher.");
153155
b.AppendLine();
154-
b.AppendLine("LapseCoin " + Version() + ", launcher, " + Clean(what, 80) + ". Windows " + WindowsBuild() + " " + Arch() + ".");
156+
b.AppendLine("LapseCoin " + Version() + ", launcher, " + (what.Length > 80 ? what.Substring(0, 80) : what) + ". Windows " + WindowsBuild() + " " + Arch() + ".");
155157
b.AppendLine();
156158
b.AppendLine("What the launcher saw:");
157159
b.AppendLine(Fence);

0 commit comments

Comments
 (0)