Problem with vectors

Hi,
I am getting some strange error while using vectors in my application. The push_back() throws Unhandelled memory access error when the input files are larger in size (typically around 5MB+) However, this doen't seem to be a problem for files smaller than 5MB in size.
I am processing the file record-by-record, so the vectors are declared anew for each record. Also the maximum no. of elements getting pushed onto the vectors has never exceeded 6000 and I guess that's well within the limit of the max elements that can be pushed onto the vector.
I could resize() the vector before push_back() in order to physically allocate the memory before use. But that would defeat the purpose of making the application memory efficient. 

Here is the actual error message: 
             Unhandelled Exception (NTDLL.dll): <memory address>:Access Violation

It's likely that I might have overlooked certain issues. Am I missing something? I'll greatly appreciate any help.


Thank you.
Sonali.
0
anonymous (74722)
2/3/2004 7:01:10 AM
vc.mfc 33608 articles. 0 followers. Follow

3 Replies
712 Views

Similar Articles

[PageSpeed] 38

The error as you show will maybe occur if you use vector in multi-thread
program without protection mechanism.

"Sonali" <anonymous@discussions.microsoft.com> д���ʼ�
news:DC1A319D-AC82-483D-97B5-D7D9102C3433@microsoft.com...
> Hi,
> I am getting some strange error while using vectors in my application. The
push_back() throws Unhandelled memory access error when the input files are
larger in size (typically around 5MB+) However, this doen't seem to be a
problem for files smaller than 5MB in size.
> I am processing the file record-by-record, so the vectors are declared
anew for each record. Also the maximum no. of elements getting pushed onto
the vectors has never exceeded 6000 and I guess that's well within the limit
of the max elements that can be pushed onto the vector.
> I could resize() the vector before push_back() in order to physically
allocate the memory before use. But that would defeat the purpose of making
the application memory efficient.
>
> Here is the actual error message:
>              Unhandelled Exception (NTDLL.dll): <memory address>:Access
Violation
>
> It's likely that I might have overlooked certain issues. Am I missing
something? I'll greatly appreciate any help.
>
>
> Thank you.
> Sonali.


0
billgates1 (55)
2/3/2004 7:50:30 AM
Hi
I doubt whether it's a problem related to multi-threading, since entire processing is done in a single application thread. I have one more question, what is a "First-chance exception"?
The debugger exited with teh following error message:
        First-chance exception in AND_DC.exe: 0xC0000005: Access Violation
       The program  <...> has exited with code 0 (0x0)
 --

Thank you
Sonali

    
     ----- Bill Gates wrote: ----
    
     The error as you show will maybe occur if you use vector in multi-threa
     program without protection mechanism
    
     "Sonali" <anonymous@discussions.microsoft.com> дÈëÓʼ�
     news:DC1A319D-AC82-483D-97B5-D7D9102C3433@microsoft.com..
     > Hi
     > I am getting some strange error while using vectors in my application. Th
     push_back() throws Unhandelled memory access error when the input files ar
     larger in size (typically around 5MB+) However, this doen't seem to be 
     problem for files smaller than 5MB in size
     > I am processing the file record-by-record, so the vectors are declare
     anew for each record. Also the maximum no. of elements getting pushed ont
     the vectors has never exceeded 6000 and I guess that's well within the limi
     of the max elements that can be pushed onto the vector
     > I could resize() the vector before push_back() in order to physicall
     allocate the memory before use. But that would defeat the purpose of makin
     the application memory efficient
     >> Here is the actual error message
     >              Unhandelled Exception (NTDLL.dll): <memory address>:Acces
     Violatio
     >> It's likely that I might have overlooked certain issues. Am I missin
     something? I'll greatly appreciate any help
     >>> Thank you
     > Sonali
    
    
     
0
anonymous (74722)
2/3/2004 9:56:10 AM
"Sonali" <anonymous@discussions.microsoft.com> wrote in message
news:A49B064E-EA90-43FB-A32B-D1B856343627@microsoft.com...
> Hi,
> I doubt whether it's a problem related to multi-threading, since entire
processing is done in a single application thread. I have one more question,
what is a "First-chance exception"??
> The debugger exited with teh following error message:-
>         First-chance exception in AND_DC.exe: 0xC0000005: Access
Violation.
>        The program  <...> has exited with code 0 (0x0).
>  ---
>
> Thank you,
> Sonali.

It's memory access fault. I think you get it when you write over some memory
you haven't allocated or use a null pointer.
Make sure you are allocating enough memory for each of those 5 MB records.


0
hb1 (44)
2/3/2004 6:28:55 PM
Reply:

Similar Artilces:

Read/Write access problem with a file on Win2000 Server from Win2000 Workstation
Hi, I have a Win2000 Server with a document file created by an MFC MDI application. This file can be edited by a client on a WinXP Pro machine, but when that same user logs in from a Win2000 client he gets an "Access to \\server\share\file.mnt was denied" message. The user belongs to a user group which has all access except "Take Ownership" and "Change Permissions". The Win2000 client can create a new file, but is unable to modify an existing file. Any idea why there is a difference when the same user is using a Win2000 client rather than a Win XP client? How...

number/bullet list style scheme problem from Word 2003 to Word 200
I have a Word 2003 template with build-in and customized styles included paragraph, character, linked style, list/outline style and some macros. The template works well in 2003 to create a document with all the customized styles shown. However, when the template opens in Word 2007, (right click on the .dot file), I have one pop up message that Word detects errors in the file and able to repair with a list of numbered styles. However, I lost my entire customized numbered and bullets list scheme. In 2007, when I use my mouse hover the style pane on these specific numbered or bul...

AutoArchive problem
Hi, I have Outlook 2003/Exchange2003, and I try to set up my autoarchive, andI found the following: if I set up at Tools/Options/Other/AutoArchive/Clean out items more than 1 months, than it is working. It moves everything what is older than one month to the Archive folder. However if I increase the timespan to anything bigger han one month, it is not doing anything, But I want to archive only the one year old stuff! What am I doing wrong? Where should I specify longer date? Thanks: Peter Check the Last Modified date on the items that aren't being archived as you think they should. ...

Problem with autoplay
Hi, I am running Windows XP SP3 Home Edition which is fully patched. Lately, I have discovered that when I put a DVD/CD in either a DVD burner or DVD ROM, I see the "Safely Remove Hardware" message in the sys tray. When I try to run task manager it gives me only a blank dialog box. I cannot start any of my applications ( same problem, blank dialog boxes). Rebooting the system clears up the problem but I can't insert any DVD or CD without the problem reoccuring. Is Autoplay corrupted? Any help would be greatly appreciated. Thanks, -Rich > I am runn...

IE-8 problem
I am using windows xp with sp-2. after installing IE-8 fom microsoft update center my computer freezes and i cant access anything. I have dsl from at&t. Report problems and check for solutions automatically <http://windowshelp.microsoft.com/Windows/en-US/Help/fba7e7c3-2aec-46e4-9a32-968aa620f35b1033.mspx> I don't know if this can in some way apply in your case, Doesn't hurt to try the link <http://support.microsoft.com/default.aspx/gp/pc_ie_v8intro> Note: for future consultations related to Internet Explorer, visit the specific group for IE (IE6, I...

Problem After Migrating Windows 2003 to a New Hardware
Hi all , I recently migrated a windows 2003 server to a new hardware. I posted a question here: http://www.microsoft.com/communities/newsgroups/en-us/default.aspx?dg=microsoft.public.windows.server.general&tid=64d45104-7516-444e-bc45-34051c9d0976&mid=8d43f772-67e0-4b43-b697-07cabb4a8514&cat=en_US_9741c575-ec92-42f8-85ba-00dfe1483cf5&lang=en&cr=US&sloc=&p=5 The migration went fine. This is an HP DL 380 G4. Until last week we found that the disk I/O is very bad on a RAID5. The server has the OS on a RAID1 on the on-board 6i card and the data on a RAI...

Problem with refunds
One or two times a week, when doing a refund to a credit card, after you tender the refund, the POS will suddenly quit. After checking the batch, the transaction is in there, but if you look in the journal, the receipt is blank with nothing on it. Any ideas? Can you see a credit card number associated with the refund under the SO Manager> Reports> Miscellaneous> Electronic Draft Capture Detailed, then generate for the data specified (when you know you saw this happen) and see if anything is listed for a cc number in the report. Additionally, are you guys running some kind...

Problem Opening Excel 2000 SP3
Logged on as specific user and cannot get Excel to open. Get the message: The instruction at '<address>' referenced memory at '<address>'. The memory could not be read. Click OK to terminate the program. When I log in as another user, specifically the administrator on the network,excel opens. Need some help fast. thanks ...

Exchange 2003 to Exchange 2003 migration problem
Hi! We had deployed Exchnage 2003 organization (ExchOrg_A) on a Windows 2003 forest (Domain_A). Because of business reasons, we deployed another new Windows 2003 forest (Domain_B) and also new Exchange 2003 organization (ExchOrg_B). - We created new accounts and new mailboxes on Domain_B / ExchOrg_B. - We backed up all mailboxes on ExchOrg_A (with Bakbone Netvault). - Then we restored the mailboxes (with Bakbone Netvault) to the new Exchange Server (ExchOrg_B). It worked all well, except one thing: Users had got meeting records (calendar items) on the old system (ExchOrg_A). These item...

CRM 1.2
Hi For testing purposes i have tried to create a simple Workflow rule (manual) with only a posturl action. I have tried it for different objects and with or without parameters. The result is the following error: MSCRM Platform Error Report -------------------------------------------------------------------------------------------------------- Error: <description>Error in action posturl.</description><details>Failed to connect the url http://sthutvsrv1:8082</details><file>d:\crm\core\src\platform\workflow\service\processengine.inl</file><line>5280&...

CImageList Problem is Baffling Me
Hi guys, Is there any reason why this doesn't work, it's baffling me: // set up a memory DC CDC memDC; CBitmap bitmap; CDC* pDC=GetDC(); memDC.CreateCompatibleDC(pDC); bitmap.CreateCompatibleBitmap(pDC,32,32); CBitmap* pOldBitmap=memDC.SelectObject(&bitmap); // draw some stuff on the bitmap memDC.FillSolidRect(0,0,32,32,RGB(255,192,160)); memDC.FillSolidRect(4,4,24,24,RGB(192,128,160)); // test to see if it works so far pDC->BitBlt(10,10,32,32,&memDC,0,0,SRCCOPY); // it looks good // create my imagelist CImageList imageList; imageList.Create(32,32,ILC_COLOR32,1,1); in...

CRM 1.2 Installation Problems
Hi, I have just installed crm server 1.2 on a windows 2000 server box with sp4 and sql 2000 sp3a. This is a member server of an active directory domain. The domain controllers are running windows 2003 and one of them is running exchange 2003. The crm server install works ok, and i can browse to the server via internet explorer ok, and also open up the deployment manager without any errors. my problem occurs when i go to install either the exchange email router or the sales for outlook cd. It keeps telling me it cannot find the crm server. I have tried using the ip address and tried...

Problem with Excel printing
I am using a HP LaserJet 1200 series printer with Winoow XP Pro no SP2. It has the default printer driver. I am using Parallel connection. I am using A4 paper. My problem is as follows, Sent to printer - Resolution not supported What can be wrong? "clueless" wrote: > I am using a HP LaserJet 1200 series printer with Winoow XP Pro no SP2. It > has the default printer driver. I am using Parallel connection. I am using A4 > paper. > > My problem is as follows, > > Sent to printer - Resolution not supported > > What can be wrong? > ...

class problem
He, I wrote the following code under //attributes: protected: BOOL m_bAdding; m_bAdding = FALSE; when I'm compiling it. It give me this error: C:\Documents and Settings\wouter\Mijn documenten\Rocket Administration\Rocket AdministrationView.h(32) : error C2501: 'm_bAdding' : missing storage-class or type specifiers Rocket AdministrationView.cpp C:\Documents and Settings\wouter\Mijn documenten\Rocket Administration\Rocket AdministrationView.h(32) : error C2501: 'm_bAdding' : missing storage-class or type specifiers Can someone help me out? Wouter do not initia...

Tab Index Problem
I am trying to set the tab index values for my form controls. The problem is that even though I enter a certain value for a particular tab index, it is not saved. It seems to be automatically reassigned. I have tried starting from the end and assigning a high number to those controls so that the lower indeces are available. The tab index values for the controls throughout the form are still being reassigned though :( How can I get the index values that I assign to stay? Thanks in advance for your help. Instead of trying to set the tab index, open VIEW > TAB ORDER and drag and drop the ...

Complex column sorting problem
Hi all, I'm pulling my hair out trying to get a long list of rows (1400+) sorted by two columns of times. The problem seems to be that some cells are empty or have a square bracket [ or ] in them - there is nothing I can do about this as I'm working with data from another app. Here is an example of the data un-ordered (I hope this displays okay...); [ 08:52 [ 06:56 00:15 ] 00/18 01:26 01:39 [ 00:40 04:50=BD 05:25 And this is how I want it; 00:15 ] 00/18 [ 00:40 01:26 01:39 04:50=BD 05:25 [ 06:56 [ 08:52 Simply by order of time with the emphasis on the first column, but as you can s...

Windows XP Update problem help needed..
Am running Operating System : Microsoft Windows XP Home Edition Version : 5.01.2600 Service Pack 3 Problem is that when I go to the Windows update site it shows the following updates available: Microsoft .NET Framework 3.5 SP1 Update for Windows Server 2003 and Windows XP x86 (KB982168) Microsoft .NET Framework 3.5 SP1 and .NET Framework 2.0 SP2 Security Update for Windows 2000, Windows Server 2003, and Windows XP x86 (KB979909) I tryed to install them along with others updates listed and it showed they succeeded along with the others but when I rest...

Excel problem #3
I am attaching an excel file where i have a problem In the file are 2 sheets, Main & second I want to get data from second sheet to the main sheet by a formula by which the amount in the total column will be posted in the second sheet falling under various dates. I have done for 6 sept 2003 by way of example I do not know any formula by which i can do this automatically Please help me Attachment filename: example.xls Download attachment: http://www.excelforum.com/attachment.php?postid=444742 --- Message posted from http://www.ExcelForum.com/ Hi one way: ...

Problem sending emails in 2003
I get this message in returned emails in Outlook 2003, even though the I the peron is on my safe lists. 553 sorry, that domain isn't in my list of allowed rcpthosts (#5.7.1) I can send mail fine in Outlook express. I have several email accounts including a dial up one. When I use my dial up account the mail also sends fine, it is my direcway account that is the problem, but they say since it sends fine in Outlook Express it is not their problem it is a problem with Outlook. I also never had this problem until I upgraded from the beta to the final version of 2003. Any help would...

problem with single quote mark
Hi, I posted this once before but I still do not understand what the problem is. I have a form into which I enter titles of articles, in a field called "titleofarticle". In many cases, the title may contain a word or a person's name in possessive form, such as "Bob's Ideas on Microsoft Access." Whenever I put a single quote anywhere in an article title, and then click on a command button that goes to another form where I can enter more information about this article, I get an error message that says "Syntax Error (missing operator) in query expression &...

Outlook problem with very basic rule.....please help.
I've set up a basic rule , which based on specific text a outlook template is dispatched to the sender ,which works , but it only works once per email sender based on that particular specific text ? so if someone loses the information etc , i have to send manually? unless i close down outlook , which then allows one more attempt. can anyone help me with this , its driving me a little crazy . i'm running outlook from office xp with sp3 patch. or can anyone reccomend a suitable program.? my basic needs are that when i sell an item via ebay , some of my items require fitting inst...

CSplitterWnd problem
Hi there, in a first step I create a splitter window with 2 rows. If I split the first row again, into 2 columns, the resulting panes don't have a size. But I do set a size when I create a pane. Please can someone help out? Here is the source: BOOL CMainFrame::OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext) { CRect cr; GetClientRect( &cr ); // create a splitter window with 2 rows if( !m_mainSplitter.CreateStatic( this, 2, 1) ) { return FALSE; } // split the first row of m_mainSplitter if( !m_Splitter2.CreateStatic( &m_mainSplitter, 1, 2, ...

Windows Live Mail problems 07-16-10
Hi Is it possible to get all the emails to be put in one folder (In, Out, Delete etc). I have gone to Select Quick Views, but this doesn't work well, as I have many email account.s ALso Anyone know how I can get Windows Live Mail to keep the position of folders. Every time I move StorageFolders to the top, it gets put back to the bottom again. Many Thanks "t8769" <t8769@hotmail.com> wrote in message news:DD104989-7E15-46F6-9E2C-618D43DFE1A0@microsoft.com... > Hi > > Is it possible to get all the emails to be put in one fold...

Outlook XP / html format problem
Hi, Have a user with a wierd email problem in Outlook XP/2002 (exchange server). When sending an email, it seems that only the subject is sent, and the whole message body is blank. I've narrowed it down to sending email in HTML format. He can read any email in HTML format but when he replies or forwards, there is nothing in the message, just a subject. If I set to Rich-text or Plain text and send new message, it is fine. If I get an incoming HTML message, and forward as a Richtext ot plain text, it is fine. I've created another email profile, with no luck. I've r...

OWA2003/Exchange2003/ISA2000 Problems
I know I'm probably being dumb, but my head is beginning to swim with everything that I've read and I still can't get there. When I was on Exchange2000/Win2000/ISA2000, I had no problems getting my set up to work, but with the 2003 versions, I can't get external access to work. Here's my setup: I have one, dual NIC machine and it is all of the above servers all in one location. However, my default web site is only on the internal network, which is one of the reserved sets (like 10.0.0.2). Further, you cannot get to the server via an FQDN externally, you have to use an IP ...