access-violation

change a pointer of address of another application

自古美人都是妖i 提交于 2020-01-11 12:23:54
问题 I need somebody to edit the title, I can't find better title. Assume a have this simple program called source.exe : #include <stdio.h> int main() { int a = 5; printf("%p", &a); return 0; } I want to write another application, change.exe , that changes a in the above. I tried something like this: int main() { int * p = (int*) xxx; // xxx is what have printed above *p = 1; printf("%d", *p); return 0; } It doesn't work. assuming I have Administrator rights, is there a way to do what I've tried

Calling V8 function causes access violation

本小妞迷上赌 提交于 2020-01-05 10:18:52
问题 I have a global event manager, allowing you to listen with lambdas to string event names. // somewhere in the ModuleScript class Event->Listen("WindowResize", [=]{ // ... }); Now, I want to register to events from JavaScript, too. Therefore, I wrote this callback. v8::Handle<v8::Value> ModuleScript::jsOn(const v8::Arguments& args) { // get pointer to class since we're in a static method ModuleScript *module = (ModuleScript*)HelperScript::Unwrap(args.Data()); // get event name we want to

Strange memory overwrite problem in instance of my class

99封情书 提交于 2020-01-04 06:20:21
问题 This problem is related to this question, which I've asked earlier. The code provided by @RRUZ is working but it seems that not quite correctly or I am doing something wrong. After executing GetSharedFiles strange thing is happening in instance of TMyObject . The field FMyEvent which was (and it should be) nil points to some random data. What I've discovered just 5 minutes ago is that if I turn off the optimization in compiler options it works fine after rebuild. So maybe this is some

Access violation when running native C++ application that uses a /clr built DLL

独自空忆成欢 提交于 2020-01-04 05:09:51
问题 I'm reorganzing a legacy mixed (managed and unmanaged DLLs) application so that the main application segment is unmanaged MFC and that will call a C++ DLL compiled with /clr flag that will bridge the communication between the managed (C# DLLs) and unmanaged code. Unfortuantely, my changed have resulted in an Access violation that occurs before the application InitInstance() is called. This makes it very difficult to debug. The only information I get is the following stack trace. > 64006108()

Access violation when using pin_ptr?

拈花ヽ惹草 提交于 2020-01-02 07:23:28
问题 When I use pin_ptr to pass an array in native c code, I get access violation. The code is as bellow: array<float>^ LogLikelihoodScore(array<array<unsigned char>^>^ modelsBuffer , array<float>^ featuresArray, int numberOfFrames) { int i, j, modelsNum = modelsBuffer->Length, len; float **models = (float**) malloc(modelsNum * sizeof(void*)); for(i = 0; i < modelsNum; i++) { pin_ptr<unsigned char> ptr = &modelsBuffer[i][0]; models[i] = (float*) ptr; } array<float>^ scores = gcnew array<float>

Sql Compact randomly produces AccessViolationException

一曲冷凌霜 提交于 2020-01-01 11:12:14
问题 I am running Sql Server Compact Edition 3.5.1.0 SP1 in a multi-thread application. The application randomly runs insert queries in transactions. With short transactions, it works fine. But when the transactions get longer and delay between executions get shorter or when I run the application in debug mode, SqlCE begins to throw the following exception randomly: AccessViolationException Attempted to read or write protected memory. This is often an indication that other memory is corrupt. at

Sql Compact randomly produces AccessViolationException

允我心安 提交于 2020-01-01 11:10:10
问题 I am running Sql Server Compact Edition 3.5.1.0 SP1 in a multi-thread application. The application randomly runs insert queries in transactions. With short transactions, it works fine. But when the transactions get longer and delay between executions get shorter or when I run the application in debug mode, SqlCE begins to throw the following exception randomly: AccessViolationException Attempted to read or write protected memory. This is often an indication that other memory is corrupt. at

_DebugHeapDelete Access Violation at termination

烈酒焚心 提交于 2019-12-31 02:34:14
问题 I'm getting a weird access violation at the end of my main whose cause I'm having some difficulties finding. When shutting down my application I get an access violation in the following: xdebug // TEMPLATE FUNCTION _DebugHeapDelete template<class _Ty> void __CLRCALL_OR_CDECL _DebugHeapDelete(_Ty *_Ptr) { // delete from the debug CRT heap even if operator delete exists if (_Ptr != 0) { // worth deleting _Ptr->~_Ty(); // delete as _NORMAL_BLOCK, not _CRT_BLOCK, since we might have // facets

Delphi: TImage.Create causes Access violation

。_饼干妹妹 提交于 2019-12-31 00:58:11
问题 I apologize in advance for a newbie question, but why do I get "Access violation" error with the code below (on the "Create(SelectorForm);" line)? I tried using the main form as the owner, but it didn't make any difference. var SelectorForm: TSelectorForm; ArrayOfImages: Array [1..10] of TImage; implementation procedure TSelectorForm.FormCreate(Sender: TObject); var Loop: Byte; begin for Loop := 1 to 10 do begin with ArrayOfImages[Loop] do begin Create(SelectorForm); end; end; end; 回答1: The

How can I handle an access violation in Visual Studio C++?

蓝咒 提交于 2019-12-30 07:27:28
问题 Usually an access violation terminates the program and I cannot catch a Win32 exception using try and catch . Is there a way I can keep my program running, even in case of an access violation? Preferably I would like to handle the exception and show to the user an access violation occurred. EDIT: I want my program to be really robust, even against programming errors. The thing I really want to avoid is a program termination even at the cost of some corrupted state. 回答1: In Windows, this is