From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14462 invoked by alias); 9 Oct 2012 21:48:45 -0000 Received: (qmail 14452 invoked by uid 22791); 9 Oct 2012 21:48:44 -0000 X-SWARE-Spam-Status: No, hits=1.7 required=5.0 tests=AWL,BAYES_50,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,RCVD_IN_HOSTKARMA_YE,SARE_HIRISK_FORGED_ATT,T_FILL_THIS_FORM_SHORT X-Spam-Check-By: sourceware.org Received: from nm28-vm0.bullet.mail.sp2.yahoo.com (HELO nm28-vm0.bullet.mail.sp2.yahoo.com) (98.139.91.234) by sourceware.org (qpsmtpd/0.43rc1) with SMTP; Tue, 09 Oct 2012 21:48:39 +0000 Received: from [98.139.91.67] by nm28.bullet.mail.sp2.yahoo.com with NNFMP; 09 Oct 2012 21:48:39 -0000 Received: from [98.139.44.73] by tm7.bullet.mail.sp2.yahoo.com with NNFMP; 09 Oct 2012 21:48:39 -0000 Received: from [127.0.0.1] by omp1010.access.mail.sp2.yahoo.com with NNFMP; 09 Oct 2012 21:48:39 -0000 Received: (qmail 27630 invoked by uid 60001); 9 Oct 2012 21:48:39 -0000 Received: from [64.134.227.15] by web181302.mail.ne1.yahoo.com via HTTP; Tue, 09 Oct 2012 14:48:38 PDT X-Rocket-MIMEInfo: 001.001,UHJvZHVjdCBWZXJzaW9uID0gTmV0QmVhbnMgSURFIDcuMiAoQnVpbGQgMjAxMjA3MTcxMTQzKQpPcGVyYXRpbmcgU3lzdGVtID0gV2luZG93cyA3IHZlcnNpb24gNi4xIHJ1bm5pbmcgb24geDg2CkphdmE7IFZNOyBWZW5kb3IgPSAxLjcuMF8wMwpSdW50aW1lID0gSmF2YSBIb3RTcG90KFRNKSBDbGllbnQgVk0gMjIuMS1iMDIKQ3lnd2luIGdjYyA0LjUuMwogICAgICAgICAgICBnZGIgNC41LjMKCkknbSBkZWJ1Z2dpbmcgbXkgQysrIHNvZnR3YXJlIHVzaW5nIE5ldGJlYW5zIGFuZCBnZGIgNC41LjMgKGludGUBMAEBAQE- Message-ID: <1349819318.23713.YahooMailRC@web181302.mail.ne1.yahoo.com> Date: Tue, 09 Oct 2012 21:48:00 -0000 From: Arthur Schwarz Subject: SIGSERV termination on return statement To: gdb@sourceware.org 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/msg00049.txt.bz2 Product Version = NetBeans IDE 7.2 (Build 201207171143) Operating System = Windows 7 version 6.1 running on x86 Java; VM; Vendor = 1.7.0_03 Runtime = Java HotSpot(TM) Client VM 22.1-b02 Cygwin gcc 4.5.3 gdb 4.5.3 I'm debugging my C++ software using Netbeans and gdb 4.5.3 (integrated into the IDE) and I get a fatal error on the return from a method. The fault is consistent in that there is a failure in the same place in my code with the same caller all the time, and inconsistent in that there is no failure under other conditions. I am perfectly willing to accept the fault as mine but I can't seem to find the fault with gdb (and, hence, unable to fix it). The circumstances are: when I have 'a = method()' with '=' overloaded there is always a failure on the method return. when I have 'method()' with no assignment there is no failure. I have set a breakpoint in the overloaded assignment code but the breakpoint is never executed (?). The code is shown below (as an aid?). Any idea how I can use gdb to isolate the point of failure? As a note, the overload architecture looks like: class SlipCell { virtual SlipCell& operator=(SlipCell& X) = 0; } class SlipDatum: public SlipCell { virtual SlipCell& operator=(SlipCell& X); // code in .cpp file } class SlipHeader: public SlipCell { virtual SlipCell^ operator=(SlipCell& X); // code in .cpp file } class SlipSublist: public SlipCell { virtual SlipCell& operator=(SlipCell& X); // code in .cpp file } The code where the failure occurs is: [code] 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) SlipCell& SlipSublist::assignData(SlipCell& X) { // Assign a sublist to the current cell SlipCell* cell = this; if (isTemp()) { postError(SlipErr::E2036, "replace", "", "", this, &X); } else { if (X.isData()) { cell = &X; if (X.isTemp()) { cell = new SlipDatum((SlipDatum&)X); } else if (!X.isUnlinked()) { postError(SlipErr::E2039, "replace", "", "", this, &X); return *this; } replaceLinks(*cell); } else { SlipHeader* header = &(SlipHeader&)X; SlipHeader* oldHeader = (SlipHeader*)*getSublistHeader(); if (X.isSublist()) { header = (SlipHeader*)*getSublistHeader(X); } else if (!X.isHeader()) { postError(SlipErr::E3020, "replace", "", " Must be a Header, Sublist or Datum", this); return *cell; } *getSublistHeader() = header; (*getHeadRefCnt(*header))++; delete oldHeader; } } return *cell; //failure seems to be after the return statement is executed and before the return //to the caller and the overloaded '=' operator is never entered. }; // SlipCell& SlipSublist::assignData(SlipCell& X) [/code] I can't debug without a debugger. It would be useful to know that this is my error (I have misunderstood C++) or whether it is a debugger issue. And I would really like to know how to bypass any fault in the debugger (if there is one). This problem has dogged me for the last month or so - I have worked around it in most cases but now it's time to stop the bleeding. thanks PS: If my syntax is garbled or the presentation poor please provide guidance and not condemnation.