Boost C++ Libraries: Ticket #12914: Program using BOOST_LOG_TRIVIAL exits with code 255 https://svn.boost.org/trac10/ticket/12914 <p> OS: Windows 10 Build: x64 Debug with Static Linkage and Runtime Boost Version: 1.63.0 Compiler: MSVC 19.10.25017.0 </p> <p> 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). </p> <p> According to MSDN, exit code 255 describes the following: </p> <p> ERROR_EA_LIST_INCONSISTENT 255 (0xFF) The extended attributes are inconsistent. </p> <p> Previously, I had BOOST_LOG_TRIVIAL running fine with Visual Studio 2015 using the MSVC 14.0 toolchain. </p> <p> 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. </p> <p> 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 </p> <p> x64 Debug Log: '<a class="missing wiki">BuildDebugging</a>.exe' (Win32): Loaded 'C:\Users\itsbriany\Documents\Projects\<a class="missing wiki">CmakeDebugging</a>\build\Debug\<a class="missing wiki">BuildDebugging</a>.exe'. Symbols loaded. '<a class="missing wiki">BuildDebugging</a>.exe' (Win32): Loaded 'C:\Windows\System32\ntdll.dll'. Cannot find or open the PDB file. '<a class="missing wiki">BuildDebugging</a>.exe' (Win32): Loaded 'C:\Windows\System32\kernel32.dll'. Cannot find or open the PDB file. '<a class="missing wiki">BuildDebugging</a>.exe' (Win32): Loaded 'C:\Windows\System32\<a class="missing wiki">KernelBase</a>.dll'. Cannot find or open the PDB file. The program '<a class="changeset" href="https://svn.boost.org/trac10/changeset/19568" title="Doc update. ">[19568]</a> <a class="missing wiki">BuildDebugging</a>.exe' has exited with code 255 (0xff). </p> <p> I was wondering if anyone knows why this is happening. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/12914 Trac 1.4.3 Brian Yip <itsbriany@…> Sun, 19 Mar 2017 20:30:54 GMT attachment set https://svn.boost.org/trac10/ticket/12914 https://svn.boost.org/trac10/ticket/12914 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">main.cpp</span> </li> </ul> <p> The BOOST_LOG_TRIVIAL example </p> Ticket Andrey Semashev Sun, 19 Mar 2017 23:41:11 GMT <link>https://svn.boost.org/trac10/ticket/12914#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/12914#comment:1</guid> <description> <p> 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. </p> <p> 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? </p> </description> <category>Ticket</category> </item> <item> <author>Brian Yip <itsbriany@…></author> <pubDate>Mon, 20 Mar 2017 22:25:40 GMT</pubDate> <title>attachment set https://svn.boost.org/trac10/ticket/12914 https://svn.boost.org/trac10/ticket/12914 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">project-config.jam</span> </li> </ul> Ticket Brian Yip <itsbriany@…> Mon, 20 Mar 2017 22:27:48 GMT <link>https://svn.boost.org/trac10/ticket/12914#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/12914#comment:2</guid> <description> <p> 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). </p> <p> I don't think the Windows system exit code 255 is -1 since they seem to range from 0 to 159999. Reference: <a class="ext-link" href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms681382(v=vs.85).aspx"><span class="icon">​</span>https://msdn.microsoft.com/en-us/library/windows/desktop/ms681382(v=vs.85).aspx</a> </p> <p> 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. </p> <p> 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? </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Andrey Semashev</dc:creator> <pubDate>Sat, 25 Mar 2017 17:01:44 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/12914#comment:3 https://svn.boost.org/trac10/ticket/12914#comment:3 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">worksforme</span> </li> </ul> <p> I can't reproduce this with the current develop branch. I've compiled libs/log/example/trivial with this command line: </p> <pre class="wiki">b2 -j 8 link=static runtime-link=static threading=multi address-model=64 </pre><p> No modifications to Boost.Build, Boost.Log or its dependencies were necessary. I did not modify project-config.jam, its contents are as follows: </p> <pre class="wiki">import option ; using msvc ; option.set keep-going : false ; </pre><p> The example runs fine and the output is as expected. </p> <p> I'm using VS 2017 Community edition, cl version is 19.10.25017. I'm on Windows 8.1. </p> <p> 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. </p> Ticket anonymous Sat, 25 Mar 2017 17:07:14 GMT <link>https://svn.boost.org/trac10/ticket/12914#comment:4 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/12914#comment:4</guid> <description> <p> Hi Andy, </p> <p> 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 :) </p> </description> <category>Ticket</category> </item> </channel> </rss>