[350] in bug-owl

home help back first fref pref prev next nref lref last post

owl hung on me this morning

daemon@ATHENA.MIT.EDU (Chris Shabsin)
Tue Sep 14 10:20:54 2004

Message-ID: <4146FE19.3000100@mit.edu>
Date: Tue, 14 Sep 2004 10:20:09 -0400
From: Chris Shabsin <crs@MIT.EDU>
MIME-Version: 1.0
To: bug-owl@mit.edu
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

I was M-p'ing through history, hit a wrong key, and got owl to hang.  I 
attached to it in the debugger.

(gdb) where
#0  0x40227777 in strchr () from /lib/libc.so.6
#1  0x00000002 in ?? ()
#2  0x080684e1 in _owl_editwin_get_index_from_xy (e=0x80c0958) at 
editwin.c:483
#3  0x080689cf in owl_editwin_delete_nextword (e=0x80c0958) at editwin.c:712
#4  0x0807e149 in owl_cmd_execute (cmd=0x80d98f0, cd=0x80c08bc, 
ctx=0x80c08c8, argc=1,
    argv=0x8ffd3f0, cmdbuff=0x80e0260 "edit:delete-next-word") at cmd.c:186
#5  0x0807dd1a in owl_cmddict_execute (cd=0x80c08bc, ctx=0x80de2bc,
    cmdbuff=0x80e0260 "edit:delete-next-word") at cmd.c:79
#6  0x0806ff89 in owl_function_command (cmdbuff=0x80e0260 
"edit:delete-next-word")
    at functions.c:25
#7  0x0806ffb1 in owl_function_command_norv (
    cmdbuff=0x80de2bc "thanks.  guess i'll do that\n") at functions.c:32
#8  0x0807d690 in owl_keyhandler_process (kh=0x80c0820, j=228) at 
keymap.c:262
#9  0x0805cb20 in main (argc=135006156, argv=0xe4, env=0xbffff66c) at 
owl.c:667
(gdb) up
#1  0x00000002 in ?? ()
(gdb) up
#2  0x080684e1 in _owl_editwin_get_index_from_xy (e=0x80c0958) at 
editwin.c:483
483         ptr2=strchr(ptr1, '\n');
(gdb) list
478       if (e->bufflen==0) return(0);
479
480       /* first go to the yth line */
481       ptr1=e->buff;
482       for (i=0; i<e->buffy; i++) {
483         ptr2=strchr(ptr1, '\n');
484         if (!ptr2) {
485           /* we're already on the last line */
486           break;
487         }
(gdb) p ptr1
$1 = 0x80de2bc "thanks.  guess i'll do that\n"
(gdb) list
488         ptr1=ptr2+1;
489       }
490
491       /* now go to the xth character */
492       ptr2=strchr(ptr1, '\n'); 
493       if (!ptr2) {
494         ptr2=e->buff+e->bufflen;
495       }
496
497       if ((ptr2-ptr1) < e->buffx) {
(gdb) n
Single stepping until exit from function strchr,
which has no line number information.
[Switching to Thread 16384 (LWP 17481)]
_owl_editwin_get_index_from_xy (e=0x80c0958) at editwin.c:484
484         if (!ptr2) {
(gdb)
482       for (i=0; i<e->buffy; i++) {
(gdb)
488         ptr1=ptr2+1;
(gdb) p i
$3 = 2
(gdb) p e
$4 = (owl_editwin *) 0x80c0958
(gdb) p e->buffy
$5 = 2
(gdb) p ptr1
$6 = 0x80de2bc "thanks.  guess i'll do that\n"
(gdb) p ptr2
$7 = 0xa0a0a0a <Address 0xa0a0a0a out of bounds>
(gdb) n
482       for (i=0; i<e->buffy; i++) {
(gdb)
492       ptr2=strchr(ptr1, '\n');
(gdb)
493       if (!ptr2) {
(gdb) p ptr2
$8 = 0xa0a0a0a <Address 0xa0a0a0a out of bounds>
(gdb) p ptr1
$9 = 0x80de2d8 ""
(gdb) n
492       ptr2=strchr(ptr1, '\n');
(gdb)
493       if (!ptr2) {
(gdb) p ptr2
$10 = 0x0
(gdb) n
494         ptr2=e->buff+e->bufflen;
(gdb) n
497       if ((ptr2-ptr1) < e->buffx) {
(gdb) p ptr2
$11 = 0x80de2d8 ""
(gdb) p ptr1
$12 = 0x80de2d8 ""
(gdb) p e->buffx
$13 = 0
(gdb) n
500         ptr1+=e->buffx;
(gdb) list
495       }
496
497       if ((ptr2-ptr1) < e->buffx) {
498         ptr1=ptr2-1;
499       } else {
500         ptr1+=e->buffx;
501       }
502
503       /* printf("DEBUG: index is %i\r\n", ptr1-e->buff); */
504       return(ptr1-e->buff);
(gdb) p ptr2
$14 = 0x80de2d8 ""
(gdb) p ptr1
$16 = 0x80de2d8 ""
(gdb) n
505     }
(gdb) n
owl_editwin_delete_nextword (e=0x80c0958) at editwin.c:713
713         if (e->buff[z+1]==' ' || e->buff[z+1]=='\n' || 
e->buff[z+1]=='\0') break;
(gdb) list
708       }
709
710       /* then nuke the next word */
711       while (1) {
712         z=_owl_editwin_get_index_from_xy(e);
713         if (e->buff[z+1]==' ' || e->buff[z+1]=='\n' || 
e->buff[z+1]=='\0') break;
714         owl_editwin_delete_char(e);
715       }
716       owl_editwin_delete_char(e);
717     }
(gdb) p e->buff
$17 = 0x80de2a8 "----> zwrite mccall\nthanks.  guess i'll do that\n"
(gdb) p z
$18 = 48
(gdb) p e->buff+z
$19 = 0x80de2d8 ""
(gdb) p e->buff+z+1
$20 = 0x80de2d9 "kery makes good muffins.\n"
(gdb) p z
$22 = 48
(gdb) p &z
Address requested for identifier "z" which is in register $edx
(gdb) set z=47
(gdb) p z
$24 = 47
(gdb) c
Continuing.

Make of this what you will.

-Chris

home help back first fref pref prev next nref lref last post