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


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

Re: string close causes SIGSEGV

From gof@somewhere.invalid (Gof)
Newsgroups comp.lang.c++
Subject Re: string close causes SIGSEGV
Date 2012-04-19 08:05 +0000
Organization ATMAN - ATM S.A.
Message-ID <gof.1334822648.1922@somewhere.invalid> (permalink)
References <ad9d6b28-de64-413b-9de8-5a0ab04486f4@a5g2000vbl.googlegroups.com> <jmmutr$2c5i$1@raid.furrfu.com>

Show all headers | View raw


Drew Lawson <drew@furrfu.invalid> wrote:

> Almost certainly the reason that line resulted in a SIGSEGV is that 
> the object "file" was trashed before that line was executed.

The same came to my mind - I've experienced it.

Consider the code:

std::string *a = new std::string("test");
std::string &b = *a;
delete a;
b.clear();

-- 
Gof

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


Thread

string close causes SIGSEGV Lacek <mateusz.lacki@gmail.com> - 2012-04-18 03:12 -0700
  Re: string close causes SIGSEGV jt@toerring.de (Jens Thoms Toerring) - 2012-04-18 10:32 +0000
  Re: string close causes SIGSEGV Juha Nieminen <nospam@thanks.invalid> - 2012-04-18 11:09 +0000
  Re: string close causes SIGSEGV drew@furrfu.invalid (Drew Lawson) - 2012-04-18 17:50 +0000
    Re: string close causes SIGSEGV gof@somewhere.invalid (Gof) - 2012-04-19 08:05 +0000

csiph-web