Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c++ > #10414

Re: Vector push_back() giving SIGSEGV error

Path csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!news.szaf.org!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From Ian Collins <ian-news@hotmail.com>
Newsgroups comp.lang.c++
Subject Re: Vector push_back() giving SIGSEGV error
Date Fri, 23 Sep 2011 13:54:50 +1200
Lines 30
Message-ID <9e277aF9j7U1@mid.individual.net> (permalink)
References <29403061.2519.1316720927293.JavaMail.geo-discussion-forums@yqaa12> <Xns9F68EE6A3EE40myfirstnameosapriee@216.196.109.131> <7524880.1452.1316737057158.JavaMail.geo-discussion-forums@yqmw31>
Mime-Version 1.0
Content-Type text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding 7bit
X-Trace individual.net kNQKh6M/dcz0LFCNg+mXkgAwfMVwZGfDM5T6Q2rK5kHq1vw6ml
Cancel-Lock sha1:d6xm5pudodzWyoXK7r5It1c8QaM=
User-Agent Mozilla/5.0 (X11; U; SunOS i86pc; en-US; rv:1.9.2.9) Gecko/20101021 Lightning/1.0b2 Thunderbird/3.1.4
In-Reply-To <7524880.1452.1316737057158.JavaMail.geo-discussion-forums@yqmw31>
Xref x330-a1.tempe.blueboxinc.net comp.lang.c++:10414

Show key headers only | View raw


On 09/23/11 12:17 PM, sravanreddy001 wrote:

Please keep the context of the message you are replying to, otherwise 
your posts don't make sense.

> Hi Paavo,
>
> <My apologies, I overlooked my question and missed the core part>
>
> Please let me know if you need more info.
> {I'm not a newbie to C++ (may be Intermediate), I checked if its refereing any out-of-bound reference etc.}
>
> The "Links" is a vector<string>  object.
>
> The problem is:
> The size of link has reached its capacity for a size of 4. (during one of the(26th) iterations of this code.)
>
> When I'm trying to add the fifth element to the above vector, it is supposed to increase the size and add this element. But instead it is giving a SIGSEGV error.
>
> True. There are no obvious errors.
>
> Simply put.
> I've a vector, and I was able to add 4 objects to it, and I checked that its capacity is 4. and max_size() is over a 100,000. When I'm trying to add 5th element its returning the Termination Interrupt

You really should do what Paavo and Victor suggested and build a 
complete, self-contained example demonstrating your problem that you can 
post.  Odds are that if you can't, your problem lies elsewhere.

-- 
Ian Collins

Back to comp.lang.c++ | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Vector push_back() giving SIGSEGV error sravanreddy001 <sravanreddy001@gmail.com> - 2011-09-22 12:48 -0700
  Re: Vector push_back() giving SIGSEGV error Paavo Helde <myfirstname@osa.pri.ee> - 2011-09-22 15:26 -0500
    Re: Vector push_back() giving SIGSEGV error sravanreddy001 <sravanreddy001@gmail.com> - 2011-09-22 17:17 -0700
      Re: Vector push_back() giving SIGSEGV error Ian Collins <ian-news@hotmail.com> - 2011-09-23 13:54 +1200
      Re: Vector push_back() giving SIGSEGV error Jorgen Grahn <grahn+nntp@snipabacken.se> - 2011-09-23 09:24 +0000
  Re: Vector push_back() giving SIGSEGV error Victor Bazarov <v.bazarov@comcast.invalid> - 2011-09-22 16:30 -0400
    Re: Vector push_back() giving SIGSEGV error sravanreddy001 <sravanreddy001@gmail.com> - 2011-09-22 17:20 -0700
      Re: Vector push_back() giving SIGSEGV error Paavo Helde <myfirstname@osa.pri.ee> - 2011-09-23 00:20 -0500

csiph-web