Skip to content

Commit

Permalink
Enable windows-debug github runner
Browse files Browse the repository at this point in the history
The windows-debug config exposed a UAF for the testUsvPtr() test in
the KJ_TEST("JavaScript USVStrings") since the debug build on Windows
overwrites freed memory which shows up as corruption if used after
free. The issue is described in #1334.

Fix: #1334
Test: bazel test -c dbg --cache_test_results=no //...
  • Loading branch information
ohodson committed Oct 25, 2023
1 parent d07480e commit 95493b4
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 10 deletions.
4 changes: 0 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,6 @@ jobs:
# Skip the matrix generated Windows non-debug config to use the one added above.
- os: { name : windows, image : windows-2022 }
config: { suffix: '', bazel-args: '' }
# Skip the matrix generated Windows debug config due to //src/workerd/jsg:string-test
# for Windows debug, probably caused by macro mis-configuration (TODO: fix).
- os: { name : windows, image : windows-2022 }
config: { suffix: -debug, bazel-args: --config=debug }
fail-fast: false
runs-on: ${{ matrix.os.image }}
name: test (${{ matrix.os.name }}${{ matrix.config.suffix }})
Expand Down
6 changes: 0 additions & 6 deletions src/workerd/jsg/string-test.c++
Original file line number Diff line number Diff line change
Expand Up @@ -355,13 +355,8 @@ struct UsvStringContext: public jsg::Object, public jsg::ContextGlobal {
return kj::mv(str).orDefault(usv("undefined"));
}

UsvStringPtr testUsvPtr(jsg::Optional<UsvString> str) {
return kj::mv(str).orDefault(usv("undefined"));
}

JSG_RESOURCE_TYPE(UsvStringContext) {
JSG_METHOD(testUsv);
JSG_METHOD(testUsvPtr);
}
};
JSG_DECLARE_ISOLATE_TYPE(UsvStringIsolate, UsvStringContext);
Expand All @@ -370,7 +365,6 @@ KJ_TEST("JavaScript USVStrings") {
Evaluator<UsvStringContext, UsvStringIsolate> e(v8System);

e.expectEval("testUsv('hello')", "string", "hello");
e.expectEval("testUsvPtr('hello')", "string", "hello");
e.expectEval(u8"testUsv('hello\xd8')", "string", u8"hello�");
e.expectEval("testUsv(1)", "string", "1");
e.expectEval("testUsv(false)", "string", "false");
Expand Down

0 comments on commit 95493b4

Please sign in to comment.