Re: Bug in xterm?

2004-11-28 Thread Brian Candler
- Forwarded message from Andy Farkas [EMAIL PROTECTED] -

--
$ perl -mDigest::MD5 -e 'print pack(H*,Digest::MD5::md5(test))' ert
$ wc ert
 0   1   8 ert
$ hexdump -C ert
  9f 4d f1 3c ae 73 67 46   |.M..sgF|
0008
$ cat ert

At this point it hangs; sending ^Q doesn't help. But if you press cursor-up
a few times it comes back to life.
...

Oddly, a real vt220 would do the same thing, but neither has any use for
the content of the string.

A real VT220 does NOT hang. It prints Mn?sgF (the n has a ~ on top,
and the ? is backwards). I get a prompt back straight away, and everything
stays normal.

-andyf

(you may post this to the list)

- End forwarded message -
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: Bug in xterm?

2004-11-27 Thread Brian Candler
On Sat, Nov 27, 2004 at 11:52:15AM +1100, Edwin Groothuis wrote:
 [~] [EMAIL PROTECTED]perl -mDigest::MD5 -e 'print 
 pack(H*,Digest::MD5::md5(test))' | hexdump -C
   9f 4d f1 3c ae 73 67 46   |.M..sgF|
 
 This shows that it outputs some high-ascii data, which causes the
 xterm to stop output. If you do echo hi  /tmp/aaa while in this
 state (be alert for typos), you see that it still accepts commands,
 but doesn't show them anymore.

Thanks. I got a nice analysis off-list:

--
$ perl -mDigest::MD5 -e 'print pack(H*,Digest::MD5::md5(test))' ert
$ wc ert
  0   1   8 ert
$ hexdump -C ert
  9f 4d f1 3c ae 73 67 46   |.M..sgF|
0008
$ cat ert

At this point it hangs; sending ^Q doesn't help. But if you press cursor-up
a few times it comes back to life.

It must be a strange escape sequence if typing characters and hitting Return
lots of times is not enough to bring it back to life. I suppose it's
technically not an escape sequence, since it doesn't include 0x1B :-)

0x9f is APC - which begins a string.  Technically it's only terminated by
a ST (0x9c or ESC followed by backslash), but xterm also accepts a BEL,
which may be what's emitted when you do a few uparrows (getting an error
response from the shell).  There's also a resource setting to work around
some Linux junk (hardcoded applications with malformed sequences) that
can make it terminate on a carriage return.  But generally, it would look
as if it's hung.

(A soft-reset would fix the problem with less damage to your session).

Oddly, a real vt220 would do the same thing, but neither has any use for
the content of the string.
--

I guess I wasn't expecting any escape sequence which consumed an infinite
number of characters - and presumably also, Konsole implements a different
terminal emulation (or implements vt220 wrongly).

Cheers,

Brian.
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to [EMAIL PROTECTED]


Bug in xterm?

2004-11-26 Thread Brian Candler
I can cause xterm to hang reliably with the following command:

  perl -mDigest::MD5 -e 'print pack(H*,Digest::MD5::md5(test))'

A control-middlebutton-Do Full Reset is needed to get out of this state.

Konsole doesn't have this problem (but Konsole takes too much screen
real-estate). Anyway, just thought it was worth a mention...

Regards,

Brian.
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: Bug in xterm?

2004-11-26 Thread Edwin Groothuis
On Fri, Nov 26, 2004 at 02:07:51PM +, Brian Candler wrote:
 I can cause xterm to hang reliably with the following command:
 
   perl -mDigest::MD5 -e 'print pack(H*,Digest::MD5::md5(test))'
 
 A control-middlebutton-Do Full Reset is needed to get out of this state.

It's not a bug in xterm on itself. If you cat a binary file you
might end up in the same situation.

[~] [EMAIL PROTECTED]perl -mDigest::MD5 -e 'print 
pack(H*,Digest::MD5::md5(test))' | hexdump -C
  9f 4d f1 3c ae 73 67 46   |.M..sgF|

This shows that it outputs some high-ascii data, which causes the
xterm to stop output. If you do echo hi  /tmp/aaa while in this
state (be alert for typos), you see that it still accepts commands,
but doesn't show them anymore.

In other words, don't worry too much about it but make sure you
redirect binary output to files or pipes and not the console.

Edwin

-- 
Edwin Groothuis  |Personal website: http://www.mavetju.org
[EMAIL PROTECTED]|  Weblog: http://weblog.barnet.com.au/edwin/
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to [EMAIL PROTECTED]