zsh-workers
 help / color / mirror / code / Atom feed
From: "Bart Schaefer" <schaefer@candle.brasslantern.com>
To: Brian Boonstra <boonstb@cmg.FCNBD.COM>, zsh-workers@sunsite.auc.dk
Subject: Re: BUG: doinsert() in NextStep/OpenStep 4.2
Date: Thu, 21 Oct 1999 17:55:06 +0000	[thread overview]
Message-ID: <991021175506.ZM14852@candle.brasslantern.com> (raw)
In-Reply-To: <199910211531.KAA17425@wo1203.cmg.FCNBD.COM>

On Oct 21, 10:31am, Brian Boonstra wrote:
} Subject: BUG: doinsert() in NextStep/OpenStep 4.2
}
} I typed "ls", got a listing, and then zsh hung.
} 
} First, I rebuilt with debugging symbols:
} 
}   % CC=/bin/cc ./configure --enable-zsh-debug
} 
} then I ran zsh.
} 
} 	In another window, I opened gdb, and attached.

So did you attach after zsh was hung (as in your first example)?  Or did
you attach first and then try to get zsh to hang?  And did it hang, or
did you get a crash of some kind?  I can't be sure from your gdb trace.

BTW, here's an update of my "gdbterm" script / autoloaded function,
which is specifically meant for running gdb on interactive programs like
shells and editors:

------
#! /bin/sh
xterm -title GDBterm -e sh -c 'exec xterm -e gdb --tty=`tty` '"$*"
------

} (gdb) p Meta
} No symbol "Meta" in current context.
} (gdb) p cs
} No symbol "cs" in current context.

"Meta" and "cs" are #define'd.  "Meta" is always 0x83, but "cs" expands
to "zshcs" everywhere except in the spot where "zshcs" is defined.  This
is a hack to get around some system libraries (curses?) that also define
a symbol "cs".

} Breakpoint 1, doinsert (str=0xbfffeea8 "l") at zle_misc.c:54
} 54                  line[cs++] = *s == Meta ? *++s ^ 32 : *s;
} (gdb) l
} 49              spaceinline(m * len);
} 50          else if(cs + m * len > ll)
} 51              spaceinline(cs + m * len - ll);
} 52          while(m--)
} 53              for(s = str; *s; s++)
} 54                  line[cs++] = *s == Meta ? *++s ^ 32 : *s;
} 55          if(neg)
} 56              cs += zmult * len;
} 57      }
} 58
} (gdb) p s
} $2 = 0xbfffeea8 "l"
} (gdb) p m
} $5 = 0

And if you continue from this point, what happens?

Since m == 0 and s[1] == 0 it looks as if it should exit the loop.  I
guess we need to see the value of "zshcs" (aka "cs") to see if it is -1
or some other bad index into line[].

} 3.0.x does not compile

Not even 3.0.7?  What's the failure, again?

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com


  reply	other threads:[~1999-10-21 17:55 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-10-21 15:31 Brian Boonstra
1999-10-21 17:55 ` Bart Schaefer [this message]
1999-10-21 19:28   ` Brian Boonstra
1999-10-21 21:12     ` Bart Schaefer
1999-10-21 22:06       ` Brian Boonstra

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=991021175506.ZM14852@candle.brasslantern.com \
    --to=schaefer@candle.brasslantern.com \
    --cc=boonstb@cmg.FCNBD.COM \
    --cc=zsh-workers@sunsite.auc.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

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 NNTP newsgroup(s).