473,327 Members | 1,967 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,327 software developers and data experts.

Re: Access Violation in either push_back()

Shawn <sf*****@gmail.comwrote in
news:64**********************************@w1g2000p rd.googlegroups.com:
Hello,

I'm getting a fairly reproducible Access Violation error when I call
the std::Vector.push_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 1697

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

Similar topics

9
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...
5
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. ...
3
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...
3
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...
3
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...
1
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....
6
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...
0
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...
39
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...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.