473,396 Members | 1,898 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,396 software developers and data experts.

STL vector core dump

Hey everybody. I have an issue where pushing a new item onto an STL vector, I get a core dump. Now, the capacity of the vector is not exceeded (its only 3). The vector contains integers. Now, in my application, I push stuff to the vector and works fine until that one point. Basically, I do this:

Expand|Select|Wrap|Line Numbers
  1. vector<int> vec;
  2. vec.push_back(newInt);
  3.  
and get a core dump. Now, the function which involves this, is part of the class reached from the outside by a few iterator references (in one instance one of those iterators is a const_iterator, and it is converted into a regular iterator). All the references are valid, and I know that because I put couts before and after the push_back. I see the first cout, but not the second...Ay ideas..help is cool.
Jul 21 '07 #1
2 1558
ravenspoint
111 100+
A core dump? Really? Are you sure you are posting from 2007?

Core dumps are before even my time. A core is volatile RAM made from tiny iron doughnuts with three wires running through them - each one could hold an entire bit of data. When something went wrong, the contents of these were dumped, in hex if you were lucky, to printer before the brief magnetism of the iron faded.

Anyway, before we can answer your question we need to see more of your code. The function were the crash occurs, at the least.

Please don't post the core dump, thanks. :-)
Jul 21 '07 #2
Probably on Solaris. Many of their machines regularly core dump when there is a memory problem. I do not think they are true core-dumps as you describe, but the same idea in general. Not sure what Linux calls them, but same diea as a blue screen without the annoying bit of having to reboot. But we do need more code there, since the 2 lines you have look ok.
Jul 23 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: Ganesh Gella | last post by:
Hi All, I am using g++ on Linux, and my code has lot of vectors each stores a particualr type of structure. (Structure internally had some vectors). When I am trying to push_back an element to...
12
by: Gaurav | last post by:
Hello I have a program that basically inverts the contents of files except first line. It compiles fine but gives me core dump on running. If i comment temp.clear() it runs fine, but i need...
10
by: John Liu | last post by:
We upgraded from 7.2 to 7.4, it looks like everything working, but when I issue a query such as select * from tab (tab has about 2-3 million records), it causes core dump. I tuned some the...
7
by: Rylan | last post by:
I'm writing a program that uses a vector of classes for storing information from a file. Unfortunately, my program causes a core dump upon attempting to add a second item to the vector. Any...
10
by: wong_powah | last post by:
I want to find out where (which line) my C program core dump. How to do that? Is there a web site describing the procedure? One approach is to use stack trace of the mdb debugger, but I does not...
1
by: simon | last post by:
I am having problem with an application which core dumps while deleting a vector here is the snippet : Event_Node_t struct defined in the header : +++++++++++++++++++++++++++++++++++++...
18
by: John Salmon | last post by:
I was under the impression that the following was always valid: std::vector<Tv; .. T *p = &(v); But I was recently told that care was needed in case the vector was empty, i.e., when v.size()...
4
by: Akila | last post by:
My application is built on sun solaris 9.0. 5.9 Generic_118558-26 sun4u sparc SUNW,Sun-Fire-V210 compiler : Sun C++ 5.5 Patch 113817-14 2005/07/19 I am creating a vector of int at the...
6
by: Andy | last post by:
Hi all, I started developing a little app on my Mac using XCode some month ago. The app is running fine on my mac like a sharm. Now I am nearly ready and yesterday I moved the whole source code...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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,...
0
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...
0
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...
0
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,...

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.