public inbox for insight@sourceware.org
 help / color / mirror / Atom feed
* Insight freezes when trying to debug Mozilla
@ 2000-10-01  9:49 bstell
  2000-10-03 13:36 ` Fernando Nasser
  0 siblings, 1 reply; 8+ messages in thread
From: bstell @ 2000-10-01  9:49 UTC (permalink / raw)
  To: insight

I'm trying to debug Mozilla using Insight.

When I run mozilla with the debug option the insight debugger comes
up and lets me start mozilla. I click the run button and it starts
and then does a break at main. When I press continue mozilla comes
up but insight never responds again (not screen refresh or button 
response.

I am running version 20000930 (/usr/local/bin/gdb).

I attached a second gdb to insight's gdb.
Here is the output for the xterm where I was running gdb on gdb:
=====================================================================

    [root@localhost gdb]# /usr/bin/gdb /usr/local/bin/gdb
    GNU gdb 19991004
    Copyright 1998 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 "i386-redhat-linux"...
    Setting up the environment for debugging gdb.
    Breakpoint 1 at 0x810a062: file utils.c, line 735.
    Breakpoint 2 at 0x81074ff: file top.c, line 2897.
    (top-gdb) attach 22239
    Attaching to program: /usr/local/bin/gdb, Pid 22239
    Reading symbols from /usr/lib/libncurses.so.4...done.
    Reading symbols from /usr/X11R6/lib/libX11.so.6...done.
    Reading symbols from /lib/libdl.so.2...done.
    Reading symbols from /lib/libm.so.6...done.
    Reading symbols from /lib/libc.so.6...done.
    Reading symbols from /lib/ld-linux.so.2...done.
    Reading symbols from /lib/libthread_db.so.1...done.
    0x40140deb in __sigsuspend (set=0x83e36c0) at
../sysdeps/unix/sysv/linux/sigsuspend.c:48
    48      ../sysdeps/unix/sysv/linux/sigsuspend.c: No such file or
directory.
    (top-gdb) bt
    #0  0x40140deb in __sigsuspend (set=0x83e36c0) at
../sysdeps/unix/sysv/linux/sigsuspend.c:48
    #1  0x80d1092 in lin_lwp_wait (pid=-1, ourstatus=0xbfffc074) at
lin-lwp.c:766
    #2  0x812dd11 in thread_db_wait (pid=-1, ourstatus=0xbfffc074) at
thread-db.c:710
    #3  0x80e1ad7 in gdbtk_wait (pid=-1, ourstatus=0xbfffc074) at
./gdbtk/generic/gdbtk-hooks.c:694
    #4  0x80b269f in wait_for_inferior () at infrun.c:1286
    #5  0x80b252c in proceed (addr=4294967295,
siggnal=TARGET_SIGNAL_DEFAULT, step=0) at infrun.c:1085
    #6  0x80afba3 in continue_command (proc_count_exp=0x0, from_tty=0)
at infcmd.c:399
    #7  0x80e1666 in gdbtk_call_command (cmdblk=0x8418140, arg=0x0,
from_tty=0) at ./gdbtk/generic/gdbtk-hooks.c:513
    #8  0x8105915 in execute_command (p=0x89a4310 "", from_tty=0) at
top.c:1517
    #9  0x80dadb5 in gdb_immediate_command (clientData=0x80dace4,
interp=0x8424fb0, objc=2, objv=0x8425c68)
        at ./gdbtk/generic/gdbtk-cmds.c:892
    #10 0x80da888 in wrapped_call (opaque_args=0xbfffc284) at
./gdbtk/generic/gdbtk-cmds.c:536
    #11 0x81048d9 in catch_errors (func=0x80da858 <wrapped_call>,
args=0xbfffc284, errstring=0x8356883 "", mask=6)
        at top.c:607
    #12 0x80da78e in call_wrapper (clientData=0x80dace4,
interp=0x8424fb0, objc=2, objv=0x8425c68)
        at ./gdbtk/generic/gdbtk-cmds.c:474
    #13 0x82ff5f9 in TclExecuteByteCode (interp=0x8424fb0,
codePtr=0x8789528) at ./../generic/tclExecute.c:955
    #14 0x82de521 in Tcl_EvalObj (interp=0x8424fb0, objPtr=0x853ccf8) at
./../generic/tclBasic.c:2645
    #15 0x83297d1 in TclObjInterpProc (clientData=0x85a8d10,
interp=0x8424fb0, objc=1, objv=0x8425c64)
        at ./../generic/tclProc.c:996
    #16 0x82ff5f9 in TclExecuteByteCode (interp=0x8424fb0,
codePtr=0x89a4288) at ./../generic/tclExecute.c:955
    #17 0x82de521 in Tcl_EvalObj (interp=0x8424fb0, objPtr=0x897ac40) at
./../generic/tclBasic.c:2645
    #18 0x82eb10d in Tcl_SwitchObjCmd (dummy=0x0, interp=0x8424fb0,
objc=3, objv=0x8425c58)
    ---Type <return> to continue, or q <return> to quit---q
     at ./../generic/tclCmdMZ.c:17Quit
    (top-gdb) 
    
Here is the output for the xterm where I was running mozilla:
=====================================================================

    [bstell@localhost bin]$ ./mozilla -g 2>&1 | tee junk.mozilla.-g.log
    ./run-mozilla.sh -g ./mozilla-bin
    MOZILLA_FIVE_HOME=.
      LD_LIBRARY_PATH=.
         LIBRARY_PATH=.:./components
           SHLIB_PATH=.
              LIBPATH=.
           ADDON_PATH=.
          MOZ_PROGRAM=./mozilla-bin
          MOZ_TOOLKIT=
            moz_debug=1
         moz_debugger=
    which: no ddd in
(/usr/local/bin:/bin:/usr/bin:/usr/X11R6/bin:/home/bstell/bin)
    Type Manifest File:
/home/bstell/work/moz/v1/mozilla/dist/bin/components/xpti.dat
    nsNativeComponentLoader: autoregistering begins.
    nsNativeComponentLoader: autoregistering succeeded
    nNCL: registering deferred (0)
    GFX: dpi=96 t2p=0.0666667 p2t=15 depth=24
    WEBSHELL+ = 1
   
IsPluginFile(/home/bstell/work/moz/v1/mozilla/modules/plugin/default/unix/libnullplugin.so)
    LoadPlugin()
/home/bstell/work/moz/v1/mozilla/modules/plugin/default/unix/libnullplugin.so 
    returned 8183558
    debug: edburns ns4xPlugin::CreatePlugin
    debug: edburns ns4xPlugin::CreatePlugin: cleared callbacks
    debug: edburns: ns4xPlugin::CreatePlugin: callbacks->newstream:
0x41181c38
    plugin getvalue 1 called
    plugin getvalue 2 called
    plugin getmimedescription called
    GetMIMEDescription() returned "*:.*:All types"
    Registering plugin for: "*","All types",".*"
    Initialized app shell component
{18c2f989-b09f-11d2-bcde-00805f0e1353}, rv=0x00000000
    Initialized app shell component
{33e569b0-40f8-11d4-9a41-000064657374}, rv=0x00000000
    ProfileName : default
    ProfileDir  : /home/bstell/.mozilla/default
    CSSLoaderImpl::LoadAgentSheet: Load of URL
'file:///home/bstell/.mozilla/default/chrome/use
    rChrome.css' failed.  Error code: 16389
    CSSLoaderImpl::LoadAgentSheet: Load of URL
'file:///home/bstell/.mozilla/default/chrome/use
    rContent.css' failed.  Error code: 16389
    WEBSHELL+ = 2
    Enabling Quirk StyleSheet
    Note: verifyreflow is disabled
    Note: styleverifytree is disabled
    Note: frameverifytree is disabled
    WARNING: waaah!, file nsXULPrototypeDocument.cpp, line 523
    JavaScript strict warning: 
    chrome://communicator/content/bookmarks/bookmarks.js line 960:
redeclaration of var cmd
    
    WARNING: waaah!, file nsXULPrototypeDocument.cpp, line 523
    JavaScript strict warning: 
    chrome://communicator/content/bookmarks/bookmarks.js line 962:
redeclaration of var cmdReso
    urce
    
    WARNING: waaah!, file nsXULPrototypeDocument.cpp, line 523
    JavaScript strict warning: 
    chrome://navigator/content/navigator.js line 1518: function
readFromClipboard does not alwa
    ys return a value
    
    Start reading in bookmarks.html
    Finished reading in bookmarks.html  (735539 microseconds)
    WARNING: waaah!, file nsXULPrototypeDocument.cpp, line 523
    JavaScript strict warning: 
    chrome://communicator/content/builtinURLs.js line 96: redeclaration
of var ds_uri
    
    WEBSHELL+ = 3
    Enabling Quirk StyleSheet
    Setting content window
    *** Pulling out the charset
    JavaScript strict warning: 
    chrome://navigator/content/navigator.js line 433: reference to
undefined property window.ar
    guments[1]
    
    Loading page specified via openDialog
    Opening file cookperm.txt failed
    in SetSecurityButton
    Error loading URL http://www.mozilla.org/: 804b001e 
    we don't handle eBorderStyle_close yet... please fix me
    WEBSHELL+ = 4
    WARNING: not calling OnDataAvailable, file
nsAsyncStreamListener.cpp, line 403
    WARNING: waaah!, file nsXULPrototypeDocument.cpp, line 523
    JavaScript strict warning: 
    chrome://global/content/commonDialog.js line 122: redeclaration of
var containerID
    
    WARNING: waaah!, file nsXULPrototypeDocument.cpp, line 523
    JavaScript strict warning: 
    chrome://global/content/commonDialog.js line 122: redeclaration of
var fieldID
    
    WARNING: waaah!, file nsXULPrototypeDocument.cpp, line 523
    JavaScript strict warning: 
    chrome://global/content/commonDialog.js line 137: redeclaration of
var field
    
    JavaScript strict warning: 
    chrome://global/content/commonDialog.js line 30: assignment to
undeclared variable param
    
    WEBSHELL+ = 5
    WARNING: waaah!, file nsXULPrototypeDocument.cpp, line 523
    JavaScript strict warning: 
    chrome://communicator/content/bookmarks/bm-panel.js line 122:
function OpenBookmarkURL does
     not always return a value
    
    WARNING: waaah!, file nsXULPrototypeDocument.cpp, line 523
    JavaScript strict warning: 
    chrome://communicator/content/bookmarks/bookmarks.js line 960:
redeclaration of var cmd
    
    WARNING: waaah!, file nsXULPrototypeDocument.cpp, line 523
    JavaScript strict warning: 
    chrome://communicator/content/bookmarks/bookmarks.js line 962:
redeclaration of var cmdReso
    urce
    
    WARNING: waaah!, file nsXULPrototypeDocument.cpp, line 523
    JavaScript strict warning: 
    chrome://communicator/content/bookmarks/bookmarksDD.js line 323:
redeclaration of var data
    
    WARNING: waaah!, file nsXULPrototypeDocument.cpp, line 523
    JavaScript strict warning: 
    chrome://communicator/content/bookmarks/bookmarksDD.js line 453:
redeclaration of var nodeI
    ndex
    
    nsWidget::~nsWidget() of toplevel: 11 widgets still exist.
    WEBSHELL- = 4
    JavaScript strict warning: 
     line 9: function onget does not always return a value
    
    JavaScript strict warning: 
     line 9: function onset does not always return a value

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

* Re: Insight freezes when trying to debug Mozilla
  2000-10-01  9:49 Insight freezes when trying to debug Mozilla bstell
@ 2000-10-03 13:36 ` Fernando Nasser
  2000-10-03 22:28   ` bstell
  0 siblings, 1 reply; 8+ messages in thread
From: Fernando Nasser @ 2000-10-03 13:36 UTC (permalink / raw)
  To: bstell; +Cc: insight

bstell@ix.netcom.com wrote:
> 
> I'm trying to debug Mozilla using Insight.
> 
> When I run mozilla with the debug option the insight debugger comes
> up and lets me start mozilla. I click the run button and it starts
> and then does a break at main. When I press continue mozilla comes
> up but insight never responds again (not screen refresh or button
> response.
> 

I don't know much about your setup (you may be better off posting to the
Mozzila list itself), but it seems that gdb is waiting for the a Mozzila
thread to stop and it never does. Use the second gdb "up" command and see
what is being done at  lin-lwp.c:766    I would guess it is a waitpid() call.
You could see what the pid is, maybe trying sending it a SIGINT...

The GUI hang because whoever wrote this wait for thread code did not include a 
call back to keep the GUI alive while waiting.

One thing I notice is that your line numbers are far off from the current
version of the Linux thread support files (lin-lwp.c, thread-db.c etc).
This may be an indication that there are fixes to these things that your
version of gdb does not have.  Maybe you could also try a recent gdb snapshot
(obtainable from sources.redhat.com).

Good luck,
Fernando


> I am running version 20000930 (/usr/local/bin/gdb).
> 
> I attached a second gdb to insight's gdb.
> Here is the output for the xterm where I was running gdb on gdb:
> =====================================================================
> 
>     [root@localhost gdb]# /usr/bin/gdb /usr/local/bin/gdb
>     GNU gdb 19991004
>     Copyright 1998 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 "i386-redhat-linux"...
>     Setting up the environment for debugging gdb.
>     Breakpoint 1 at 0x810a062: file utils.c, line 735.
>     Breakpoint 2 at 0x81074ff: file top.c, line 2897.
>     (top-gdb) attach 22239
>     Attaching to program: /usr/local/bin/gdb, Pid 22239
>     Reading symbols from /usr/lib/libncurses.so.4...done.
>     Reading symbols from /usr/X11R6/lib/libX11.so.6...done.
>     Reading symbols from /lib/libdl.so.2...done.
>     Reading symbols from /lib/libm.so.6...done.
>     Reading symbols from /lib/libc.so.6...done.
>     Reading symbols from /lib/ld-linux.so.2...done.
>     Reading symbols from /lib/libthread_db.so.1...done.
>     0x40140deb in __sigsuspend (set=0x83e36c0) at
> ../sysdeps/unix/sysv/linux/sigsuspend.c:48
>     48      ../sysdeps/unix/sysv/linux/sigsuspend.c: No such file or
> directory.
>     (top-gdb) bt
>     #0  0x40140deb in __sigsuspend (set=0x83e36c0) at
> ../sysdeps/unix/sysv/linux/sigsuspend.c:48
>     #1  0x80d1092 in lin_lwp_wait (pid=-1, ourstatus=0xbfffc074) at
> lin-lwp.c:766
>     #2  0x812dd11 in thread_db_wait (pid=-1, ourstatus=0xbfffc074) at
> thread-db.c:710
>     #3  0x80e1ad7 in gdbtk_wait (pid=-1, ourstatus=0xbfffc074) at
> ./gdbtk/generic/gdbtk-hooks.c:694
>     #4  0x80b269f in wait_for_inferior () at infrun.c:1286
>     #5  0x80b252c in proceed (addr=4294967295,
> siggnal=TARGET_SIGNAL_DEFAULT, step=0) at infrun.c:1085
>     #6  0x80afba3 in continue_command (proc_count_exp=0x0, from_tty=0)
> at infcmd.c:399
>     #7  0x80e1666 in gdbtk_call_command (cmdblk=0x8418140, arg=0x0,
> from_tty=0) at ./gdbtk/generic/gdbtk-hooks.c:513
>     #8  0x8105915 in execute_command (p=0x89a4310 "", from_tty=0) at
> top.c:1517
>     #9  0x80dadb5 in gdb_immediate_command (clientData=0x80dace4,
> interp=0x8424fb0, objc=2, objv=0x8425c68)
>         at ./gdbtk/generic/gdbtk-cmds.c:892
>     #10 0x80da888 in wrapped_call (opaque_args=0xbfffc284) at
> ./gdbtk/generic/gdbtk-cmds.c:536
>     #11 0x81048d9 in catch_errors (func=0x80da858 <wrapped_call>,
> args=0xbfffc284, errstring=0x8356883 "", mask=6)
>         at top.c:607
>     #12 0x80da78e in call_wrapper (clientData=0x80dace4,
> interp=0x8424fb0, objc=2, objv=0x8425c68)
>         at ./gdbtk/generic/gdbtk-cmds.c:474
>     #13 0x82ff5f9 in TclExecuteByteCode (interp=0x8424fb0,
> codePtr=0x8789528) at ./../generic/tclExecute.c:955
>     #14 0x82de521 in Tcl_EvalObj (interp=0x8424fb0, objPtr=0x853ccf8) at
> ./../generic/tclBasic.c:2645
>     #15 0x83297d1 in TclObjInterpProc (clientData=0x85a8d10,
> interp=0x8424fb0, objc=1, objv=0x8425c64)
>         at ./../generic/tclProc.c:996
>     #16 0x82ff5f9 in TclExecuteByteCode (interp=0x8424fb0,
> codePtr=0x89a4288) at ./../generic/tclExecute.c:955
>     #17 0x82de521 in Tcl_EvalObj (interp=0x8424fb0, objPtr=0x897ac40) at
> ./../generic/tclBasic.c:2645
>     #18 0x82eb10d in Tcl_SwitchObjCmd (dummy=0x0, interp=0x8424fb0,
> objc=3, objv=0x8425c58)
>     ---Type <return> to continue, or q <return> to quit---q
>      at ./../generic/tclCmdMZ.c:17Quit
>     (top-gdb)
> 
> Here is the output for the xterm where I was running mozilla:
> =====================================================================
> 
>     [bstell@localhost bin]$ ./mozilla -g 2>&1 | tee junk.mozilla.-g.log
>     ./run-mozilla.sh -g ./mozilla-bin
>     MOZILLA_FIVE_HOME=.
>       LD_LIBRARY_PATH=.
>          LIBRARY_PATH=.:./components
>            SHLIB_PATH=.
>               LIBPATH=.
>            ADDON_PATH=.
>           MOZ_PROGRAM=./mozilla-bin
>           MOZ_TOOLKIT=
>             moz_debug=1
>          moz_debugger=
>     which: no ddd in
> (/usr/local/bin:/bin:/usr/bin:/usr/X11R6/bin:/home/bstell/bin)
>     Type Manifest File:
> /home/bstell/work/moz/v1/mozilla/dist/bin/components/xpti.dat
>     nsNativeComponentLoader: autoregistering begins.
>     nsNativeComponentLoader: autoregistering succeeded
>     nNCL: registering deferred (0)
>     GFX: dpi=96 t2p=0.0666667 p2t=15 depth=24
>     WEBSHELL+ = 1
> 
> IsPluginFile(/home/bstell/work/moz/v1/mozilla/modules/plugin/default/unix/libnullplugin.so)
>     LoadPlugin()
> /home/bstell/work/moz/v1/mozilla/modules/plugin/default/unix/libnullplugin.so
>     returned 8183558
>     debug: edburns ns4xPlugin::CreatePlugin
>     debug: edburns ns4xPlugin::CreatePlugin: cleared callbacks
>     debug: edburns: ns4xPlugin::CreatePlugin: callbacks->newstream:
> 0x41181c38
>     plugin getvalue 1 called
>     plugin getvalue 2 called
>     plugin getmimedescription called
>     GetMIMEDescription() returned "*:.*:All types"
>     Registering plugin for: "*","All types",".*"
>     Initialized app shell component
> {18c2f989-b09f-11d2-bcde-00805f0e1353}, rv=0x00000000
>     Initialized app shell component
> {33e569b0-40f8-11d4-9a41-000064657374}, rv=0x00000000
>     ProfileName : default
>     ProfileDir  : /home/bstell/.mozilla/default
>     CSSLoaderImpl::LoadAgentSheet: Load of URL
> 'file:///home/bstell/.mozilla/default/chrome/use
>     rChrome.css' failed.  Error code: 16389
>     CSSLoaderImpl::LoadAgentSheet: Load of URL
> 'file:///home/bstell/.mozilla/default/chrome/use
>     rContent.css' failed.  Error code: 16389
>     WEBSHELL+ = 2
>     Enabling Quirk StyleSheet
>     Note: verifyreflow is disabled
>     Note: styleverifytree is disabled
>     Note: frameverifytree is disabled
>     WARNING: waaah!, file nsXULPrototypeDocument.cpp, line 523
>     JavaScript strict warning:
>     chrome://communicator/content/bookmarks/bookmarks.js line 960:
> redeclaration of var cmd
> 
>     WARNING: waaah!, file nsXULPrototypeDocument.cpp, line 523
>     JavaScript strict warning:
>     chrome://communicator/content/bookmarks/bookmarks.js line 962:
> redeclaration of var cmdReso
>     urce
> 
>     WARNING: waaah!, file nsXULPrototypeDocument.cpp, line 523
>     JavaScript strict warning:
>     chrome://navigator/content/navigator.js line 1518: function
> readFromClipboard does not alwa
>     ys return a value
> 
>     Start reading in bookmarks.html
>     Finished reading in bookmarks.html  (735539 microseconds)
>     WARNING: waaah!, file nsXULPrototypeDocument.cpp, line 523
>     JavaScript strict warning:
>     chrome://communicator/content/builtinURLs.js line 96: redeclaration
> of var ds_uri
> 
>     WEBSHELL+ = 3
>     Enabling Quirk StyleSheet
>     Setting content window
>     *** Pulling out the charset
>     JavaScript strict warning:
>     chrome://navigator/content/navigator.js line 433: reference to
> undefined property window.ar
>     guments[1]
> 
>     Loading page specified via openDialog
>     Opening file cookperm.txt failed
>     in SetSecurityButton
>     Error loading URL http://www.mozilla.org/: 804b001e
>     we don't handle eBorderStyle_close yet... please fix me
>     WEBSHELL+ = 4
>     WARNING: not calling OnDataAvailable, file
> nsAsyncStreamListener.cpp, line 403
>     WARNING: waaah!, file nsXULPrototypeDocument.cpp, line 523
>     JavaScript strict warning:
>     chrome://global/content/commonDialog.js line 122: redeclaration of
> var containerID
> 
>     WARNING: waaah!, file nsXULPrototypeDocument.cpp, line 523
>     JavaScript strict warning:
>     chrome://global/content/commonDialog.js line 122: redeclaration of
> var fieldID
> 
>     WARNING: waaah!, file nsXULPrototypeDocument.cpp, line 523
>     JavaScript strict warning:
>     chrome://global/content/commonDialog.js line 137: redeclaration of
> var field
> 
>     JavaScript strict warning:
>     chrome://global/content/commonDialog.js line 30: assignment to
> undeclared variable param
> 
>     WEBSHELL+ = 5
>     WARNING: waaah!, file nsXULPrototypeDocument.cpp, line 523
>     JavaScript strict warning:
>     chrome://communicator/content/bookmarks/bm-panel.js line 122:
> function OpenBookmarkURL does
>      not always return a value
> 
>     WARNING: waaah!, file nsXULPrototypeDocument.cpp, line 523
>     JavaScript strict warning:
>     chrome://communicator/content/bookmarks/bookmarks.js line 960:
> redeclaration of var cmd
> 
>     WARNING: waaah!, file nsXULPrototypeDocument.cpp, line 523
>     JavaScript strict warning:
>     chrome://communicator/content/bookmarks/bookmarks.js line 962:
> redeclaration of var cmdReso
>     urce
> 
>     WARNING: waaah!, file nsXULPrototypeDocument.cpp, line 523
>     JavaScript strict warning:
>     chrome://communicator/content/bookmarks/bookmarksDD.js line 323:
> redeclaration of var data
> 
>     WARNING: waaah!, file nsXULPrototypeDocument.cpp, line 523
>     JavaScript strict warning:
>     chrome://communicator/content/bookmarks/bookmarksDD.js line 453:
> redeclaration of var nodeI
>     ndex
> 
>     nsWidget::~nsWidget() of toplevel: 11 widgets still exist.
>     WEBSHELL- = 4
>     JavaScript strict warning:
>      line 9: function onget does not always return a value
> 
>     JavaScript strict warning:
>      line 9: function onset does not always return a value

-- 
Fernando Nasser
Red Hat - Toronto                       E-Mail:  fnasser@cygnus.com

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

* Re: Insight freezes when trying to debug Mozilla
  2000-10-03 13:36 ` Fernando Nasser
@ 2000-10-03 22:28   ` bstell
  2000-10-03 23:49     ` Fernando Nasser
  0 siblings, 1 reply; 8+ messages in thread
From: bstell @ 2000-10-03 22:28 UTC (permalink / raw)
  To: Fernando Nasser; +Cc: insight

Thank you for the reply.

Fernando Nasser wrote:
> 
> bstell@ix.netcom.com wrote:
> >
> > I'm trying to debug Mozilla using Insight.
> >
> > When I run mozilla with the debug option the insight debugger comes
> > up and lets me start mozilla. I click the run button and it starts
> > and then does a break at main. When I press continue mozilla comes
> > up but insight never responds again (not screen refresh or button
> > response.
> >
> 
> I don't know much about your setup (you may be better off posting to the
> Mozzila list itself),

I am confused: Why would I post to the Mozilla list about insight
hanging?

> but it seems that gdb is waiting for the a Mozzila
> thread to stop and it never does. 

This seems to imply that the debugger depends on the application helping
the debugger. 

> Use the second gdb "up" command and see
> what is being done at  lin-lwp.c:766    I would guess it is a waitpid() call.
> You could see what the pid is, maybe trying sending it a SIGINT...

Line 766 of lin-lwp.c is calling sigsuspend().

> 
> The GUI hang because whoever wrote this wait for thread code did not include a
> call back to keep the GUI alive while waiting.
> 
> One thing I notice is that your line numbers are far off from the current
> version of the Linux thread support files (lin-lwp.c, thread-db.c etc).
> This may be an indication that there are fixes to these things that your
> version of gdb does not have.  Maybe you could also try a recent gdb snapshot
> (obtainable from sources.redhat.com).

For this test/message I downloaded/build/installed
"insight+dejagnu-20000930.tar.bz2" 
which build and installed a new gdb. 

This download included lin-lwp.c and thread-db.c which were compiled and
linked into the new gdb.

Do you think they are out of data or did you means something different?

> 
> Good luck,
> Fernando
> 
> > I am running version 20000930 (/usr/local/bin/gdb).
> >
> > I attached a second gdb to insight's gdb.
> > Here is the output for the xterm where I was running gdb on gdb:
> > =====================================================================
> >
> >     [root@localhost gdb]# /usr/bin/gdb /usr/local/bin/gdb
> >     GNU gdb 19991004
> >     Copyright 1998 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 "i386-redhat-linux"...
> >     Setting up the environment for debugging gdb.
> >     Breakpoint 1 at 0x810a062: file utils.c, line 735.
> >     Breakpoint 2 at 0x81074ff: file top.c, line 2897.
> >     (top-gdb) attach 22239
> >     Attaching to program: /usr/local/bin/gdb, Pid 22239
> >     Reading symbols from /usr/lib/libncurses.so.4...done.
> >     Reading symbols from /usr/X11R6/lib/libX11.so.6...done.
> >     Reading symbols from /lib/libdl.so.2...done.
> >     Reading symbols from /lib/libm.so.6...done.
> >     Reading symbols from /lib/libc.so.6...done.
> >     Reading symbols from /lib/ld-linux.so.2...done.
> >     Reading symbols from /lib/libthread_db.so.1...done.
> >     0x40140deb in __sigsuspend (set=0x83e36c0) at
> > ../sysdeps/unix/sysv/linux/sigsuspend.c:48
> >     48      ../sysdeps/unix/sysv/linux/sigsuspend.c: No such file or
> > directory.
> >     (top-gdb) bt
> >     #0  0x40140deb in __sigsuspend (set=0x83e36c0) at
> > ../sysdeps/unix/sysv/linux/sigsuspend.c:48
> >     #1  0x80d1092 in lin_lwp_wait (pid=-1, ourstatus=0xbfffc074) at
> > lin-lwp.c:766
> >     #2  0x812dd11 in thread_db_wait (pid=-1, ourstatus=0xbfffc074) at
> > thread-db.c:710
> >     #3  0x80e1ad7 in gdbtk_wait (pid=-1, ourstatus=0xbfffc074) at
> > ./gdbtk/generic/gdbtk-hooks.c:694
> >     #4  0x80b269f in wait_for_inferior () at infrun.c:1286
> >     #5  0x80b252c in proceed (addr=4294967295,
> > siggnal=TARGET_SIGNAL_DEFAULT, step=0) at infrun.c:1085
> >     #6  0x80afba3 in continue_command (proc_count_exp=0x0, from_tty=0)
> > at infcmd.c:399
> >     #7  0x80e1666 in gdbtk_call_command (cmdblk=0x8418140, arg=0x0,
> > from_tty=0) at ./gdbtk/generic/gdbtk-hooks.c:513
> >     #8  0x8105915 in execute_command (p=0x89a4310 "", from_tty=0) at
> > top.c:1517
> >     #9  0x80dadb5 in gdb_immediate_command (clientData=0x80dace4,
> > interp=0x8424fb0, objc=2, objv=0x8425c68)
> >         at ./gdbtk/generic/gdbtk-cmds.c:892
> >     #10 0x80da888 in wrapped_call (opaque_args=0xbfffc284) at
> > ./gdbtk/generic/gdbtk-cmds.c:536
> >     #11 0x81048d9 in catch_errors (func=0x80da858 <wrapped_call>,
> > args=0xbfffc284, errstring=0x8356883 "", mask=6)
> >         at top.c:607
> >     #12 0x80da78e in call_wrapper (clientData=0x80dace4,
> > interp=0x8424fb0, objc=2, objv=0x8425c68)
> >         at ./gdbtk/generic/gdbtk-cmds.c:474
> >     #13 0x82ff5f9 in TclExecuteByteCode (interp=0x8424fb0,
> > codePtr=0x8789528) at ./../generic/tclExecute.c:955
> >     #14 0x82de521 in Tcl_EvalObj (interp=0x8424fb0, objPtr=0x853ccf8) at
> > ./../generic/tclBasic.c:2645
> >     #15 0x83297d1 in TclObjInterpProc (clientData=0x85a8d10,
> > interp=0x8424fb0, objc=1, objv=0x8425c64)
> >         at ./../generic/tclProc.c:996
> >     #16 0x82ff5f9 in TclExecuteByteCode (interp=0x8424fb0,
> > codePtr=0x89a4288) at ./../generic/tclExecute.c:955
> >     #17 0x82de521 in Tcl_EvalObj (interp=0x8424fb0, objPtr=0x897ac40) at
> > ./../generic/tclBasic.c:2645
> >     #18 0x82eb10d in Tcl_SwitchObjCmd (dummy=0x0, interp=0x8424fb0,
> > objc=3, objv=0x8425c58)
> >     ---Type <return> to continue, or q <return> to quit---q
> >      at ./../generic/tclCmdMZ.c:17Quit
> >     (top-gdb)
> >
> > Here is the output for the xterm where I was running mozilla:
> > =====================================================================
> >
> >     [bstell@localhost bin]$ ./mozilla -g 2>&1 | tee junk.mozilla.-g.log
> >     ./run-mozilla.sh -g ./mozilla-bin
> >     MOZILLA_FIVE_HOME=.
> >       LD_LIBRARY_PATH=.
> >          LIBRARY_PATH=.:./components
> >            SHLIB_PATH=.
> >               LIBPATH=.
> >            ADDON_PATH=.
> >           MOZ_PROGRAM=./mozilla-bin
> >           MOZ_TOOLKIT=
> >             moz_debug=1
> >          moz_debugger=
> >     which: no ddd in
> > (/usr/local/bin:/bin:/usr/bin:/usr/X11R6/bin:/home/bstell/bin)
> >     Type Manifest File:
> > /home/bstell/work/moz/v1/mozilla/dist/bin/components/xpti.dat
> >     nsNativeComponentLoader: autoregistering begins.
> >     nsNativeComponentLoader: autoregistering succeeded
> >     nNCL: registering deferred (0)
> >     GFX: dpi=96 t2p=0.0666667 p2t=15 depth=24
> >     WEBSHELL+ = 1
> >
> > IsPluginFile(/home/bstell/work/moz/v1/mozilla/modules/plugin/default/unix/libnullplugin.so)
> >     LoadPlugin()
> > /home/bstell/work/moz/v1/mozilla/modules/plugin/default/unix/libnullplugin.so
> >     returned 8183558
> >     debug: edburns ns4xPlugin::CreatePlugin
> >     debug: edburns ns4xPlugin::CreatePlugin: cleared callbacks
> >     debug: edburns: ns4xPlugin::CreatePlugin: callbacks->newstream:
> > 0x41181c38
> >     plugin getvalue 1 called
> >     plugin getvalue 2 called
> >     plugin getmimedescription called
> >     GetMIMEDescription() returned "*:.*:All types"
> >     Registering plugin for: "*","All types",".*"
> >     Initialized app shell component
> > {18c2f989-b09f-11d2-bcde-00805f0e1353}, rv=0x00000000
> >     Initialized app shell component
> > {33e569b0-40f8-11d4-9a41-000064657374}, rv=0x00000000
> >     ProfileName : default
> >     ProfileDir  : /home/bstell/.mozilla/default
> >     CSSLoaderImpl::LoadAgentSheet: Load of URL
> > 'file:///home/bstell/.mozilla/default/chrome/use
> >     rChrome.css' failed.  Error code: 16389
> >     CSSLoaderImpl::LoadAgentSheet: Load of URL
> > 'file:///home/bstell/.mozilla/default/chrome/use
> >     rContent.css' failed.  Error code: 16389
> >     WEBSHELL+ = 2
> >     Enabling Quirk StyleSheet
> >     Note: verifyreflow is disabled
> >     Note: styleverifytree is disabled
> >     Note: frameverifytree is disabled
> >     WARNING: waaah!, file nsXULPrototypeDocument.cpp, line 523
> >     JavaScript strict warning:
> >     chrome://communicator/content/bookmarks/bookmarks.js line 960:
> > redeclaration of var cmd
> >
> >     WARNING: waaah!, file nsXULPrototypeDocument.cpp, line 523
> >     JavaScript strict warning:
> >     chrome://communicator/content/bookmarks/bookmarks.js line 962:
> > redeclaration of var cmdReso
> >     urce
> >
> >     WARNING: waaah!, file nsXULPrototypeDocument.cpp, line 523
> >     JavaScript strict warning:
> >     chrome://navigator/content/navigator.js line 1518: function
> > readFromClipboard does not alwa
> >     ys return a value
> >
> >     Start reading in bookmarks.html
> >     Finished reading in bookmarks.html  (735539 microseconds)
> >     WARNING: waaah!, file nsXULPrototypeDocument.cpp, line 523
> >     JavaScript strict warning:
> >     chrome://communicator/content/builtinURLs.js line 96: redeclaration
> > of var ds_uri
> >
> >     WEBSHELL+ = 3
> >     Enabling Quirk StyleSheet
> >     Setting content window
> >     *** Pulling out the charset
> >     JavaScript strict warning:
> >     chrome://navigator/content/navigator.js line 433: reference to
> > undefined property window.ar
> >     guments[1]
> >
> >     Loading page specified via openDialog
> >     Opening file cookperm.txt failed
> >     in SetSecurityButton
> >     Error loading URL http://www.mozilla.org/: 804b001e
> >     we don't handle eBorderStyle_close yet... please fix me
> >     WEBSHELL+ = 4
> >     WARNING: not calling OnDataAvailable, file
> > nsAsyncStreamListener.cpp, line 403
> >     WARNING: waaah!, file nsXULPrototypeDocument.cpp, line 523
> >     JavaScript strict warning:
> >     chrome://global/content/commonDialog.js line 122: redeclaration of
> > var containerID
> >
> >     WARNING: waaah!, file nsXULPrototypeDocument.cpp, line 523
> >     JavaScript strict warning:
> >     chrome://global/content/commonDialog.js line 122: redeclaration of
> > var fieldID
> >
> >     WARNING: waaah!, file nsXULPrototypeDocument.cpp, line 523
> >     JavaScript strict warning:
> >     chrome://global/content/commonDialog.js line 137: redeclaration of
> > var field
> >
> >     JavaScript strict warning:
> >     chrome://global/content/commonDialog.js line 30: assignment to
> > undeclared variable param
> >
> >     WEBSHELL+ = 5
> >     WARNING: waaah!, file nsXULPrototypeDocument.cpp, line 523
> >     JavaScript strict warning:
> >     chrome://communicator/content/bookmarks/bm-panel.js line 122:
> > function OpenBookmarkURL does
> >      not always return a value
> >
> >     WARNING: waaah!, file nsXULPrototypeDocument.cpp, line 523
> >     JavaScript strict warning:
> >     chrome://communicator/content/bookmarks/bookmarks.js line 960:
> > redeclaration of var cmd
> >
> >     WARNING: waaah!, file nsXULPrototypeDocument.cpp, line 523
> >     JavaScript strict warning:
> >     chrome://communicator/content/bookmarks/bookmarks.js line 962:
> > redeclaration of var cmdReso
> >     urce
> >
> >     WARNING: waaah!, file nsXULPrototypeDocument.cpp, line 523
> >     JavaScript strict warning:
> >     chrome://communicator/content/bookmarks/bookmarksDD.js line 323:
> > redeclaration of var data
> >
> >     WARNING: waaah!, file nsXULPrototypeDocument.cpp, line 523
> >     JavaScript strict warning:
> >     chrome://communicator/content/bookmarks/bookmarksDD.js line 453:
> > redeclaration of var nodeI
> >     ndex
> >
> >     nsWidget::~nsWidget() of toplevel: 11 widgets still exist.
> >     WEBSHELL- = 4
> >     JavaScript strict warning:
> >      line 9: function onget does not always return a value
> >
> >     JavaScript strict warning:
> >      line 9: function onset does not always return a value
> 
> --
> Fernando Nasser
> Red Hat - Toronto                       E-Mail:  fnasser@cygnus.com

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

* Re: Insight freezes when trying to debug Mozilla
  2000-10-03 22:28   ` bstell
@ 2000-10-03 23:49     ` Fernando Nasser
       [not found]       ` <39DADB70.EBD7725@ix.netcom.com>
  0 siblings, 1 reply; 8+ messages in thread
From: Fernando Nasser @ 2000-10-03 23:49 UTC (permalink / raw)
  To: bstell; +Cc: insight

bstell@ix.netcom.com wrote:
> 
> Thank you for the reply.
> 
> Fernando Nasser wrote:
> >
> > bstell@ix.netcom.com wrote:
> > >
> > > I'm trying to debug Mozilla using Insight.
> > >
> > > When I run mozilla with the debug option the insight debugger comes
> > > up and lets me start mozilla. I click the run button and it starts
> > > and then does a break at main. When I press continue mozilla comes
> > > up but insight never responds again (not screen refresh or button
> > > response.
> > >
> >
> > I don't know much about your setup (you may be better off posting to the
> > Mozzila list itself),
> 
> I am confused: Why would I post to the Mozilla list about insight
> hanging?
> 

This mechanism for starting-up gdb from Mozilla was created by someone in there.
We don't know anything about it.  And whoever has created such connection must
have some experience in debugging Mozilla with gdb.

> > but it seems that gdb is waiting for the a Mozzila
> > thread to stop and it never does.
> 
> This seems to imply that the debugger depends on the application helping
> the debugger.
> 

That is not what I said.  But if the application never stops no debugger will ever
regain control unless you do something to halt it.  Unfortunately the STOP button
is dead because the Linux thread code fails to keep the GUI alive (a bug in that code,
at least for Insight purposes -- I will tell people on the gdb list about this).

If you know of some other point in the Mozzila code that will be certainly executed,
try inserting a breakpoint there before saying continue.  See if the GUI regains control
when that breakpoint is reached.

> > Use the second gdb "up" command and see
> > what is being done at  lin-lwp.c:766    I would guess it is a waitpid() call.
> > You could see what the pid is, maybe trying sending it a SIGINT...
> 
> Line 766 of lin-lwp.c is calling sigsuspend().
> 

This is different from what I have.  But 9/30 seems newer than mine (and probably
more correct).  There is probably nothing else wrong with that code besides the
fact that it is not keeping the GUI alive while the program being debugged is
running.  I did not notice the first time around that you just pressed CONTINUE
without any breakpoint inserted (so there is no reason for the inferior to stop
and for the debugger to regain control).



-- 
Fernando Nasser
Red Hat Canada Ltd.                     E-Mail:  fnasser@cygnus.com
2323 Yonge Street, Suite #300           Tel:  416-482-2661 ext. 311
Toronto, Ontario   M4P 2C9              Fax:  416-482-6299

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

* Re: Insight freezes when trying to debug Mozilla
       [not found]       ` <39DADB70.EBD7725@ix.netcom.com>
@ 2000-10-04  0:33         ` Fernando Nasser
  2000-10-04 10:51           ` bstell
  0 siblings, 1 reply; 8+ messages in thread
From: Fernando Nasser @ 2000-10-04  0:33 UTC (permalink / raw)
  To: bstell; +Cc: insight

bstell@ix.netcom.com wrote:
> 
> Fernando Nasser wrote:
> > ...
> >
> > This mechanism for starting-up gdb from Mozilla was created by someone in there.
> > We don't know anything about it.  And whoever has created such connection must
> > have some experience in debugging Mozilla with gdb.
> 
> There is a shell scrip that starts gdb debugging mozilla.
> I use this script to run gdb (non-insight) on mozilla all the time and
> it work fine.
> 

Cool!

> > ....  Unfortunately the STOP button
> > is dead because the Linux thread code fails to keep the GUI alive (a bug in that code,
> > at least for Insight purposes -- I will tell people on the gdb list about this).
> 
> This is the part I care about. Thanks.
> 

You're welcome.

> > If you know of some other point in the Mozzila code that will be certainly executed,
> > try inserting a breakpoint there before saying continue.  See if the GUI regains control
> > when that breakpoint is reached.
> 
> I have tested this and it does work.
> 

OK, so the "not keeping the GUI alive" is the problem.

> > > > Use the second gdb "up" command and see
> > > > what is being done at  lin-lwp.c:766    I would guess it is a waitpid() call.
> > > > You could see what the pid is, maybe trying sending it a SIGINT...
> > >
> > > Line 766 of lin-lwp.c is calling sigsuspend().
> 
> I replaced the sigsuspend() call with a "sleep(1)" but this also never
> returns.
> 

That won't do it.  I will ask the Linux threads maintainer to add a call to the GUI
event loop.

Thanks for letting us know that this was broken.


-- 
Fernando Nasser
Red Hat Canada Ltd.                     E-Mail:  fnasser@cygnus.com
2323 Yonge Street, Suite #300           Tel:  416-482-2661 ext. 311
Toronto, Ontario   M4P 2C9              Fax:  416-482-6299

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

* Re: Insight freezes when trying to debug Mozilla
  2000-10-04  0:33         ` Fernando Nasser
@ 2000-10-04 10:51           ` bstell
  2000-10-04 10:56             ` Fernando Nasser
  0 siblings, 1 reply; 8+ messages in thread
From: bstell @ 2000-10-04 10:51 UTC (permalink / raw)
  To: Fernando Nasser; +Cc: insight

Fernando Nasser wrote:
> ...
> > > ....  Unfortunately the STOP button
> > > is dead because the Linux thread code fails to keep the GUI alive (a bug in that code,
> > > at least for Insight purposes -- I will tell people on the gdb list about this).

Could you tell me the name of the "gdb list"?

> >
> > This is the part I care about. Thanks.
> >
> 
> You're welcome.

If I send a SIGSTOP to mozilla when the insight GUI freezes then 
mozilla stops and Insight unfreezes and reports a SIGSTP.

It appears I can debug after this.

This appears to be a work around. Thanks.

> OK, so the "not keeping the GUI alive" is the problem.
> 
> > > > > Use the second gdb "up" command and see
> > > > > what is being done at  lin-lwp.c:766    I would guess it is a waitpid() call.
> > > > > You could see what the pid is, maybe trying sending it a SIGINT...
> > > >
> > > > Line 766 of lin-lwp.c is calling sigsuspend().
> >

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

* Re: Insight freezes when trying to debug Mozilla
  2000-10-04 10:51           ` bstell
@ 2000-10-04 10:56             ` Fernando Nasser
  2000-10-04 11:01               ` Syd Polk
  0 siblings, 1 reply; 8+ messages in thread
From: Fernando Nasser @ 2000-10-04 10:56 UTC (permalink / raw)
  To: bstell; +Cc: insight

bstell@ix.netcom.com wrote:
> 
> Fernando Nasser wrote:
> > ...
> > > > ....  Unfortunately the STOP button
> > > > is dead because the Linux thread code fails to keep the GUI alive (a bug in that code,
> > > > at least for Insight purposes -- I will tell people on the gdb list about this).
> 
> Could you tell me the name of the "gdb list"?
> 

Sure.   gdb@sourceware.cygnus.com

I'm glad you are able to proceed with your debugging now.  I am trying to find
someone to get this blocking thing solved.

Regards.


-- 
Fernando Nasser
Red Hat - Toronto                       E-Mail:  fnasser@redhat.com
2323 Yonge Street, Suite #300
Toronto, Ontario   M4P 2C9

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

* Re: Insight freezes when trying to debug Mozilla
  2000-10-04 10:56             ` Fernando Nasser
@ 2000-10-04 11:01               ` Syd Polk
  0 siblings, 0 replies; 8+ messages in thread
From: Syd Polk @ 2000-10-04 11:01 UTC (permalink / raw)
  To: Fernando Nasser, bstell; +Cc: insight

At 01:56 PM 10/4/00 -0400, Fernando Nasser wrote:
>bstell@ix.netcom.com wrote:
> >
> > Fernando Nasser wrote:
> > > ...
> > > > > ....  Unfortunately the STOP button
> > > > > is dead because the Linux thread code fails to keep the GUI alive 
> (a bug in that code,
> > > > > at least for Insight purposes -- I will tell people on the gdb 
> list about this).
> >
> > Could you tell me the name of the "gdb list"?
> >
>
>Sure.   gdb@sourceware.cygnus.com

Actually, it's now gdb@sources.redhat.com. sourceware.cygnus.com will still 
work.


Syd Polk		spolk@redhat.com
Engineering Manager	+1 415 777 9810 x 241
Red Hat, Inc.



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

end of thread, other threads:[~2000-10-04 11:01 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-10-01  9:49 Insight freezes when trying to debug Mozilla bstell
2000-10-03 13:36 ` Fernando Nasser
2000-10-03 22:28   ` bstell
2000-10-03 23:49     ` Fernando Nasser
     [not found]       ` <39DADB70.EBD7725@ix.netcom.com>
2000-10-04  0:33         ` Fernando Nasser
2000-10-04 10:51           ` bstell
2000-10-04 10:56             ` Fernando Nasser
2000-10-04 11:01               ` Syd Polk

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).