Exception thrown at 0x00007FF93E507A7A (ntdll.dll) .Access violation reading location 0xFFFFFFFFFFFFFFFF

天大地大妈咪最大 提交于 2021-02-10 05:13:14

问题


I'm using POCO lib to working network. i use JSON data of POCO/JSON . my code:

User user(context.marshal_as<std::string>(tbUserName->Text),
        context.marshal_as<std::string>(tbFullName->Text),
        context.marshal_as<std::string>(tbDisplayName->Text),
        context.marshal_as<std::string>(tbEmail->Text),
        context.marshal_as<std::string>(tbPhoneNumber->Text),
        context.marshal_as<std::string>(tbNamSinh->Text),
        context.marshal_as<std::string>(tbPassword->Text),
        context.marshal_as<std::string>(tbConfirm->Text)
    );
    string jsonString = user.serialize();

I have an error Exception thrown at 0x00007FF93E507A7A (ntdll.dll) in Client_Winform.exe:

0xC0000005: Access violation reading location 0xFFFFFFFFFFFFFFFF.

If there is a handler for this exception, the program may be safely continued.


回答1:


You are using a handle which got returned as INVALID_HANDLE from some function (INVALID_HANDLE is -1 or 0xFFFFFFFFFFFFFFFF). When you try to use it, it gets used as an address and you don't have permissions to access that address (error 5 is access violation).




回答2:


Use Visual Studio's Code Analysis to track the exact place in your code where the bug is. https://msdn.microsoft.com/en-us/library/ms182028.aspx The problem with these kinds of error messages is not to understand the reason (bad handle) but to find the place. Since your code passed compilation with no errors, and in many cases, will run smoothly on several machines and crash only on one of them, you need to focus on the place of the crash.



来源:https://stackoverflow.com/questions/42780790/exception-thrown-at-0x00007ff93e507a7a-ntdll-dll-access-violation-reading-loc

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!