473,785 Members | 2,789 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 1755

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
6811
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
2934
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
4291
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
10327
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...
0
10151
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9950
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...
0
8973
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7499
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
6740
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
5511
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3647
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2879
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.