#12914 closed Bugs (worksforme)
Program using BOOST_LOG_TRIVIAL exits with code 255
Reported by: | Owned by: | Andrey Semashev | |
---|---|---|---|
Milestone: | Boost 1.64.0 | Component: | log |
Version: | Boost 1.63.0 | Severity: | Problem |
Keywords: | log BOOST_LOG_TRIVIAL exit code runtime error | Cc: |
Description
OS: Windows 10 Build: x64 Debug with Static Linkage and Runtime Boost Version: 1.63.0 Compiler: MSVC 19.10.25017.0
I am simply trying to run an example from BOOST_LOG_TRIVIAL which I have attached. The x64 Debug program compiles and links fine, but terminates immediately at runtime with code 255 (The error log is posted below).
According to MSDN, exit code 255 describes the following:
ERROR_EA_LIST_INCONSISTENT 255 (0xFF) The extended attributes are inconsistent.
Previously, I had BOOST_LOG_TRIVIAL running fine with Visual Studio 2015 using the MSVC 14.0 toolchain.
However, I recently upgraded to Visual Studio 2017 which ships with the new MSVC toolchain 14.10. I am also compiling my program with /MTd (for the debug build) and /MT (for the release build) flags for static runtime.
Boost log and its dependencies were built with the following: %BOOST_ROOT%\b2.exe -j 8 link=static runtime-link=static threading=multi address-model=64
x64 Debug Log: 'BuildDebugging.exe' (Win32): Loaded 'C:\Users\itsbriany\Documents\Projects\CmakeDebugging\build\Debug\BuildDebugging.exe'. Symbols loaded. 'BuildDebugging.exe' (Win32): Loaded 'C:\Windows\System32\ntdll.dll'. Cannot find or open the PDB file. 'BuildDebugging.exe' (Win32): Loaded 'C:\Windows\System32\kernel32.dll'. Cannot find or open the PDB file. 'BuildDebugging.exe' (Win32): Loaded 'C:\Windows\System32\KernelBase.dll'. Cannot find or open the PDB file. The program '[19568] BuildDebugging.exe' has exited with code 255 (0xff).
I was wondering if anyone knows why this is happening.
Attachments (2)
Change History (6)
by , 6 years ago
comment:1 by , 6 years ago
VS2017 is not supported in Boost 1.63. I think, it isn't even possible to compile Boost 1.63 with that compiler. The support is being worked on in 1.64.
Also, the exit code of 255 is just -1, which is likely synthesized by the runtime because of errors like a crash or an uncaught exception. Can you verify if such an error happens? If yes, can you provide a backtrace?
by , 6 years ago
Attachment: | project-config.jam added |
---|
comment:2 by , 6 years ago
I got Boost 1.63 to compile with MSVC 14.10 by cloning the development branch of boost build to build the b2.exe executable. I also got Boost 1.63 to compile with MSVC 14.10 by modifying the project-config.jam file (I attached a copy of my project-config.jam).
I don't think the Windows system exit code 255 is -1 since they seem to range from 0 to 159999. Reference: https://msdn.microsoft.com/en-us/library/windows/desktop/ms681382(v=vs.85).aspx
I'm not sure how to get a stack trace because the program won't hit any set breakpoints (not even the first line of main). It just tends to crash immediately when I use anything from boost log in my code.
From my understanding, the boost log library is only linked when I call a function or macro from it. If I don't use any code from boost log, the program works as expected. Anytime I use a symbol from boost log, the program immediately exits with code 255. I suspect this is caused by linking the boost log library?
comment:3 by , 6 years ago
Resolution: | → worksforme |
---|---|
Status: | new → closed |
I can't reproduce this with the current develop branch. I've compiled libs/log/example/trivial with this command line:
b2 -j 8 link=static runtime-link=static threading=multi address-model=64
No modifications to Boost.Build, Boost.Log or its dependencies were necessary. I did not modify project-config.jam, its contents are as follows:
import option ; using msvc ; option.set keep-going : false ;
The example runs fine and the output is as expected.
I'm using VS 2017 Community edition, cl version is 19.10.25017. I'm on Windows 8.1.
Frankly, I don't know what to suggest to debug the problem. It's probably related to your environment. Maybe VS 2017 installation is broken, or some dll is missing. Try checking that with Dependency Walker.
comment:4 by , 6 years ago
Hi Andy,
I managed to get it working today by upgrading to Boost 1.64. I am also using Cmake for my builds, which I also upgraded to the most recent version. The libraries compiled and ran as expected right out of the box with VS 2017 MSVC-14.10 on Windows 10 :)
The BOOST_LOG_TRIVIAL example