getml / reflect-cpp

A C++20 library for fast serialization, deserialization and validation using reflection. Supports JSON, BSON, CBOR, flexbuffers, msgpack, TOML, XML, YAML / msgpack.org[C++20]
https://getml.github.io/reflect-cpp/
MIT License
933 stars 78 forks source link

SEH exception #165

Open mJyo opened 1 month ago

mJyo commented 1 month ago

Hello,

When I run the reflect-cpp-json-tests project, the json.test_extra_fields test throws the following error:

error: SEH exception with code 0xc0000005 thrown in the test body.

Operating System: Windows 11
Platform: Visual Studio 2022 Branch: main Version: v0.13.0

Thank you!

liuzicheng1987 commented 1 month ago

Interesting. Thanks for reporting this. Could you provide the exact version number of the compiler used?

mJyo commented 1 month ago

Interesting. Thanks for reporting this. Could you provide the exact version number of the compiler used?

你好! This is my compiler version

Microsoft (R) C/C++ optimization compiler for x86 version 19.40.33812.

感谢您的回复!

liuzicheng1987 commented 1 month ago

不客氣...應該的。這個問題真的太奇怪。

我們在討論比較重要的事情時,我用英文吧,因為我希望大家都可以看的懂。如果你覺得用英文表示你的想法有一點難的話,也可以用國語,一點都沒問題。

The compiler version we are using in the test pipeline is 19.38, which is very close to yours. Is this the only test that fails? Does the test pipeline continue after that?

I will have to find a way to reproduce the problem. But it appears to be an alignment issue:

https://stackoverflow.com/questions/13157671/seh-exception-with-code-0xc0000005-thrown-in-the-test-body

Are you currently using the latest commit from the main branch? If yes, could you try if you get the same problem if you checkout v0.13.0 instead?

mJyo commented 1 month ago

不客氣...應該的。這個問題真的太奇怪。

我們在討論比較重要的事情時,我用英文吧,因為我希望大家都可以看的懂。如果你覺得用英文表示你的想法有一點難的話,也可以用國語,一點都沒問題。

The compiler version we are using in the test pipeline is 19.38, which is very close to yours. Is this the only test that fails? Does the test pipeline continue after that?

I will have to find a way to reproduce the problem. But it appears to be an alignment issue:

https://stackoverflow.com/questions/13157671/seh-exception-with-code-0xc0000005-thrown-in-the-test-body

Are you currently using the latest commit from the main branch? If yes, could you try if you get the same problem if you checkout v0.13.0 instead?

Yes, I am using the main branch, but it might not be up-to-date. My local version is as follows:

d9387e29ef1990d74ddad3fe2447af7b0303cf52 HEAD -> main, origin/main, origin/HEAD Dr. Patrick Urbanke (Liu Zicheng) on Mon Jul 22 22:40:06 2024 +0200

I might try using the latest code, thank you for your suggestion.

liuzicheng1987 commented 1 month ago

This is incredibly helpful, thank you. I thought the alignment issue might have something to do with my implementation of rfl::Tuple, but the commit was before that. So it must be something else.

I will take a closer look and let you know.

mJyo commented 1 month ago

It's quite strange. After configuring with CMake, Visual Studio should be in Release mode, but my local setup remained in Debug mode, which led to the error we discussed. When I manually switched to Debug mode in VS, everything worked normally again. 再次感谢您所为我所作耐心答复!