STL vector core dump

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • creativeinspiration
    New Member
    • Jun 2007
    • 25

    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:

    Code:
    vector<int> vec;
    vec.push_back(newInt);
    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.
  • ravenspoint
    New Member
    • Jul 2007
    • 111

    #2
    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. :-)

    Comment

    • Benny the Guard
      New Member
      • Jun 2007
      • 92

      #3
      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.

      Comment

      Working...