Skip to content

Unhandled exception in test-cbor.exe Stack overflow when debugging project with Visual Studio 2019 16.7.7 compiled with c++17 or c++latest #2598

Closed
@Andreas-Schniertshauer

Description

@Andreas-Schniertshauer

In the file json.hpp in handle_value(Value&& v) an

Unhandled exception at 0x00007FF6D51C2CB8 in test-cbor.exe: 0xC00000FD: Stack overflow (parameters: 0x0000000000000001, 0x0000004760A69FF8).

is thrown when debugging the test-cbor project in Visual Studio 2019 16.7.7 compiled with /std:c++17 or with /c++latest

This occures, because of recursive function calls: from_cbor, sax_parse, parse_cbor_internal, get_cbor_object, parse_cbor_internal, ...

Please describe the steps to reproduce the issue.

  1. unzip json-3.9.1.zip
  2. shell cd json-3.9.1
  3. mkdir build
  4. cd build
  5. cmake .. -DJSON_BuildTests=On -D JSON_Install:BOOL=OFF -D JSON_ImplicitConversions:BOOL=OFF -DCMAKE_CXX_FLAGS="/std:c++17"
  6. In test\download_test_data.vcxproj replace all cpp test -d json_test_data || with cpp if not exist json_test_data
  7. Open nlohmann_json.sln in Visual Studio 2019 16.7.7
  8. Right click test-cbor and select "Set as Startup Project" in the context menu
  9. Switch configuration to Debug
  10. Execute Build\Build solution (F7)
  11. Execute Debug\Start Debugging (F5)

What is the expected behavior?

No stack overflow

And what is the actual behavior instead?

Stack overflow

Which compiler and operating system are you using?

  • Compiler: Visual Studio 2019 16.7.7 Prof.
  • Operating system: Windows 10 2004 Pro

Which version of the library did you use?

  • latest release version 3.9.1 (zip file)

Metadata

Metadata

Assignees

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions