Repository navigation
win32: ignore remaining benign debug/EH notifications under -bt - #95
Code-newWorld wants to merge 2 commits into
Conversation
0002 only continues on OutputDebugStringA (0x40010006). The same VEH still treats OutputDebugStringW (0x4001000A), debugger RIP, SetThreadName, and MS C++ EH as fatal. Ship the rebuilt bt-exe.o so -bt programs survive those first-chance notifications; real faults stay fatal. Co-authored-by: Cursor <cursoragent@cursor.com>
CI staged-preflight marked the bundle ineligible because build.ps1, winnt.h, and bt-exe.o changed while bundle-manifest.json still declared the pre-0010 sha256s. Align those three digests with the committed blobs. Co-authored-by: Cursor <cursoragent@cursor.com>
medvednikov
left a comment
There was a problem hiding this comment.
Reviewed head 9cbf2a20a107885f1b4f474cc690f4699ec51b89, excluding CI results.
[P2] Rebuild the native libtcc.dll handler as well
The delivered binary fix covers newly linked executables, but not native -bt -run execution or libtcc clients. This PR replaces lib/bt-exe.o while leaving the bundled libtcc.dll unchanged. These contain separate copies of the handler: lib/bt-exe.c includes tccrun.c for linked executables, whereas libtcc.c compiles it into libtcc, whose bt_link() installs its own exception handler for in-memory execution. Updating the external object does not update that handler.
Consequently, the native execution path retains the old behavior for these notifications even after this bundle update. A Windows regression case to cover is tcc.exe -g -bt10 -run ods.c, with:
#include <windows.h>
int main(void) {
OutputDebugStringW(L"probe");
return 0;
}Please rebuild and ship the native libtcc.dll with patch 0010 too, update its manifest digest, and check this in-memory execution case alongside the linked-EXE test. This is an incomplete delivery of the fix, not a claim that the PR newly introduced the old failure.
Validation: the new patch's SHA-256 matches its manifest entry, Git accepts its syntax, and it applies to a fixture containing the relevant pinned TinyCC source context plus patch 0002. An isolated C harness for the patched handler passed all five allowlisted-code checks and six fatal-code checks, including access violation, stack overflow, divide-by-zero, and unknown exceptions. The added cases use EXCEPTION_CONTINUE_SEARCH, preserving downstream exception handling. These were source-level checks with mocked runtime hooks; I did not run Windows binaries or reproduce the -run case on Windows. The pre-existing patch 0005/0006/0008 issues are outside this review.
Summary
-btalso continues on remaining first-chance debugger/EH notifications:DBG_PRINTEXCEPTION_WIDE_C(OutputDebugStringW/0x4001000A),DBG_RIPEXCEPTION,SetThreadName(0x406D1388), and Microsoft C++ EH (0xE06D7363).lib/bt-exe.o. V links this object via-bt; patch text alone does not change already-built compilers or user programs.0002 already ignores ANSI
OutputDebugStringA(0x40010006). The Wide path still hitcpu_exception_handler's default and exited 255 withcaught exception 4001000a.Test plan
tcc -bt+OutputDebugStringWexits 0 (noRUNTIME ERROR)tcc -bt+ null dereference still reportsinvalid memory accessand exits non-zerov.exeso the compiler process itself picks up the newbt-exe.oNote: this PR does not repair the pre-existing corrupt
0005/0006/0008patches inbuild.ps1. Daily users only need the newbt-exe.o.