473,795 Members | 2,847 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Re: Access Violation in either push_back()

Shawn <sf*****@gmail. comwrote in
news:64******** *************** ***********@w1g 2000prd.googleg roups.com:
Hello,

I'm getting a fairly reproducible Access Violation error when I call
the std::Vector.pus h_back() function on a CString. It's my current
guess that I'm corrupting memory somewhere else (possibly) and it's
effecting this line of code. Does anyone have any suggestions as to
how to approach this issue? One more thing, the error is often an
Access Violation but sometimes it says something about HEAP
corruption. Also, this is just the latest incarnation of this code, I
have also tried a version that just concatenate CStrings and another
version that concatenated std::strings with equally confusing errors.
Any ideas? Thanks folks.
I bet you have some multithreading access error. Ensure that your threads
do not read or write any shared variables without proper locking. If you
are not able to spot the error by the code inspection, then I suggest the
Intel Thread Checker tool - it finds such kind of errors for you
automatically (although not necessarily faster than yourself ;-)

HTH
Paavo
Jun 27 '08 #1
0 1757

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
2852
by: Allen | last post by:
Hi all, I tried posting to one of the ms.win32 groups and haven't gotten a response yet. It may be my C++ that's at fault anyway so I'll try here too. I wrote a .dll that is misbehaving (access violation at startup) and I can't find the problem. I'm using load time linking and, when I try to step into program execution to find the problem, I don't even get to the start of WinMain before it throws the exception. The source files are...
5
3633
by: Boogie El Aceitoso | last post by:
Hi, The code below produces an access violation error, complaining that an object is destroyed twice. I don't understand why this happens. Any help would be appreciated. --------main.cpp--------------------------------------------------------------------------- #include "AbstractActivator.h"
3
6813
by: Kyle Teague | last post by:
I have a list of pointers to structs as a private member of a class. If I call begin() in the same function as I added the data then no access violation occurs. However, if I try to call begin() in a member function of the same class I get a memory access violation. For example: // this is fine, no error void CBase::FuncA( void ) { plugin_info_t *plugin_info = new plugin_info_t;
3
1888
by: Eric Boutin | last post by:
Hi ! I got the fallowing function : void pushargv(TmpFile in) { std::string tmp = in.getfilename(); argv.push_back(in.getfilename()); tocleanup.push_back(in.getfilename());} where argv and tocleanup are vector<string>
3
3619
by: zombek | last post by:
Hi. I'm quite a begginer. I wanted to learn the usage of tinyxml library so I wrote a little program which compiles on g++ 4.1.1 with -O2 -Wall, but when I run it a get a message "memory access violation". Source: #include "tinyxml.h" #include <vector> #include <string> #include <iostream> using namespace std;
1
1539
stealwings
by: stealwings | last post by:
I have implemented a binary search and some other functions to my code, when I compile it, it gives me no error, but when I run it, it gives me an Access violation, why? Can some one explain me plz. Thanks in advance. // SpanishBreakPredict.cpp : Defines the entry point for the console application. // #include "stdafx.h" #include <iostream> using namespace std; #include <fstream> using std::ifstream; using std::ofstream;
6
2936
by: hadad.yaniv | last post by:
Hello, i am new to c++, i hav a vector of typed object: vector<Man*People; When i do a second pushback, even for the same object the program crash say: "An Access Violation (Segmentation fault) raised in your program"
0
250
by: Sam | last post by:
Shawn writes: Old-fashioned debugging. The actual memory corruption probably occurs earlier, but only gets exposed at this point. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.7 (GNU/Linux)
39
4294
by: Martin | last post by:
I have an intranet-only site running in Windows XPPro, IIS 5.1, PHP 5.2.5. I have not used or changed this site for several months - the last time I worked with it, all was well. When I tried it just now, I am getting the subject error message (specifically: PHP has encountered an access violation at 00F76E21). The error is NOT occurring on every page request (but it is on most of them) and, when I get the error, simply pressing <F5to...
0
9673
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10448
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10167
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10003
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7544
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6784
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5440
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5566
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4114
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.