From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28598 invoked by alias); 10 Oct 2012 16:01:03 -0000 Received: (qmail 28538 invoked by uid 22791); 10 Oct 2012 16:00:57 -0000 X-SWARE-Spam-Status: No, hits=-0.4 required=5.0 tests=BAYES_50,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,KHOP_THREADED,RCVD_IN_DNSWL_NONE,RCVD_IN_HOSTKARMA_YE,SARE_HIRISK_FORGED_ATT X-Spam-Check-By: sourceware.org Received: from nm22-vm0.bullet.mail.sp2.yahoo.com (HELO nm22-vm0.bullet.mail.sp2.yahoo.com) (98.139.91.222) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 10 Oct 2012 16:00:53 +0000 Received: from [72.30.22.77] by nm22.bullet.mail.sp2.yahoo.com with NNFMP; 10 Oct 2012 16:00:53 -0000 Received: from [66.94.237.108] by tm11.bullet.mail.sp2.yahoo.com with NNFMP; 10 Oct 2012 16:00:53 -0000 Received: from [127.0.0.1] by omp1013.access.mail.mud.yahoo.com with NNFMP; 10 Oct 2012 16:00:53 -0000 Received: (qmail 69099 invoked by uid 60001); 10 Oct 2012 16:00:52 -0000 Received: from [75.37.150.143] by web181302.mail.ne1.yahoo.com via HTTP; Wed, 10 Oct 2012 09:00:52 PDT X-Rocket-MIMEInfo: 001.001,VGhlIG9iamVjdCBpcyBkZWxldGVkIGFuZCBub3QgdXNlZCB3aXRoaW4gdGhpcyBjb250ZXh0LiBUaGUgZXJyb3Igb2NjdXJzIGJlZm9yZSAKdGhlIGFzc2lnbm1lbnQgaXMgY29tcGxldGUuCgpJICBtaWdodCBoYXZlIGEgKHZlcnkgc3Ryb25nKSBtaXN1bmRlcnN0YW5kaW5nIG9mIGhvdyBDKysgcmVmZXJlbmNlcyB3b3JrLCAgYnV0LCAKSSBkb24ndCB0aGluayB0aGF0IGdkYiBzaG91bGQganVzdCBxdWl0IGFuZCBub3QgYWxsb3cgbWUgdG8gZGVidWcuIAoKCkluIFNsaXBTdWJsaXN0OjpyZXBsYWNlIGlmICcBMAEBAQE- References: <1349819318.23713.YahooMailRC@web181302.mail.ne1.yahoo.com> <5074B404.9090402@gmx.net> Message-ID: <1349884852.11402.YahooMailRC@web181302.mail.ne1.yahoo.com> Date: Wed, 10 Oct 2012 16:01:00 -0000 From: Arthur Schwarz Subject: Re: SIGSERV termination on return statement To: Aurelian Melinte Cc: gdb@sourceware.org In-Reply-To: <5074B404.9090402@gmx.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2012-10/txt/msg00052.txt.bz2 The object is deleted and not used within this context. The error occurs before the assignment is complete. I might have a (very strong) misunderstanding of how C++ references work, but, I don't think that gdb should just quit and not allow me to debug. In SlipSublist::replace if 'SlipCell& cell' is changed to 'SlipCell* cell', with appropriate changes to the remaining code, then no error occurs. It is only when a reference is used do I get into difficulty. I get a SIGSERV error from gdb in this context and in others when an assignment is made to a reference variable, 'cell' in this case. Whenever 'variable = somereference' is executed, gdb faults. 'somereference' can be a function or a variable. The questions I have are (1) can reference variables not be reassigned?, and (2) is gdb's SIGSERV fault a legitimate fault or a bug? Thanks for taking the time; art ----- Original Message ---- From: Aurelian Melinte To: Arthur Schwarz Cc: gdb@sourceware.org Sent: Tue, October 9, 2012 4:32:20 PM Subject: Re: SIGSERV termination on return statement On 09/10/2012 5:48 PM, Arthur Schwarz wrote: > SlipCell& SlipSublist::replace(SlipCell& X) { // Replace a >cell > on a list with a new cell > SlipCell& cell = *this; > if (X.isData()) { > cell = assignData(X); // failure before return to this statement from > method > *** delete this; > } else { > *this = X; > } > *** return cell; > }; // SlipCell& SlipSublist::replace(SlipCell& X) > Are you returning from a deleted object then using it afterward? Regards, Aurelian