public inbox for insight-prs@sourceware.org
help / color / mirror / Atom feed
* Re: insight/206: SEGV in Tcl_FindCommand
@ 2003-01-24  1:23 Lloyd J Lewins
  0 siblings, 0 replies; 4+ messages in thread
From: Lloyd J Lewins @ 2003-01-24  1:23 UTC (permalink / raw)
  To: kseitz; +Cc: insight-prs

The following reply was made to PR insight/206; it has been noted by GNATS.

From: "Lloyd J Lewins" <llewins@raytheon.com>
To: kseitz@sources.redhat.com, insight-prs@sources.redhat.com,
   kseitz@sources.redhat.com, llewins@raytheon.com, nobody@sources.redhat.com,
   insight-gnats@sources.redhat.com
Cc:  
Subject: Re: insight/206: SEGV in Tcl_FindCommand
Date: Thu, 23 Jan 2003 17:15:55 -0800

 Running the same version of insight with -nw as you suggest (on cygwin
 platform) I do not see the problem:
 
 ~/bugs/gdb/Tcl-FindCommand-SEGV>insight -nw main.exe
 GNU gdb 2003-01-09-cvs
 Copyright 2002 Free Software Foundation, Inc.
 GDB is free software, covered by the GNU General Public License, and you
 are
 welcome to change it and/or distribute copies of it under certain
 conditions.
 Type "show copying" to see the conditions.
 There is absolutely no warranty for GDB.  Type "show warranty" for details.
 This GDB was configured as "i686-pc-cygwin"...
 (gdb) b 170
 Breakpoint 1 at 0x401280: file main.cc, line 170.
 (gdb) r
 Starting program: /home/00c3197/bugs/gdb/Tcl-FindCommand-SEGV/main.exe
 
 Breakpoint 1, main () at main.cc:170
 170     }
 (gdb) p *b
 $1 = {<classC> = {nameV = {static npos = 4294967295, static nilRep = {len
 = 0,
         res = 0, ref = 2, selfish = false}, dat = 0xa012378 "foo"},
     myClassAV = @0xa0b3780}, _vb$classC = 0xa011af8, valV = 0,
   _vptr$classB = 0x4156bc <classB virtual table>}
 (gdb)
 
 Since the SEGV is in tcl functions, I am surprised this is a problem with
 gdb -- I thought it was only insight which used tcl/tk.
 
 Lloyd J. Lewins
 Raytheon Co.,
 llewins@raytheon.com
 +1 (310) 647-8832
 
 
                                                                                                                                                 
                       kseitz@sources.r                                                                                                          
                       edhat.com                To:      insight-prs@sources.redhat.com, kseitz@sources.redhat.com, llewins@raytheon.com,        
                                                nobody@sources.redhat.com                                                                        
                       01/23/03 10:41           cc:                                                                                              
                       AM                       Subject: Re: insight/206: SEGV in Tcl_FindCommand                                                
                       Please respond                                                                                                            
                       to kseitz;                                                                                                                
                       Please respond                                                                                                            
                       to insight-prs;                                                                                                           
                       Please respond                                                                                                            
                       to kseitz;                                                                                                                
                       Please respond                                                                                                            
                       to llewins;                                                                                                               
                       Please respond                                                                                                            
                       to nobody;                                                                                                                
                       Please respond                                                                                                            
                       to insight-gnats                                                                                                          
                                                                                                                                                 
                                                                                                                                                 
 
 
 
 
 Synopsis: SEGV in Tcl_FindCommand
 
 Responsible-Changed-From-To: unassigned->kseitz
 Responsible-Changed-By: kseitz
 Responsible-Changed-When: Thu Jan 23 18:41:46 2003
 Responsible-Changed-Why:
     Mine
 State-Changed-From-To: open->closed
 State-Changed-By: kseitz
 State-Changed-When: Thu Jan 23 18:41:46 2003
 State-Changed-Why:
     This is really a bug in GDB, not insight. Try running this with command
 line gdb (on any platform), and it will exhibit similar behavior (crash or
 lock-up). I suggest running this example on GDB and posting a report to
 gdb@sources.redhat.com. Here's what you'll want to do:
 
     $ c++ -g main.cc -o main
     $ gdb -nx -q main  [or insight -nw main]
     (gdb) break 170
     (gdb) r
     (gdb) p *b
 
     This will reproduce the whole thing.
 
 http://sources.redhat.com/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=insight&pr=206
 
 
 
 
 


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: insight/206: SEGV in Tcl_FindCommand
@ 2003-01-24 13:43 Keith Seitz
  0 siblings, 0 replies; 4+ messages in thread
From: Keith Seitz @ 2003-01-24 13:43 UTC (permalink / raw)
  To: kseitz; +Cc: insight-prs

The following reply was made to PR insight/206; it has been noted by GNATS.

From: Keith Seitz <keiths@redhat.com>
To: Lloyd J Lewins <llewins@raytheon.com>
Cc: insight-gnats@sources.redhat.com
Subject: Re: insight/206: SEGV in Tcl_FindCommand
Date: 24 Jan 2003 05:36:29 -0800

 On Thu, 2003-01-23 at 17:15, Lloyd J Lewins wrote:
 > Running the same version of insight with -nw as you suggest (on cygwin
 > platform) I do not see the problem:
 
 Hmmm. That is odd. My gdb (cvs head) locks up on me when I ask it to do
 this.
 
 > Since the SEGV is in tcl functions, I am surprised this is a problem with
 > gdb -- I thought it was only insight which used tcl/tk.
 
 Typically, insight will not crash in a platform-specific way. You're
 using c++ and there has been a lot of churn in gdb (and its
 dependencies) in this area.
 
 You're using the standard cygwin compiler, 2.95.xxx, right? I'm using
 3.2. Maybe that's why. In any case I don't think that Insight is really
 crashing in tcl/tk. I think that the stack has been corrupted.
 
 Let's try this... Run your program (in insight) to where you would add
 it to the watch window. Then open a console window and enter:
 
 (gdb) tk gdb_variable create -expr b
 var1 (<-- could be different object id)
 (gdb) tk var1 numChildren
 ??
 (gdb) tk var1 children
 ??
 
 What's the output? Do either of these cause a crash? If they do, try the
 same thing in MI:
 
 $ gdb -i=mi main
 (gdb)
 break 170
 (gdb)
 run
 (gdb)
 -var-create - * b
 ^done,name="var1",numchild="2",type="classB *"
 (gdb)
 -var-list-children var1
 ???
 
 What does this show? I'll see about updating my cygwin box (er, that
 means actually turning it on, which I haven't done in a very long time),
 but it's going to take quite some time. Please ping me on this if you
 don't hear from me for a week.
 
 Keith
 
 


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: insight/206: SEGV in Tcl_FindCommand
@ 2003-01-23 18:41 kseitz
  0 siblings, 0 replies; 4+ messages in thread
From: kseitz @ 2003-01-23 18:41 UTC (permalink / raw)
  To: insight-prs, kseitz, llewins, nobody

Synopsis: SEGV in Tcl_FindCommand

Responsible-Changed-From-To: unassigned->kseitz
Responsible-Changed-By: kseitz
Responsible-Changed-When: Thu Jan 23 18:41:46 2003
Responsible-Changed-Why:
    Mine
State-Changed-From-To: open->closed
State-Changed-By: kseitz
State-Changed-When: Thu Jan 23 18:41:46 2003
State-Changed-Why:
    This is really a bug in GDB, not insight. Try running this with command line gdb (on any platform), and it will exhibit similar behavior (crash or lock-up). I suggest running this example on GDB and posting a report to gdb@sources.redhat.com. Here's what you'll want to do:
    
    $ c++ -g main.cc -o main
    $ gdb -nx -q main  [or insight -nw main]
    (gdb) break 170
    (gdb) r
    (gdb) p *b
    
    This will reproduce the whole thing.

http://sources.redhat.com/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=insight&pr=206


^ permalink raw reply	[flat|nested] 4+ messages in thread

* insight/206: SEGV in Tcl_FindCommand
@ 2003-01-21  0:53 llewins
  0 siblings, 0 replies; 4+ messages in thread
From: llewins @ 2003-01-21  0:53 UTC (permalink / raw)
  To: insight-gnats


>Number:         206
>Category:       insight
>Synopsis:       SEGV in Tcl_FindCommand
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Jan 21 00:53:01 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator:     Lloyd J. Lewins
>Release:        GNU gdb 2003-01-09-cvs
>Organization:
>Environment:
cygwin
>Description:
Compiled wih gcc:
gcc version 2.95.3-5 (cygwin special)

Using Insite cvs January 9:
GNU gdb 2003-01-09-cvs

Upon examining variable b, receive the following SEGV:
Program received signal SIGSEGV, Segmentation fault.
0x6603b620 in Tcl_FindCommand (interp=0xa032b48, name=0xa492160 "namespace",
    contextNsPtr=0x0, flags=0)
    at ../../../src/tcl/win/../generic/tclNamesp.c:1970
1970        if (cxtNsPtr->cmdResProc != NULL || iPtr->resolverPtr != NULL) {
>How-To-Repeat:
set break point at line 170, and run. Click on variable b and add to watch. In
watch, browse into b->classC->private. Watch window fails to update correctly,
and goes to back. Click watch window to bring to front to generate SEGV.
>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: text/plain; name="main.cc"
Content-Disposition: inline; filename="main.cc"

/*
Submitted by L.J.Lewins, llewins@raytheon.com

Compiled wih gcc:
gcc version 2.95.3-5 (cygwin special)

Using Insite cvs January 9:
GNU gdb 2003-01-09-cvs

Upon examining variable b, receive the following SEGV:
Program received signal SIGSEGV, Segmentation fault.
0x6603b620 in Tcl_FindCommand (interp=0xa032b48, name=0xa492160 "namespace",
    contextNsPtr=0x0, flags=0)
    at ../../../src/tcl/win/../generic/tclNamesp.c:1970
1970        if (cxtNsPtr->cmdResProc != NULL || iPtr->resolverPtr != NULL) {

Reproduce:
set break point at line 170, and run. Click on variable b and add to watch. In
watch, browse into b->classC->private. Watch window fails to update correctly,
and goes to back. Click watch window to bring to front to generate SEGV.
*/

#include <string>

using namespace std;

class containerClass
{
public:
    class classB;

public:
    containerClass (void)
    {
    }
    
    class classA {
    public:
        classA(const unsigned num)
            : valV (num)
        {
        }

        classB* find(const unsigned val) const
        {
            return 0;
        }

        virtual unsigned val(void)
        {
            return valV;
        }

    protected:
        const unsigned   valV;
        string           nameV;

    private:
        // disallow default/copy constructor and assignment operator
        classA(void);
        classA(classA& source);
        classA& operator=(const classA& rhs);

    friend class containerClass;
    friend class classB;
    };

    class classC {
    public:
        classC (classA& myClassA)
            : nameV("foo"),
              myClassAV (myClassA)
        {
        }

        classA& myClassA (void) const
        {
            return myClassAV;
        }

    protected:
        string nameV;

    private:
        classA& myClassAV;
        
        // disallow defau;t/copy constructor and assignment operator
        classC(void);
        classC(classC& source);
        classC& operator=(const classC& rhs);
    };

    class classB : virtual public classC {
    public:
        classB(classA&            myClassA)
            : classC(myClassA),
              valV(0)
        {
        }

        virtual unsigned val(void)
        {
            return valV;
        }

    protected:
        unsigned              valV;

    private:
        // disallow defaut/copy constructor and assignment operator
        classB (void);
        classB (classB& source);
        classB& operator= (const classB& rhs);
    };

private:
    // disallow copy constructor and assignment operator
    containerClass (containerClass& source);
    containerClass& operator= (const containerClass& rhs);

friend class classA;
};

class classB;

class classA : public containerClass::classA
{
public:
    classA(const unsigned num)
        : containerClass::classA(num)
    {
    }

    classB* find(const unsigned val) const
    {
        return 0;
    }
    
private:
    // disallow copy constructor and assignment operator
    classA(classA& source);
    classA& operator=(const classA& rhs);
};

class classB : public containerClass::classB
{
public:
    classB(containerClass::classA& myClassA)
        : classC(myClassA),
          containerClass::classB(myClassA),
          reservedV(false)
    {
    }

protected:
    bool reservedV;

private:
    // disallow copy constructor and assignment operator
    classB(classB& source);
    classB& operator=(const classB& rhs);
};

int main(void)
{
    classA* a = new classA(0);

    classB* b = new classB(*a);

}



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2003-01-24 13:43 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-01-24  1:23 insight/206: SEGV in Tcl_FindCommand Lloyd J Lewins
  -- strict thread matches above, loose matches on Subject: below --
2003-01-24 13:43 Keith Seitz
2003-01-23 18:41 kseitz
2003-01-21  0:53 llewins

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).