Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade GA CI from windows-2016 which is deprecated and will be removed 3/15/22 #5195

Closed
derekbruening opened this issue Nov 7, 2021 · 14 comments

Comments

@derekbruening
Copy link
Contributor

Github gives us this message:

The windows-2016 environment is deprecated and will be removed on March 15, 2022. Migrate to windows-latest instead. For more details see actions/runner-images#4312

This issue covers updating for our DR and DrMemory jobs.

@derekbruening derekbruening changed the title Upgrade GA CI from windows-2106 which is deprecated and will be removed 3/15/22 Upgrade GA CI from windows-2016 which is deprecated and will be removed 3/15/22 Jan 11, 2022
@derekbruening
Copy link
Contributor Author

Looks like the GA CI windows-2019 has VS2019 so we'd need #3805

abhinav92003 added a commit that referenced this issue Feb 24, 2022
Upgrades (or rather attempts to upgrade) the Windows version in Github Actions config to windows-2019. This is required because windows-2016 will be removed on March 15 2022.

Issue: #5195
@abhinav92003
Copy link
Contributor

Test failures and their immediate causes:

client.drsyms-testgcc
expected:

Failed to unmangle _ZN10linked_ptrIN12CrxInstaller14WhitelistEntryEE4copyIS1_EEvPKS_IT_E
got correct overflow
Failed to unmangle std::operator<<<<<std::char_traits<char, truncated
got correct overflow
finished unmangling.
enumerating with DRSYM_LEAVE_MANGLED
enumerating with DRSYM_DEMANGLE
enumerating with DRSYM_DEMANGLE_FULL
found drsyms-test.appdll.cpp
stack trace:
drsyms-test\.appdll\.cpp:60!dll_public(\(\))?
overloaded: 1
overloaded: 2
overloaded: 4
app num_calls: 7
got back 4
got back 4

actual:

Failed to unmangle _ZN10linked_ptrIN12CrxInstaller14WhitelistEntryEE4copyIS1_EEvPKS_IT_E
got correct overflow
Unexpected unmangling:
 actual: testing::internal::ActionResultHolder<void>::PerformAction<void >(class testing::Action<void > const &,class std::tr1::tuple<class FilePath const &,class FilePath const &,class base::DictionaryValue const *,class Extension const *,void,void,void,void,void,void> const &)
 expected: testing::internal::ActionResultHolder<void>::PerformAction<void (class FilePath const &,class FilePath const &,class base::DictionaryValue const *,class Extension const *)>(class testing::Action<void (class FilePath const &,class FilePath const &,class base::DictionaryValue const *,class Extension const *)> const &,class std::tr1::tuple<class FilePath const &,class FilePath const &,class base::DictionaryValue const *,class Extension const *,void,void,void,void,void,void> const &)
Failed to unmangle std::operator<<<<<std::char_traits<char, truncated
got correct overflow
finished unmangling.
enumerating with DRSYM_LEAVE_MANGLED
enumerating with DRSYM_DEMANGLE
enumerating with DRSYM_DEMANGLE_FULL
found drsyms-test.appdll.cpp
stack trace:
drsyms-test.appdll.cpp:60!dll_public
overloaded: 1
overloaded: 2
overloaded: 4
app num_calls: 7
got back 4
got back 4

client.drsyms-test:
expected:

compound arg std::nothrow_t has 0 field\(s\), size 1
(compound arg `anonymous-namespace'::HasFields has 4 field\(s\), size 12
  class field 0 is type 1 and size 4
  class field 1 is type 1 and size 1
  class field 2 is type 1 and size 2
  class field 3 is type 6 and size 4
compound arg `anonymous-namespace'::Foo has 1 field\(s\), size 1
  class field 0 is type 3 and size 0
    func has 1 args
      arg 0 is type 1 and size 4
|compound arg `anonymous-namespace'::Foo has 1 field\(s\), size 1
  class field 0 is type 3 and size 0
    func has 1 args
      arg 0 is type 1 and size 4
compound arg `anonymous-namespace'::HasFields has 4 field\(s\), size 12
  class field 0 is type 1 and size 4
  class field 1 is type 1 and size 1
  class field 2 is type 1 and size 2
  class field 3 is type 6 and size 4
)found all overloads
found name_outer::name_middle::name_inner::sample_class<>::nested_class<>::templated_func<>
found name_outer::name_middle::name_inner::sample_class<>::nested_class<>::templated_func<>
found name_outer::name_middle::name_inner::sample_class<>::nested_class<>::templated_func<>
found name_outer::name_middle::name_inner::sample_class<>::nested_class<>::templated_func<>
found name_outer::name_middle::name_inner::sample_class<>::nested_class<>::templated_func<>
found name_outer::name_middle::name_inner::sample_class<>::nested_class<>::templated_func<>
found name_outer::name_middle::name_inner::sample_class<char>::nested_class<int>::templated_func<int>
found name_outer::name_middle::name_inner::sample_class<char>::nested_class<int>::templated_func<int>
found name_outer::name_middle::name_inner::sample_class<char>::nested_class<int>::templated_func<int>
found name_outer::name_middle::name_inner::sample_class<char>::nested_class<int>::templated_func<int>
drsym_get_type_by_name successfully found HasFields type
Failed to unmangle _ZN10linked_ptrIN12CrxInstaller14WhitelistEntryEE4copyIS1_EEvPKS_IT_E
got correct overflow
Failed to unmangle std::operator<<<<<std::char_traits<char, truncated
got correct overflow
finished unmangling.
enumerating with DRSYM_LEAVE_MANGLED
enumerating with DRSYM_DEMANGLE
enumerating with DRSYM_DEMANGLE_FULL
found drsyms-test.appdll.cpp
found tools.h
stack trace:
drsyms-test\.appdll\.cpp:60!dll_public
overloaded: 1
overloaded: 2
overloaded: 4
app num_calls: 7
got back 4
got back 4

actual:

compound arg std::nothrow_t has 0 field(s), size 1
overloaded_class missing!
found name_outer::name_middle::name_inner::sample_class<>::nested_class<>::templated_func<>
found name_outer::name_middle::name_inner::sample_class<>::nested_class<>::templated_func<>
found name_outer::name_middle::name_inner::sample_class<>::nested_class<>::templated_func<>
found name_outer::name_middle::name_inner::sample_class<>::nested_class<>::templated_func<>
found name_outer::name_middle::name_inner::sample_class<>::nested_class<>::templated_func<>
found name_outer::name_middle::name_inner::sample_class<>::nested_class<>::templated_func<>
found name_outer::name_middle::name_inner::sample_class<char>::nested_class<int>::templated_func<int>
found name_outer::name_middle::name_inner::sample_class<char>::nested_class<int>::templated_func<int>
found name_outer::name_middle::name_inner::sample_class<char>::nested_class<int>::templated_func<int>
found name_outer::name_middle::name_inner::sample_class<char>::nested_class<int>::templated_func<int>
drsym_get_type_by_name successfully found HasFields type
Failed to unmangle _ZN10linked_ptrIN12CrxInstaller14WhitelistEntryEE4copyIS1_EEvPKS_IT_E
got correct overflow
Unexpected unmangling:
 actual: testing::internal::ActionResultHolder<void>::PerformAction<void >(class testing::Action<void > const &,class std::tr1::tuple<class FilePath const &,class FilePath const &,class base::DictionaryValue const *,class Extension const *,void,void,void,void,void,void> const &)
 expected: testing::internal::ActionResultHolder<void>::PerformAction<void (class FilePath const &,class FilePath const &,class base::DictionaryValue const *,class Extension const *)>(class testing::Action<void (class FilePath const &,class FilePath const &,class base::DictionaryValue const *,class Extension const *)> const &,class std::tr1::tuple<class FilePath const &,class FilePath const &,class base::DictionaryValue const *,class Extension const *,void,void,void,void,void,void> const &)
Failed to unmangle std::operator<<<<<std::char_traits<char, truncated
got correct overflow
finished unmangling.
enumerating with DRSYM_LEAVE_MANGLED
enumerating with DRSYM_DEMANGLE
enumerating with DRSYM_DEMANGLE_FULL
found drsyms-test.appdll.cpp
found tools.h
stack trace:
drsyms-test.appdll.cpp:60!dll_public
overloaded: 1
overloaded: 2
overloaded: 4
app num_calls: 7
got back 4
got back 4

client.tls:

expected:

in foo_t::foo_t
in foo_t::foo_t
in foo_t::foo_t
sum is 14
static TLS is 0xdeadbeef
foo\.val is 0xdeadbeef
vector holds 0xdeadbeef
in foo_t::foo_t
sum is 14
static TLS is 0xdeadbeef
foo\.val is 0xdeadbeef
vector holds 0xdeadbeef
static TLS is 0xdeadbef0
foo\.val is 0xdeadbeee
vector holds 0xdeadbeee

actual:

in foo_t::foo_t
in foo_t::foo_t
sum is 14
static TLS is 0xdeadbeef
foo.val is 0xdeadbeef
vector holds 0xdeadbeef
in foo_t::foo_t
sum is 14
static TLS is 0xdeadbeef
foo.val is 0xdeadbeef
vector holds 0xdeadbeef
static TLS is 0xdeadbef0
foo.val is 0xdeadbeee
vector holds 0xdeadbeee

The 32-bit Security-win32.except-execution has empty output, could be a crash.

@derekbruening
Copy link
Contributor Author

Pasting from #5385 (comment) to show the bitwidth summary:

32-bit:

====> FAILURE in debug-internal-32 <====
debug-internal-32: 237 tests passed, **** 8 tests failed, but ignoring 5 for i#2145: ****
	(ignore: i#2145) 	code_api|win32.hookerfirst 
	code_api|security-win32.except-execution 
	(ignore: i#2145) 	code_api|client.drx-test 
	code_api|client.tls 
	code_api|client.drsyms-test 
	(ignore: i#2145) 	code_api|client.pcache-use 
	(ignore: i#2145) 	code_api|api.startstop 
	(ignore: i#2145) 	code_api|api.detach 

64-bit:

debug-internal-64: 253 tests passed, **** 16 tests failed, but ignoring 13 for i#2145: ****
	(ignore: i#2145) 	code_api|common.nativeexec 
	(ignore: i#2145) 	code_api|win32.mixedmode_late 
	(ignore: i#2145) 	code_api|win32.mixedmode 
	(ignore: i#2145) 	code_api|win32.x86_to_x64 
	(ignore: i#2145) 	code_api|win32.x86_to_x64_ibl_opt 
	(ignore: i#2145) 	code_api|client.cleancall 
	(ignore: i#2145) 	code_api|client.loader 
	(ignore: i#2145) 	code_api|client.drmgr-test 
	(ignore: i#2145) 	code_api|client.drx-test 
	code_api|client.tls 
	code_api|client.drsyms-testgcc 
	(ignore: i#2145) 	code_api|client.drutil-test 
	code_api|client.drsyms-test 
	(ignore: i#2145) 	code_api|client.pcache-use 
	(ignore: i#2145) 	code_api|client.drwrap-test-detach 
	(ignore: i#2145) 	code_api|api.detach 

@derekbruening
Copy link
Contributor Author

On my win10 21HQ machine with VS2019, I cannot reproduce the 64-bit client.tls nor drsyms-testgcc failures. drsyms-test does fail on my machine but the output is slightly different: it doesn't have the "Unexpected unmangling" but it is missing a bunch of the early lines though not as many as the GA CI VM:

148: Test timeout computed to be: 1500
148: compound arg `anonymous-namespace'::Foo has 1 field(s), size 1
148:   class field 0 is type 3 and size 0
148:     func has 1 args
148:       arg 0 is type 1 and size 4
148: compound arg `anonymous-namespace'::HasFields has 4 field(s), size 12
148:   class field 0 is type 1 and size 4
148:   class field 1 is type 1 and size 1
148:   class field 2 is type 1 and size 2
148:   class field 3 is type 6 and size 4
148: compound arg std::nothrow_t has 0 field(s), size 1
148: found all overloads
148: found name_outer::name_middle::name_inner::sample_class<>::nested_class<>::templated_func<>
...

@derekbruening
Copy link
Contributor Author

I can repro the 32-bit security-win32.except-execution failure: the test doesn't crash but it has no output so it short-circuits and skips key parts somehow.

@derekbruening
Copy link
Contributor Author

For 32-bit security-win32.except-execution:

Looks like its custom thread creation failed and that does all the work so
that's why it has no output:

security_win32_except_execution!dump_exception_info+0x3f0:
00401670 ff154cd94400    call    dword ptr [security_win32_except_execution!type_info `RTTI Type Descriptor'+0x20 (0044d94c)] ds:002b:0044d94c={ntdll!ZwCreateThread (77352eb0)}
0:000> p
eax=c0000022 ebx=0030d000 ecx=251b0000 edx=00008664 esi=1400f000 edi=00402540

That's STATUS_ACCESS_DENIED.
That NtCreateThread method I believe is no longer supported by newer kernels.

I'm looking at this old test and trying to understand why it needs a raw
thread: why it can't use a regularly-created thread, or the initial thread.

@derekbruening
Copy link
Contributor Author

I just took out the whole raw thread and the test passes, at least in default instru mode, which is enough. But, the template file is full of tabs and trailing spaces so it will be a pain to commit...I will try to clean it up as part of the fix. The context dumper has that whitespace in it.

@derekbruening
Copy link
Contributor Author

On my win10 21HQ machine with VS2019, I cannot reproduce the 64-bit client.tls nor drsyms-testgcc failures. drsyms-test does fail on my machine but the output is slightly different: it doesn't have the "Unexpected unmangling" but it is missing a bunch of the early lines though not as many as the GA CI VM:

148: Test timeout computed to be: 1500
148: compound arg `anonymous-namespace'::Foo has 1 field(s), size 1
148:   class field 0 is type 3 and size 0
148:     func has 1 args
148:       arg 0 is type 1 and size 4
148: compound arg `anonymous-namespace'::HasFields has 4 field(s), size 12
148:   class field 0 is type 1 and size 4
148:   class field 1 is type 1 and size 1
148:   class field 2 is type 1 and size 2
148:   class field 3 is type 6 and size 4
148: compound arg std::nothrow_t has 0 field(s), size 1
148: found all overloads
148: found name_outer::name_middle::name_inner::sample_class<>::nested_class<>::templated_func<>
...

For this one: it looks like my machine just has the std::nothrow_t after Foo and HasFields instead of before. So just output ordering. While GA CI is completey missing Foo and HasFields, which is not good.

derekbruening added a commit that referenced this issue Mar 10, 2022
Updates the security-win32.except-execution test to not make a raw
thread with a custom stack, which fails on GA CI win2019.  Running the
test code on the initial thread as-is works fine, for regular DR
instrumentation modes.

To avoid headaches with tabs and trailing spaces, updates the context
dumping to avoid those, and updates other templates that use that.

Issue: #5195
@derekbruening
Copy link
Contributor Author

For the drsyms tests I did some investigation. "kraken" is my machine here.

On kraken: it does find the test app's anon-namespace symbols; has output ordering issue is all.
On GA CI: doesn't find test app's symbols at all it seems.

GA CI x64:

-- Found C:/Program Files (x86)/Windows Kits/10/Debuggers/x64/dbghelp.dll
-- Using C:/Program Files (x86)/Windows Kits/10/Debuggers/x64/dbghelp.dll for drsyms tests

Kraken x64:

-- Found C:/Program Files (x86)/Microsoft Visual Studio 12.0/Common7/IDE/Remote Debugger/x64/dbghelp.dll
-- Using C:/Program Files (x86)/Microsoft Visual Studio 12.0/Common7/IDE/Remote Debugger/x64/dbghelp.dll for drsyms tests

Kraken x86 has no dbghelp output in cmake config. Same with GA CI.
They thus use C:\WINDOWS/system32/dbghelp.dl.
On kraken drsyms-test fails with:

174: <Application D:\derek\dr\git\build_vs2019_x86_dbg_tests\suite\tests\bin\client.drsyms-test.exe (9212).  Internal Error: DynamoRIO debug check failure: D:\derek\dr\git\src\core\win32\loader.c:771 !is_dynamo_address(dcontext->app_fls_data)
174: (Error occurred @0 frags in tid 3968)

On Kraken x64 I can repro that assert if I do:

% rsync -av  /c/WINDOWS/system32/dbghelp.dll suite/tests/bin/

So DR's private loader doesn't work properly with that dbghelp version.

Versions:

% strings -el /c/WINDOWS/system32/dbghelp.dll | grep -A 1 FileV
FileVersion
10.0.19041.867 (WinBuild.160101.0800)

% strings -el 'C:/Program Files (x86)/Microsoft Visual Studio 12.0/Common7/IDE/Remote Debugger/x64/dbghelp.dll' | grep -A 1 FileVer
FileVersion
\StringFileInfo\%04x%04x\%s
--
FileVersion
6.3.9600.16384 (debuggers(dbg).130821-1623)

% strings -el /c/Program\ Files\ \(x86\)/Windows\ Kits/10/Debuggers/x64/dbghelp.dll  | grep -A 1 FileVer
FileVersion
10.0.18362.1 (WinBuild.160101.0800)

% strings -el 'C:/Program Files (x86)/Microsoft Visual Studio 14.0/Common7/IDE/Remote Debugger/x64/dbghelp.dll' | grep -A 1 FileVer
FileVersion
10.0.10150.0 (debuggers(dbg).150616-1659)

Using the Windows Kits/10 version in suite/tests/bin: still finds HasFields
and Foo, so not reproducing GA CI.

My VS2019 build.ninja does have debug flags and presumably matches GA CI
which is also using ninja (though I have cmake 3.15.0 and GA CI win2019 has
cmake 2.22.3):

build suite\tests\CMakeFiles\client.drsyms-test.dir\client-interface\drsyms-test.cpp.obj: CXX_COMPILER__client.2edrsyms-test D$:\derek\dr\git\src\suite\tests\client-interface\drsyms-test.cpp || cmake_object_order_depends_target_client.drsyms-test
  DEFINES = -D_AMD64_
  FLAGS = /nologo /MP /GF /FS /GS- /MTd  /Zi /Od  /W4 /WX  /nologo /MP /GF /FS /GS- /MTd  /Zi /Od  /W3 /WX /EHsc -DNIGHTLY_REGRESSION -DNOT_DYNAMORIO_CORE
  INCLUDES = -I. -ID:\derek\dr\git\src\suite\tests -ID:\derek\dr\git\src\core\arch -Icmake\..\include -ID:\derek\dr\git\src\core\drlibc -ID:\derek\dr\git\src\core\lib -Iinclude\annotations -Isuite\tests\annotations -Iext\include
  OBJECT_DIR = suite\tests\CMakeFiles\client.drsyms-test.dir
  OBJECT_FILE_DIR = suite\tests\CMakeFiles\client.drsyms-test.dir\client-interface
  TARGET_COMPILE_PDB = suite\tests\CMakeFiles\client.drsyms-test.dir\
  TARGET_PDB = suite\tests\bin\client.drsyms-test.pdb

derekbruening added a commit that referenced this issue Mar 12, 2022
Updates the security-win32.except-execution test to not make a raw
thread with a custom stack, which fails on GA CI win2019.  Running the
test code on the initial thread as-is works fine, for regular DR
instrumentation modes.

To avoid headaches with tabs and trailing spaces, updates the context
dumping to avoid those, and updates other templates that use that.

Issue: #5195
@abhinav92003
Copy link
Contributor

For some reason I'm not able to use tmate for the Windows CI now. It just gets stuck on "Installing tmate" while setting up the tmate session.

derekbruening added a commit that referenced this issue Mar 14, 2022
Searches both Program Files and Program Files (x86) for dbghelp.dll to
fix problems where 32-bit fails to find an SDK or VS version and ends
up using the system version which DR"s private loader has trouble
with.

Adds a CMake status message listing all the dghelp.dll paths found, to
help diagnose selection issues.

Issue: #5195
derekbruening added a commit that referenced this issue Mar 14, 2022
Searches both Program Files and Program Files (x86) for dbghelp.dll to
fix problems where 32-bit fails to find an SDK or VS version and ends
up using the system version which DR"s private loader has trouble
with.

Adds a CMake status message listing all the dghelp.dll paths found, to
help diagnose selection issues.

Issue: #5195
derekbruening added a commit that referenced this issue Mar 14, 2022
Relaxes the ordering of symbols found through the dbghelp iterator to
handle orderings seen with VS2019.

This has the client.drsyms-test (and client.drsyms-testgcc) tests now
passing for both 32-bit and 64-bit on my VS2019 local setup.
Unfortunately the GA CI setup has further problems.

Issue: #5195
derekbruening added a commit that referenced this issue Mar 15, 2022
Relaxes the ordering of symbols found through the dbghelp iterator to
handle orderings seen with VS2019.

This has the client.drsyms-test (and client.drsyms-testgcc) tests now
passing for both 32-bit and 64-bit on my VS2019 local setup.
Unfortunately the GA CI setup has further problems.

Issue: #5195
derekbruening added a commit that referenced this issue Mar 15, 2022
Updates our official supported Windows toolchain from VS2017 to VS2019.
Updates the documentation on how to build.

Updates our GA CI jobs.
Adds 3 tests to the ignore list as they fail on this platform and we
do not yet have fixes.

Issue: #5195
derekbruening added a commit that referenced this issue Mar 15, 2022
Updates our official supported Windows toolchain from VS2017 to VS2019.
Updates the documentation on how to build.

Updates our GA CI jobs.
Adds 3 tests to the ignore list as they fail on this platform and we
do not yet have fixes.

Issue: #5195
@derekbruening
Copy link
Contributor Author

I marked the 3 vs2019-* jobs as required and removed the vs2017-* from the required list. (BTW I noticed a new feature, requiring all conversations to be marked resolved beforemerging: seems reasonable so I checked it.)

abhinav92003 added a commit that referenced this issue Mar 15, 2022
Fixes the expected output for client.tls on Windows. The previous template
accounts for a mysterious output line, which we're not seeing anymore on
vs2019, so we just remove it from the expected output.

Also removes support for PRE_VS2015, seeing as we're effectively dropping
support for vs2017 by removing the above-mentioned line.

Issue: #5195
abhinav92003 added a commit that referenced this issue Mar 15, 2022
Fixes the expected output for client.tls on Windows. The previous template
accounts for a mysterious output line, which we're not seeing anymore on
vs2019, so we just remove it from the expected output.

Also removes support for PRE_VS2015, seeing as we're effectively dropping
support for vs2017 by removing the above-mentioned line.

Issue: #5195
derekbruening added a commit that referenced this issue Mar 21, 2022
The windows-2016 image is deprecated so we update the DR package
building job to use windows-219.

Issue: #5195
@derekbruening
Copy link
Contributor Author

The package builder needs to be upgraded: but when I do so it fails on building Dr. Memory which also needs to be upgraded.

@derekbruening
Copy link
Contributor Author

I split the drsyms problem into #5430. For now we have the drsyms tests auto-ignored which is not a great state to be in.

derekbruening added a commit to DynamoRIO/drmemory that referenced this issue Mar 27, 2022
Updates DR to the latest 5e1360267 for VS2019 support.

Updates GA CI jobs to use the 2019 image.

Issue: DynamoRIO/dynamorio#5195
derekbruening added a commit to DynamoRIO/drmemory that referenced this issue Mar 27, 2022
Updates DR to the latest 6431fc4f5 for VS2019 support and to fix DynamoRIO/dynamorio#5432.

Updates GA CI jobs to use the 2019 image.

Defines VS2019-required defines, just like DR does.

Avoids dup symbol errors for strtol in libucrtd and ntdll_imports via /force:multiple (xref #1805).

Issue: DynamoRIO/dynamorio#5195, #1805, DynamoRIO/dynamorio#5432
derekbruening added a commit that referenced this issue Mar 27, 2022
The windows-2016 image is deprecated so we update the DR package
building job to use windows-2019.

Issue: #5195
@derekbruening
Copy link
Contributor Author

#5430 is what remains. Closing this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants