Access violation reading location 0xcdcdcddd.
-
Unhandled exception at 0x0044c743 in NewMumsEngine.exe:0xC0000005: Access violation reading location 0xcdcdcddd. This arises in the msgSendQueue method,when I use the semaphore class variable m_pSendLock to access the lockWait()method : m_pSendLock->lockWait(); This happens after the script has been loaded and when the message has to be sent to the queue to be stored.We need to lock to allow only one thread access at a time. Can anyone tell me how to solve this pr atleast what this sort of an error means. Arjun Mukherjee Software Engineer Hewlett Packard
-
Unhandled exception at 0x0044c743 in NewMumsEngine.exe:0xC0000005: Access violation reading location 0xcdcdcddd. This arises in the msgSendQueue method,when I use the semaphore class variable m_pSendLock to access the lockWait()method : m_pSendLock->lockWait(); This happens after the script has been loaded and when the message has to be sent to the queue to be stored.We need to lock to allow only one thread access at a time. Can anyone tell me how to solve this pr atleast what this sort of an error means. Arjun Mukherjee Software Engineer Hewlett Packard
Hi There! I think this type of error ususally come when Function pointer is not rightfully initialized or it try to use heap that out of it domainian. aj1682 wrote: m_pSendLock to access the lockWait()method : m_pSendLock->lockWait(); Have you check
m_pSendlock
is rightfully intialized,before calling ofm_pSendLock->lockWait();
"I Think this Will Help"
visit me at http://www.thisisalok.tk
-
Hi There! I think this type of error ususally come when Function pointer is not rightfully initialized or it try to use heap that out of it domainian. aj1682 wrote: m_pSendLock to access the lockWait()method : m_pSendLock->lockWait(); Have you check
m_pSendlock
is rightfully intialized,before calling ofm_pSendLock->lockWait();
"I Think this Will Help"
visit me at http://www.thisisalok.tk
Hi Alok, Thanks for the help. I checked the initialization,m_pSendLock is a semaphore class variable and this is initialised in another class. I have declared a variable of this class and included the semaphore initialization in the constructor of this class. then I have used this variable to access the function of this class where the statement m_pSendLock->lockwait(); is used. So i guess the constructor does the initialization of the semaphore class variable. But I cannot understand the function pointer not rightfully initialised,or the heap out of domain.can u please explain this to me a little and tell me how to check it or any other way. thanks, arjun. Arjun Mukherjee Software Engineer Hewlett Packard
-
Hi Alok, Thanks for the help. I checked the initialization,m_pSendLock is a semaphore class variable and this is initialised in another class. I have declared a variable of this class and included the semaphore initialization in the constructor of this class. then I have used this variable to access the function of this class where the statement m_pSendLock->lockwait(); is used. So i guess the constructor does the initialization of the semaphore class variable. But I cannot understand the function pointer not rightfully initialised,or the heap out of domain.can u please explain this to me a little and tell me how to check it or any other way. thanks, arjun. Arjun Mukherjee Software Engineer Hewlett Packard
Put a breakpoint (F9) just at the line m_pSendLock->lockwait(); and then debug your program (F5). Look at the state of the variable m_pSendLock to check if everything is correct.
-
Put a breakpoint (F9) just at the line m_pSendLock->lockwait(); and then debug your program (F5). Look at the state of the variable m_pSendLock to check if everything is correct.
Hi Cedric, Thanks for the help. I've already done all that,but how do I look at the state of the variable m_pSendLock(). Can u tell me how to do this and can u also tell me what to expect,or any examples that u can give me will be very helpful. Thanks, Arjun. Arjun Mukherjee Software Engineer Hewlett Packard
-
Hi Alok, Thanks for the help. I checked the initialization,m_pSendLock is a semaphore class variable and this is initialised in another class. I have declared a variable of this class and included the semaphore initialization in the constructor of this class. then I have used this variable to access the function of this class where the statement m_pSendLock->lockwait(); is used. So i guess the constructor does the initialization of the semaphore class variable. But I cannot understand the function pointer not rightfully initialised,or the heap out of domain.can u please explain this to me a little and tell me how to check it or any other way. thanks, arjun. Arjun Mukherjee Software Engineer Hewlett Packard
aj1682 wrote: I cannot understand the function pointer not rightfully initialised Ususally this Case arise when we Dynamically Load Function from DLL usig LoadLibrary and GetProcAddress. and Function Pointer is Not properly intialized. aj1682 wrote: the heap out of domain Simple,when function tried to acces heap or memory location which out of it access or not properly initialized.
"I Think this Will Help"
visit me at http://www.thisisalok.tk
-
Hi Cedric, Thanks for the help. I've already done all that,but how do I look at the state of the variable m_pSendLock(). Can u tell me how to do this and can u also tell me what to expect,or any examples that u can give me will be very helpful. Thanks, Arjun. Arjun Mukherjee Software Engineer Hewlett Packard
When your program is stopped on your breakpoint, right click on the variable, and click on QuickWatch. Then you will have a window that will show you the state (and value and mamber variables...) of your class. Look if it well instancied (the adress pointer must look something else than 0x000000 or 0xccccccc or 0xcdcdcdcd ...) something like a 'valid' adress (I cannot tell you what exactly is a 'valid' adress). If this is not the case, maybe your semaphore is not instancied...
-
Unhandled exception at 0x0044c743 in NewMumsEngine.exe:0xC0000005: Access violation reading location 0xcdcdcddd. This arises in the msgSendQueue method,when I use the semaphore class variable m_pSendLock to access the lockWait()method : m_pSendLock->lockWait(); This happens after the script has been loaded and when the message has to be sent to the queue to be stored.We need to lock to allow only one thread access at a time. Can anyone tell me how to solve this pr atleast what this sort of an error means. Arjun Mukherjee Software Engineer Hewlett Packard
is the debugger pointing to the line of code that calls lockWait()? Are you sure that m_pSendLock was initialized properly? Usually, that type of crash is associated with a pointer that is A) uninitialized (not set to NULL by default) and B) never set to actually point to an object. xCDCDCDDD is the kind of number that variables sometimes get set to if they were never initialized to 0 or NULL in a class constructor. Always initialize pointers to 0. In this case, obviously, you have to set the pointer to point to some valid object. Are you doing something like the below code to setup your pointer somewhere? m_pSendLock = &theSemaphoreObject; or m_pSendLock = new CSemaphore; If so, what specifically are you doing to set the pointer? Is the crash occurring when your application exits? Another kind of situation that occurs is when you have a thread that doesn't terminate before your class is destroyed (on exit). The object gets destroyed but the thread continues to execuate and then trys to call a function with an invalid pointer.
-
is the debugger pointing to the line of code that calls lockWait()? Are you sure that m_pSendLock was initialized properly? Usually, that type of crash is associated with a pointer that is A) uninitialized (not set to NULL by default) and B) never set to actually point to an object. xCDCDCDDD is the kind of number that variables sometimes get set to if they were never initialized to 0 or NULL in a class constructor. Always initialize pointers to 0. In this case, obviously, you have to set the pointer to point to some valid object. Are you doing something like the below code to setup your pointer somewhere? m_pSendLock = &theSemaphoreObject; or m_pSendLock = new CSemaphore; If so, what specifically are you doing to set the pointer? Is the crash occurring when your application exits? Another kind of situation that occurs is when you have a thread that doesn't terminate before your class is destroyed (on exit). The object gets destroyed but the thread continues to execuate and then trys to call a function with an invalid pointer.
Hi Yeah the debugger is pointing to m_pSendLock->lockwait();when it gives me the error and breaks. I checked the state of the m_pSendLock variable ,I dont think its initialised,even though I did initialize the class variable(that m_pSendLock is a prt of) to NULL,but it still din't work. The constructor contains the code m_pSendLock = new CXSemaphore(... But then I've used a previously declared and initialised pointer of the same class and then referenced m_pSendLock and all other methods,and it seems to work.I do not understand y so.Anyway, as of now I have solved the problem,even though I do not understand y and how. Thanks a lot. Arjun Mukherjee Software Engineer Hewlett Packard
-
Hi Yeah the debugger is pointing to m_pSendLock->lockwait();when it gives me the error and breaks. I checked the state of the m_pSendLock variable ,I dont think its initialised,even though I did initialize the class variable(that m_pSendLock is a prt of) to NULL,but it still din't work. The constructor contains the code m_pSendLock = new CXSemaphore(... But then I've used a previously declared and initialised pointer of the same class and then referenced m_pSendLock and all other methods,and it seems to work.I do not understand y so.Anyway, as of now I have solved the problem,even though I do not understand y and how. Thanks a lot. Arjun Mukherjee Software Engineer Hewlett Packard