Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

json::parse(std::string) Exception inside packaged Lib #1306

Closed
brigb123 opened this issue Oct 17, 2018 · 1 comment
Closed

json::parse(std::string) Exception inside packaged Lib #1306

brigb123 opened this issue Oct 17, 2018 · 1 comment

Comments

@brigb123
Copy link

I'm using the 1 header source in a packaged static library of my own, which is linked to a large application. I tested the same json string in a small test application with no issue. The exception in the large application while debugging:

image

The members in the screenshot context look suspicious.
I'm unable to catch the exception, being an access violation.

This is the json:

{
"type": "command",
"message_id": "add_player",
"id": "d78bd9ad-9dd2-4186-9d96-7fce52c8e68c",
"timestamp": "2018-10-17T15:24:34.7584775-07:00",
"requestor_id": null,
"payload": [{
"profile_id": "5c57c8d9-76aa-4239-9cec-621be0fa89a6",
"player_name": "Player 1",
"handicap": 1,
"handedness": "right",
"avatar_id": "5c57c8d9-76aa-4239-9cec-621be0fa89a6",
"avatar_data": null,
"fsxlive_authorization_guid": ""
}]
}
I'm unsure if there are some nuances that have been seen before to cause this. It's very frustrating to debug when I have no error feedback. Again, the json::parse() steps through fine with the following main:

int main(int, char**)
{
std::string s;
s += "{\r\n";
s += "\t"type": "command",\r\n";
s += "\t"message_id": "add_player",\r\n";
s += "\t"id": "d78bd9ad-9dd2-4186-9d96-7fce52c8e68c",\r\n";
s += "\t"timestamp": "2018-10-17T15:24:34.7584775-07:00",\r\n";
s += "\t"requestor_id": null,\n";
s += "\t"payload": [ {\n";
s += "\t\t"profile_id":"5c57c8d9-76aa-4239-9cec-621be0fa89a6",\r\n";
s += "\t\t"player_name":"Player 1",\r\n";
s += "\t\t"handicap": 1,\r\n";
s += "\t\t"handedness":"right",\r\n";
s += "\t\t"avatar_id":"5c57c8d9-76aa-4239-9cec-621be0fa89a6",\r\n";
s += "\t\t"avatar_data": null,\r\n";
s += "\t\t"fsxlive_authorization_guid":""\r\n";
s += "\t} ] \r\n";
s += "}";
auto j = json::parse(s);
FSS::CciMessage c = j;
return 0;
}

@brigb123
Copy link
Author

Different versions of the header were linked and causing library clashes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant