Exception thrown in VS2017 due to vsprintf in stdio.h

1

I have a problem with stdio.h. Running VS 2017, v15.7, toolset 141, Community Edition, Windows 10 SDK (10.0.17134.0), trying to build an app using CMake. The project contains many carefully thought out CMakeLists, which I did not write. CMake>Build All deals handily with the 603 files on the stack, and the build succeeds.

However, it won't run. VS tells me exactly where the error is:

Unhandled exception at 0x000007FEE83BF1E7 (ucrtbased.dll) in complex_simplification.exe: 0xC0000005: Access violation reading location 0xFFFFFFFFFFFFFFFF.

The problem block in stdio.h is at line 1390:

{ int const _Result = __stdio_common_vsprintf(_CRT_INTERNAL_LOCAL_PRINTF_OPTIONS |_CRT_INTERNAL_PRINTF_LEGACY_VSPRINTF_NULL_TERMINATION, _Buffer, _BufferCount, _Format, _Locale, _ArgList); return _Result < 0 ? -1 : _Result; }

What have I done?

  1. Since I was told VS 2015 built this project into a working exe, I downloaded the toolset for 2015 (2015.3 v140) and edited the json "generator" line to use it. Still throws.
  2. I tried using the Windows Universal CRT SDK. Still throws.
  3. I cludged a header file defining _NO_CRT_STDIO_INLINE and called it from main. Still throws.
  4. I experimented with Buffsizes up to 4096. Still throws.
  5. VS Cmake mode exposes only a limited number of settings, but under Tools>Options>Project Settings>Build Customizations Search Path I entered the following path: "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.14.26428\lib\x64\legacy_stdio_definitions.lib". This changed the error, so it at least was noticed, but the exception still throws.

If one of the above lines of action actually has promise, maybe someone could mention it and I can persist in that direction.

thanks, GB

c++
cmake
visual-studio-2017
asked on Stack Overflow Jul 21, 2018 by Gary Bollenbach

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0