Skip to content

[port #1064] preserve runtime SetTraceback behavior in tiny mode - #4

Open
luantak wants to merge 2 commits into
masterfrom
cursor/maremagnum-pr-1064-tiny-settraceback-2676
Open

[port #1064] preserve runtime SetTraceback behavior in tiny mode#4
luantak wants to merge 2 commits into
masterfrom
cursor/maremagnum-pr-1064-tiny-settraceback-2676

Conversation

@luantak

@luantak luantak commented Aug 11, 2026

Copy link
Copy Markdown
Owner

Validity: valid

Why emptying setTraceback breaks Windows (luantak: “explain this more”)

Tiny mode is meant to strip traceback printing. runtime.setTraceback also updates process-wide state that is not about printing:

  • On Windows, debug.SetTraceback("wer") clears SEM_NOGPFAULTERRORBOX via SetErrorMode.
  • That flag otherwise suppresses Windows Error Reporting crash UI / dump collection.
  • If tiny empties setTraceback's body, SetTraceback("wer") becomes a no-op: WER stays suppressed even though the app asked to enable it.

So this change keeps traceback-output cleanup elsewhere, but stops emptying setTraceback so non-printing semantics still work. testdata/script/tiny-wer.txtar asserts the SEM flag flips on Windows.

Upstream

burrowers#1064 (was dirty vs master)

Commit layout

Commit 1 is Maremagnum's from burrowers#1064 (author preserved as on the upstream commit: autoprofiler <autoprofiler@local.invalid>); following commit(s) address luantak/mvdan review feedback and are authored by the Cursor/luantak port side.

  • f9f97c2 autoprofiler | preserve runtime SetTraceback behavior in tiny mode
  • 7b2f2d6 Cursor Agent | Address review feedback: explain WER semantics; go 1.23 in script

What this ports

  • Remove the setTraceback body-emptying case
  • Add Windows-only tiny-wer.txtar (kept)

Feedback applied

  • Rebased onto current master: kept master's newer writeErrStr tiny suppression; only dropped setTraceback stripping
  • Expanded script + runtime_patch comments with the WER / SEM_NOGPFAULTERRORBOX explanation above
  • Script go.mod uses go 1.23 for consistency with other script tests (Copilot)

Testing

  • go test -run 'TestScript/(tiny|tiny-wer)$' . ✅ (WER script skips on non-Windows)

Remaining risks

  • Low on Linux/macOS. Windows WER path not exercised in this Linux environment ([!windows] skip).

Notes for Paul

Clean rebase; good to forward after a Windows CI glance.

Open in Web Open in Cursor 

autoprofiler and others added 2 commits August 11, 2026 21:04
Co-authored-by: Paul <luantak@pm.me>
luantak asked for a clearer explanation: emptying setTraceback breaks
Windows WER via SEM_NOGPFAULTERRORBOX. Expand tiny-wer.txtar and
runtime_patch comments; use go 1.23 in the script go.mod like other
tests. Rebased to keep master's writeErrStr strip.

Co-authored-by: Paul <luantak@pm.me>
@cursor
cursor Bot force-pushed the cursor/maremagnum-pr-1064-tiny-settraceback-2676 branch from a29f070 to 7b2f2d6 Compare August 11, 2026 21:05
@luantak
luantak marked this pull request as ready for review August 11, 2026 23:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants