how to find the stack memory violation??? Urgent

hi pals,

While running my win 32 console application, Global variable becomes NULL at 
some times, which was already allocated. My application got affected by some 
memory violation it seems or any other reason for getting such violation..
How to find the stack memory violation? I need your help.

Forgive me if this is not a relevant group, please give me appropriate news 
group for this query.


@ Shahul. 


0
shahul (6)
3/29/2006 12:00:48 PM
vc.mfc 33608 articles. 0 followers. Follow

4 Replies
227 Views

Similar Articles

[PageSpeed] 50

If the variable is global, then there is no stack involved to store it's 
content. If you have multiple threads that're accessing your variable then 
you should pay attention to syncronizing access to it. Another advice is to 
set breakpoint to variable.

-- 
Vladimir
http://spaces.msn.com/vladimir-scherbina/

"shahul" <shahul@chellasoft.com> wrote in message 
news:%23fBklhyUGHA.1688@TK2MSFTNGP11.phx.gbl...
> hi pals,
>
> While running my win 32 console application, Global variable becomes NULL 
> at some times, which was already allocated. My application got affected by 
> some memory violation it seems or any other reason for getting such 
> violation..
> How to find the stack memory violation? I need your help.
>
> Forgive me if this is not a relevant group, please give me appropriate 
> news group for this query.
>
>
> @ Shahul.
> 


0
3/29/2006 12:11:00 PM
dear Vladmir,

Actually my application is not multithreaded.
I have verfied the heap memory violation using _heapchk(), it says that 
there is no heap violation.
Inadvertently, that Global variable becomes NULL, which was dynamically 
allocated earlier.
I have doubt abt the frame allocated variables , in which the some data may 
be asssigned out of bound.

@ Shahul.


"Scherbina Vladimir" <vladimir.scherbina@XgmailY.comZ> wrote in message 
news:OKvo4lyUGHA.5172@TK2MSFTNGP12.phx.gbl...
> If the variable is global, then there is no stack involved to store it's 
> content. If you have multiple threads that're accessing your variable then 
> you should pay attention to syncronizing access to it. Another advice is 
> to set breakpoint to variable.
>
> -- 
> Vladimir
> http://spaces.msn.com/vladimir-scherbina/
>
> "shahul" <shahul@chellasoft.com> wrote in message 
> news:%23fBklhyUGHA.1688@TK2MSFTNGP11.phx.gbl...
>> hi pals,
>>
>> While running my win 32 console application, Global variable becomes NULL 
>> at some times, which was already allocated. My application got affected 
>> by some memory violation it seems or any other reason for getting such 
>> violation..
>> How to find the stack memory violation? I need your help.
>>
>> Forgive me if this is not a relevant group, please give me appropriate 
>> news group for this query.
>>
>>
>> @ Shahul.
>>
>
> 


0
shahul (6)
3/29/2006 12:35:23 PM
Hm, let's check that on the "lower" layer - set a "data" breakpoint - when 
you debug application choose "Debug->New Breakpoint->New Data Breakpoint..." 
and type address of your variable and check who is rewriting that address 
....

-- 
Vladimir
http://spaces.msn.com/vladimir-scherbina/


0
3/29/2006 12:52:46 PM
In addition to what Scherbina recommened, I'd take a look at variables that 
are declared around the one in question and see if you have any arrays going 
out of bounds or data that is too small for its contents.

Tom

"shahul" <shahul@chellasoft.com> wrote in message 
news:%23fBklhyUGHA.1688@TK2MSFTNGP11.phx.gbl...
> hi pals,
>
> While running my win 32 console application, Global variable becomes NULL 
> at some times, which was already allocated. My application got affected by 
> some memory violation it seems or any other reason for getting such 
> violation..
> How to find the stack memory violation? I need your help.
>
> Forgive me if this is not a relevant group, please give me appropriate 
> news group for this query.
>
>
> @ Shahul.
> 


0
tserface (3861)
3/29/2006 5:39:44 PM
Reply:

Similar Artilces:

Can't find the Investments to watch account
I have Money 2004 deluxe. It has been updated from 2003, 2002,... 1998 Can any one tell me why I can't see the "Investments to Watch" account. I follow steps from the money, but I just can't see it. I have some junks in the investment list, I really like to them to be removed. Thanks. Jaimie Hard to say why you can't see it. There isn't one? It's been renamed? What account(s) is (are) the junk investments in? (Go to the Portfolio page, set the View to Standard View by Account Name.) An Investments to Watch account is just an investment account with the W...

Finding a string/using adjacent data question
It's a convuluted question that I hope has an easy answer. I'm rather new to Excel formulas, so I've been trying to find stuff about this on the internet but with not much luck. If anyone can help me at all I would greatly appreciate it. I have text strings in column A, A2-A335. I have numerical values that correspond to each text string in columns B-O. What I'm hoping to do is run a search for a given text string in column A and then use the numerical values in D, H, and O for further calculations. I want to be able to type in a name in column Q (for example) and have the f...

How do I set up a chart in Excel with lines and stacked bars?
I am trying to set up a chart that will have stacked bars overlayed with a line graph. Is this possible to do? First make the chart as a stacked columns chart. IN the chart, right click on the data series to be a line; select Chart Type and specify Line best wishes -- Bernard V Liengme www.stfx.ca/people/bliengme remove caps from email "Jan" <Jan@discussions.microsoft.com> wrote in message news:5C804371-9474-4521-ADD8-9767CA21D529@microsoft.com... >I am trying to set up a chart that will have stacked bars overlayed with a > line graph. Is this possible to do? ...

App: excel.exe (pid=1612) Exception number: c0000005 (access violation)
Can anyone tell me why or how to correct the error I am consistentl getting (see below) Application exception occurred: App: excel.exe (pid=1612) When: 12/18/2003 @ 08:44:24.656 Exception number: c0000005 (access violation) I have rebooted, removed/reinstalled MSOFFICE 2000 and I am stil getting this error. You can see the error that Dr.Watson reported b viewing the attachment. Please email me at JJOHNSON@SALLIEMAE.COM i you can assist. THANKS Attachment filename: application exception occurred.txt Download attachment: http://www.excelforum.com/attachment.php?postid=38578 -- Messa...

How do I make a stacked column chart with side-by-side comparison.
Looking at making a stacked column chart. But I want it to look like a clustered column, able to compare 2 items next to each other. Any thoughts? Take a look at Jon Peltier's site. He has lots of examples of different chart types. I'll start you out on the page you might want to look at. http://www.peltiertech.com/Excel/Charts/ComboCharts.html "Tim" wrote: > Looking at making a stacked column chart. But I want it to look like a > clustered column, able to compare 2 items next to each other. Any thoughts? Here's a page with links to clustered-stacke...

What is the difference in Find and Look For ?
I don't understand - sometimes I get different results. They are the same. Advanced Find allows you to use additional criteria. -- Diane Poremsky [MVP - Outlook] Author, Teach Yourself Outlook 2003 in 24 Hours Need Help with Common Tasks? http://www.outlook-tips.net/beginner/ Outlook 2007: http://www.slipstick.com/outlook/ol2007/ Outlook Tips by email: dailytips-subscribe-request@lists.outlooktips.net Outlook Tips: http://www.outlook-tips.net/ Outlook & Exchange Solutions Center: http://www.slipstick.com Subscribe to Exchange Messaging Outlook newsletter: EMO-NEWSLETTER-SUBSCRIBE-...

'Define Views...' option not available in Advanced Find screen in Outlook 2000
The 'Define Views...' option in the View menu not available in Advanced Find screen in Outlook 2000. We are looking for a way to set a default view in the advanced find screen or a way to edit the messages view to make it include the To field. We have users that want to see the TO field without having to click View and then the 'Send To' view. I have tried customizing the view but each time I exit it resets the view. I have also modified my 'Messages' view but it was done at the main screen and doesn't seem to phase the one in the advanced find. I also tri...

Cannot find mfcs42d.pdb for C++ 6.0 on Windows XP at runtime
I'm getting Find Symbols pop-up window while running C++ 6.0 saying "Please enter the path for mfcs42d.pdb". After I specify the file location at VC98\MFC\Lib (1,092 KB from 7/15/2000), I'm getting a note that the file is found but is not the correct one. I didn't have this problem working on Windows NT. Now I'm trying to run the recompiled version of the same code on Windows XP. Service pack 5 is installed. Please advise what to do. Thanks. ...

Find/Found
Can not get Found to respond. Object: Get PersonName in Sheet2, Go to Sheet1, Find PersonName. If Found put PersonName & address into Sheet2 Else put PersonName in Sheet3. Sheet2 has no address. Sheet1 has most, but not all names that are in Sheet2 Tried: Set Found = Nothing Set Found = Cells.Find(PersonName) .. Cells.Find(What:=PersonName..... If Found Nothing Then .. Thanks again for all your help, Gordon Cells.Find("PersonName") -- Don Guillett Microsoft MVP Excel SalesAid Software dguillett1@austin.rr.com "Gordon" <gwelch1938@yahoo.com> wrote in message ...

Advanced Find Only Works Once
WinXP, Office 2000-sp3 Problem just started. In Outlook, can only do an Advance Find one time, then it doesn't work. Have done repair to no avail. Thoughts? thanks! Went to Office Download site and got Outlook 2000 Update: December 18, 2002. While it is stated it is to repair problems with reminders, it also fixed this problem. "Frank" <user@aol.com> wrote in message news:uxU4G5G1DHA.3468@TK2MSFTNGP11.phx.gbl... > WinXP, Office 2000-sp3 > > Problem just started. In Outlook, can only do an Advance Find one time, > then it doesn't work. Have done re...

AfxBeginThread failure
In an MFC pgm under VS2005sp1, I am creating a worker thread using AfxBeginThread. Under certain circumstances which I can't quite pin down, AfxBeginThread returns NULL, indicating it has failed. Is there any way I can find out the cause of the failure, such as an error code? I have tried tracing through the code with the debugger, but what is apparently detecting the error condition is in MS code for which I don't have the source. My specific code is CWinThread* pThread=AfxBeginThread(MyControlFunction,&ti,0/*priority*/, 230000000/*stack size*/); and a test for pThread==NULL im...

Memory leakage !!
I have placed MS comm control on Test dialog, While initiate the dialog it is occupying around 2MB space, I am unable to free this space. I am giving the snippets of the code. MSComm m_ctlComm; m_ctlComm.SetCommPort(1); m_ctlComm.SetInBufferSize(1024); m_ctlComm.SetOutBufferSize(512); m_ctlComm.SetSettings("9600,n,8,1"); m_ctlComm.SetInputMode(1);//0 - Text and 1 - Binary. m_ctlComm.SetRThreshold(0);// To Raise OnCommEvent() method. m_ctlComm.SetSThreshold(0); try { m_ctlComm.SetPortOpen(TRUE); } catch(CException* e) { AfxMessageBox("Port is already open. ",M...

Preventing memory and resource leaks with GDI Objects ???
I am have built a general purpose bitmap/image handling class and want to add TextOut() capability to this class. To do this I must convert some of my GDI local function variables into GDI object member variables. This means that I must be able to re-use several GDI objects, instead of constructing them and destroying them after a single use. What issues are raised with resource and memory leaks by using CDC and CBitmap objects? How are these issues mitigated? You will have to manage the resources somehow and someplace, but I don't think it matters how or where. ...

How do I find the sum of all digits in a number?
How do I get Excel to return the sum of all digits in a number? For example if i have the number 1234, i want excel to do the following calculation: 1+2+3+4 and return the value 10. I need to know how to do this for any number of any size. On Fri, 9 Sep 2005 08:21:04 -0700, monkeyforce5 <monkeyforce5@discussions.microsoft.com> wrote: >How do I get Excel to return the sum of all digits in a number? >For example if i have the number 1234, i want excel to do the following >calculation: >1+2+3+4 and return the value 10. I need to know how to do this for any >number of an...

Find #3
Hi I think this is a mid find function but can't quite work it out. I have a list of names eg John Smith in a cell I want to list the surnames only. Hope you can help Thanks Shona Hi It is a mid function - you're right! Try: =MID(A1,FIND(" ",A1)+1,99) -- Andy. "Shona" <Student.13@uk.bosch.com> wrote in message news:c5o5ko$c8l$1@ns1.fe.internet.bosch.com... > Hi > > I think this is a mid find function but can't quite work it out. > > I have a list of names eg John Smith in a cell I want to list the surnames > only. > > Ho...

reference memory error when printing excel file
When I try to print any kind of excel file I am getting an error message ststing 0x77f853b reference memory error 0x001de4b8 memory could not be read.. This is new to me, I have used excell for a long time and haven't run into this problem until now.... Can anyone shed some light on why this might be happening?...... I am running XP and Excel 2000 ...

how to find the sum of certain values in a column.
I want to be able to find the sum of all values in a column that have a particular value in the previous column, sush as follows. A B 1 TYPE VALUE 2 a 10 3 b 10 4 a 10 5 c 10 6 b 10 7 a 10 8 c 10 9 b 10 10 c 10 11 a 10 12 TOTAL 100 I'm able to total the column fine but what I want is the following: A) I want is a formula that will total only those VALUES that are TYPE "a" so that I c...

How can I find automatic links in an Excel-sheet?
I have an Excel-sheet with "automatic links" to other workbooks. At least according to Excel, so every time when I open the document I have to click 'No' to the questions whether I want to update these. The problem is I can not find this/these automatic link/s. Is there a way to find all automatic links so that I can delete them? Tobias wrote: > I have an Excel-sheet with "automatic links" to other workbooks. At > least according to Excel, so every time when I open the document I > have to click 'No' to the questions whether I want to update th...

'Find' doesn't find anything
I'm using Outlook with my office's exchange server. I've been a happy user of the 'search folder' feature (mainly the 'for follow-up' search folder), but this suddenly seized to work. After some experimenting I discovered that the underlying problem is the failure of 'Find' to find anything. Any search I perform simply doesn't find anything. I'm using Outlook on a remote desktop infrastructure, just like all my colleagues. I asked a few of them if they had any problems with this, and they apparently hadn't. Since I'm sharing this rem...

Outlook 2003 SP2
This is a multi-part message in MIME format. ------=_NextPart_000_0033_01C6D9CB.B2DD3DB0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Folders are valid and can be selected from the browse list when setting up Outlook Today. However when I select the link to the folder (like the inbox for example) while in the Outlook Today screen, I get the Unable to find the folder message. Microsoft KB is not helpful for this problem - it only references an issue with O97 and hotmail folders. ------=_NextPart_000_0033_01C6D9CB.B2DD3DB0 Content-Type: text/...

Outlook 2002 Crash on "Big Memory" System
This is a multi-part message in MIME format. ------=_NextPart_000_0008_01C44FD9.D8DDF960 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable I've run Outlook 2002 since it came out, but recently encountered an = exasperaing problem when I installed it on my new system (Abit IC7-MAX3 = motherboard, P4-3.0, 1 GB RAM) which has two users (both = administrators). If one user runs Outlook, then when the second user runs it, it crashes = with the error message labelled, "Microsoft Visual C++ Runtime Library", = and stating, "Run...

How do I find the Email "Send" button in Outlook 2007?
I have tried to follow the Outlook 2003 - Outlook 2007 trail instructions and there is no "Send" button. How do I find it? Thanks "Tuner" <Tuner@discussions.microsoft.com> wrote in message news:915D7380-730E-4F7D-B565-8241260A0DAF@microsoft.com... >I have tried to follow the Outlook 2003 - Outlook 2007 trail instructions >and > there is no "Send" button. How do I find it? > > Thanks Have you set up a mail account? And what version do you have? ...

CArray Memory Leak
Hi, i'm using a CArray<CString,CString> to store some information i get from the registry. Find my code below. Using this code I always get a memory leak at the line marked below. If I add members to the Array in the Archive function, the memory leak is not detected, only if i pass it to the subfunction and add elements there. I found the line using _CrtSetBreakAlloc(62);. BOOL CAdExArchApp::Archive() { _CrtSetBreakAlloc(62); CArray<CString,CString> pathArray; BOOL rc = getStartFolder(pathArray); pathArray.RemoveAll(); return rc; } BOOL CAdExArchApp::getStartFolde...

Windows cannnot find....error
Some strange behavior has crept into my Excel. I'm using WinXP and Excel 2002. When I click on an Excel icon (normally in Windows Explorer) Excel will open, and the desired spreadsheet will appear. But I immediately get the "Windows cannot find 'C:.....xls' error message. Yes, I get the message that it can't find the file when in fact that file is opened and visible. If I click on another .xls file in Explorer, a 2nd copy of Excel will open, the desired file will appear, and I'll get the same "Windows cannot find..." error. Normally you would expect to see ...

finding addresses
I have tried for several hours and failed. I want, say, A1 to contain 1. I want A2 to self generate its value as the cell above +1 etc. etc. but of course NOT using A1+1 because... ...if I delete one of the numbers in the sequence, I want that cell to become blank and all the remaining cells below to regenerate their numbers to remain sequential regardless of the blank or several blanks. One further limit is that if the renumbering hits a red cell (or several) then it misses them and continues below. I have tried Address(), row(), column() etc in various combinations to no avail. I would ...