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

Two tests failed after successful compilation by msvc on the windows x64 platform #735

Closed
qd1332543 opened this issue Nov 9, 2021 · 3 comments · Fixed by #737
Closed
Labels
Milestone

Comments

@qd1332543
Copy link

qd1332543 commented Nov 9, 2021

Describe the bug
When I used the code compiled by msbuild for unit testing, the test failed. The specific failure is as follows:

Test project F:/google/glog/build_amd64
      Start  1: demangle
 1/14 Test  #1: demangle .........................   Passed    0.04 sec
      Start  2: logging
 2/14 Test  #2: logging ..........................   Passed    0.48 sec
      Start  3: signalhandler
 3/14 Test  #3: signalhandler ....................   Passed    0.04 sec
      Start  4: stacktrace
 4/14 Test  #4: stacktrace .......................   Passed    0.03 sec
      Start  5: stl_logging
 5/14 Test  #5: stl_logging ......................   Passed    0.03 sec
      Start  6: symbolize
 6/14 Test  #6: symbolize ........................Exit code 0xc0000409
***Exception:   0.07 sec
F20211109 02:12:17.248965  6740 symbolize_unittest.cc:394] Check failed: symbol != NULL 
*** Check failure stack trace: ***
    @   00007FF614D964CB  public: void __cdecl google::LogMessage::Flush(void) __ptr64
    @   00007FF614D94AD9  public: __cdecl google::LogMessageFatal::~LogMessageFatal(void) __ptr64
    @   00007FF614D92771  (unknown)
    @   00007FF614D929BE  (unknown)
    @   00007FF614D9FF90  bool __cdecl google::glog_internal_namespace_::IsFailureSignalHandlerInstalled(void)
    @   00007FFAEB0784D4  BaseThreadInitThunk
    @   00007FFAEC3F1791  RtlUserThreadStart
      Start  7: cmake_package_config_init
 7/14 Test  #7: cmake_package_config_init ........   Passed    0.03 sec
      Start  8: cmake_package_config_generate
 8/14 Test  #8: cmake_package_config_generate ....   Passed    2.74 sec
      Start  9: cmake_package_config_build
 9/14 Test  #9: cmake_package_config_build .......***Failed    1.89 sec
Microsoft (R) Build Engine version 16.11.1+3e40a09f8 for .NET Framework
Copyright (C) Microsoft Corporation. All rights reserved.
  Checking Build System
  Building Custom Rule F:/google/glog/src/package_config_unittest/working_config/CMakeLists.txt
  glog_package_config.cc
LINK : fatal error LNK1104: cannot open file 'F:\google\glog\build_amd64\Debug\glogd.lib' [F:\google\glog\build_amd64\test_package_config\working_config\glog_package_config.vcxproj]
      Start 10: cmake_package_config_cleanup
10/14 Test #10: cmake_package_config_cleanup .....   Passed    0.03 sec
      Start 11: cleanup_init
11/14 Test #11: cleanup_init .....................   Passed    0.02 sec
      Start 13: cleanup_immediately
12/14 Test #13: cleanup_immediately ..............   Passed    3.19 sec
      Start 14: cleanup_with_prefix
13/14 Test #14: cleanup_with_prefix ..............   Passed    3.19 sec
      Start 12: cleanup_logdir
14/14 Test #12: cleanup_logdir ...................   Passed    0.02 sec
86% tests passed, 2 tests failed out of 14
Total Test time (real) =  11.81 sec
The following tests FAILED:
	  6 - symbolize (Exit code 0xc0000409
)
	  9 - cmake_package_config_build (Failed)

To Reproduce
Steps to reproduce the behavior:

1. git clone https://github.com/google/glog
2. git -C "F:\google\glog" rev-parse --git-dir
   git -C "F:\google\glog" clean -xdf
   git -C "F:\google\glog" fetch --recurse-submodules=no --force
   git -C "F:\google\glog" reset --hard 3369666
   git -C "F:\google\glog" remote prune origin
3. set VSCMD_SKIP_SENDTELEMETRY=1 & "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\Tools\VsDevCmd.bat" -host_arch=amd64 -arch=amd64
4. cmake -G "Visual Studio 16 2019" -A x64 -DCMAKE_SYSTEM_VERSION=10.0.18362.0 -DCMAKE_BUILD_TYPE=Release ..
5. msbuild /m /p:Platform=x64 /p:Configuration=Release glog.sln /t:Rebuild /p:BuildInParallel=true
6. ctest --build-config Release --output-on-failure

Expected behavior
All test pass.

Observed Behavior
Unit test failed.

Environment
OS: Windows Server 2016 1607
CPU: AMD EPYC 7452 32-Core Processor
Compiler: MSVC 14.29.30133
Language: ENU

@qd1332543 qd1332543 changed the title Two tests failed after successful compilation by msvc on the windows platform Two tests failed after successful compilation by msvc on the windows x64 platform Nov 9, 2021
@qd1332543
Copy link
Author

On the x86 platform, the build failed, and the specific error information is as follows:

21>F:\google\glog\src\googletest.h(565,15): error C2664: 'HANDLE CreateThread(LPSECURITY_ATTRIBUTES,SIZE_T,LPTHREAD_START_ROUTINE,LPVOID,DWORD,LPDWORD)': cannot convert argument 3 from 'DWORD (__cdecl *)(void *)' to 'LPTHREAD_START_ROUTINE' [F:\google\glog\build_amd64\demangle_unittest.vcxproj]
       F:\google\glog\src\googletest.h(567,28): message : This conversion requires a reinterpret_cast, a C-style cast or function-style cast [F:\google\glog\build_amd64\demangle_unittest.vcxproj]
       C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\processthreadsapi.h(170,1): message : see declaration of 'CreateThread' [F:\google\glog\build_amd64\demangle_unittest.vcxproj]
    21>Done Building Project "F:\google\glog\build_amd64\demangle_unittest.vcxproj" (Rebuild target(s)) -- FAILED.
     5>Done Building Project "F:\google\glog\build_amd64\demangle_unittest.vcxproj.metaproj" (Rebuild target(s)) -- FAILED.
    27>F:\google\glog\src\googletest.h(565,15): error C2664: 'HANDLE CreateThread(LPSECURITY_ATTRIBUTES,SIZE_T,LPTHREAD_START_ROUTINE,LPVOID,DWORD,LPDWORD)': cannot convert argument 3 from 'DWORD (__cdecl *)(void *)' to 'LPTHREAD_START_ROUTINE' [F:\google\glog\build_amd64\utilities_unittest.vcxproj]
       F:\google\glog\src\googletest.h(567,28): message : This conversion requires a reinterpret_cast, a C-style cast or function-style cast [F:\google\glog\build_amd64\utilities_unittest.vcxproj]
       C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\processthreadsapi.h(170,1): message : see declaration of 'CreateThread' [F:\google\glog\build_amd64\utilities_unittest.vcxproj]
    22>F:\google\glog\src\googletest.h(565,15): error C2664: 'HANDLE CreateThread(LPSECURITY_ATTRIBUTES,SIZE_T,LPTHREAD_START_ROUTINE,LPVOID,DWORD,LPDWORD)': cannot convert argument 3 from 'DWORD (__cdecl *)(void *)' to 'LPTHREAD_START_ROUTINE' [F:\google\glog\build_amd64\logging_unittest.vcxproj]
       F:\google\glog\src\googletest.h(567,28): message : This conversion requires a reinterpret_cast, a C-style cast or function-style cast [F:\google\glog\build_amd64\logging_unittest.vcxproj]
       C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\processthreadsapi.h(170,1): message : see declaration of 'CreateThread' [F:\google\glog\build_amd64\logging_unittest.vcxproj]
    27>Done Building Project "F:\google\glog\build_amd64\utilities_unittest.vcxproj" (Rebuild target(s)) -- FAILED.
    14>Done Building Project "F:\google\glog\build_amd64\utilities_unittest.vcxproj.metaproj" (Rebuild target(s)) -- FAILED.

You can check build error messages from attached file build.log

@sergiud
Copy link
Collaborator

sergiud commented Nov 9, 2021

Our CI completes the tests on x86_64. Thus, the exact steps allowing to reproduce the problem are necessary.

Please create another issue for x86 compilation errors, including the individual setup steps. The problems do not seem to be related.

@sergiud sergiud added bug and removed incomplete labels Nov 9, 2021
@sergiud
Copy link
Collaborator

sergiud commented Nov 9, 2021

Nevermind. I could reproduce both problems.

@sergiud sergiud added this to the 0.6 milestone Nov 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants