Skip to content

Commit 9475716

Browse files
committed
test(pty): trace Windows Unicode parser crash
1 parent ba290a8 commit 9475716

2 files changed

Lines changed: 19 additions & 0 deletions

File tree

.github/workflows/windows.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,20 @@ jobs:
7575
if: failure() && steps.tests.outcome == 'failure'
7676
timeout-minutes: 10
7777
run: cargo test --locked --lib --all-features -- --test-threads=1 --nocapture
78+
- name: Debug Windows parser crash
79+
if: failure() && steps.tests.outcome == 'failure'
80+
timeout-minutes: 10
81+
run: |
82+
$artifacts = cargo test --locked --lib --no-run --message-format=json | ForEach-Object { $_ | ConvertFrom-Json }
83+
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
84+
$binary = ($artifacts | Where-Object { $_.reason -eq 'compiler-artifact' -and $_.profile.test -and $_.executable }).executable
85+
$debugger = 'C:\Program Files\LLVM\bin\lldb.exe'
86+
if (Test-Path $debugger) {
87+
& $debugger --batch -o run -o 'thread backtrace all' -o 'register read' -- $binary --exact service::tests::rows_keep_physical_wraps_and_unicode_graphemes --nocapture
88+
} else {
89+
Write-Output 'LLDB is unavailable; checking installed Windows SDK debuggers'
90+
Get-ChildItem 'C:\Program Files (x86)\Windows Kits\10\Debuggers' -Filter cdb.exe -Recurse -ErrorAction SilentlyContinue
91+
}
7892
- name: Smoke test executable
7993
if: ${{ !cancelled() && steps.build.outcome == 'success' }}
8094
run: |

src/service.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1434,7 +1434,9 @@ mod tests {
14341434
max_scrollback: 2 * 1024 * 1024,
14351435
})
14361436
.unwrap();
1437+
eprintln!("rows_terminal: writing {} bytes", input.len());
14371438
terminal.vt_write(input.as_bytes());
1439+
eprintln!("rows_terminal: write complete");
14381440
terminal
14391441
}
14401442

@@ -1474,13 +1476,16 @@ mod tests {
14741476

14751477
#[test]
14761478
fn rows_keep_physical_wraps_and_unicode_graphemes() {
1479+
eprintln!("unicode rows: ASCII setup");
14771480
let terminal = rows_terminal(4, 3, "abcdefghij");
14781481
assert_eq!(
14791482
format_rows(&terminal, None).unwrap(),
14801483
["abcd", "efgh", "ij"]
14811484
);
14821485
assert_eq!(format_rows(&terminal, Some(2)).unwrap(), ["efgh", "ij"]);
1486+
eprintln!("unicode rows: Unicode setup");
14831487
let terminal = rows_terminal(4, 3, "a\u{301}\u{754c}bc");
1488+
eprintln!("unicode rows: formatting");
14841489
assert_eq!(
14851490
format_rows(&terminal, None).unwrap(),
14861491
["a\u{301}\u{754c}b", "c", ""]

0 commit comments

Comments
 (0)