Skip to content

[port #1065] strip tiny source position tables at link time (design caveat) - #10

Draft
luantak wants to merge 2 commits into
masterfrom
cursor/maremagnum-pr-1065-tiny-source-positions-2676
Draft

[port #1065] strip tiny source position tables at link time (design caveat)#10
luantak wants to merge 2 commits into
masterfrom
cursor/maremagnum-pr-1065-tiny-source-positions-2676

Conversation

@luantak

@luantak luantak commented Aug 11, 2026

Copy link
Copy Markdown
Owner

Validity: questionable — design buy-in from mvdan still needed

mvdan is skeptical: further linker patches increase per-Go-release maintenance cost, and asked why short -tiny positions are a problem. Copilot High flagged an OOB concern with ^uint32(0) in cutab.

Do not present this as ready to merge upstream blindly.

Upstream

burrowers#1065

Commit layout

Commit 1 is Maremagnum's from burrowers#1065 (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.

  • 16c6b01 autoprofiler | strip tiny source position tables at link time
  • de0ff04 Cursor Agent | Address review feedback: write 0 into cutab placeholder

What this ports

  • Linker patch 0005-strip-tiny-source-positions-safely.patch removing filename/line mappings while retaining stack maps / pcsp / pcinline / unwind data
  • Updated tiny.txtar expectations (caller: ? 0, etc.)

Feedback applied

  • OOB fix: write 0 into the runtime.cutab placeholder instead of ^uint32(0), so accidental lookups resolve to filetab[0] ("?") rather than an out-of-bounds index (per Copilot)
  • Comment in the patch documents why

Testing

  • go test -run 'TestScript/tiny$' . ✅ (exercises patched linker)

Remaining risks

  • High for upstream merge: design disagreement + linker-patch maintenance burden. Functionally tested here on Linux, but mvdan may reject the approach entirely.

Notes for Paul

Optional / last priority. Useful if you want the more aggressive tiny position stripping and are willing to own the linker-patch cost; otherwise skip or discuss with mvdan first.

Open in Web Open in Cursor 

autoprofiler and others added 2 commits August 11, 2026 21:04
Copilot High: ^uint32(0) in runtime.cutab can OOB into filetab. Write 0
so accidental lookups resolve to filetab[0] ("?"). NOTE: mvdan design
buy-in still needed before upstream merge.

Co-authored-by: Paul <luantak@pm.me>
@cursor
cursor Bot force-pushed the cursor/maremagnum-pr-1065-tiny-source-positions-2676 branch from 9075344 to de0ff04 Compare August 11, 2026 21:05
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