Re: The ls command
- To: debian-user@lists.debian.org
- Subject: Re: The ls command
- From: Vincent Lefevre <vincent@vinc17.net>
- Date: Sat, 1 Nov 2025 11:46:07 +0100
- Message-id: <[🔎] 20251101104607.GA1128921@qaa.vinc17.org>
- Mail-followup-to: debian-user@lists.debian.org
- In-reply-to: <CAMPXz=pYo9UpwrvvqfL-USO3Lbb3a7LB-z=t=bSF8Gbx9UL57A@mail.gmail.com>
- References: <CAN+UU9peV-khbsakCcO+VMtAMo3Vki_mxnDFLtm9ebwn=SSiyA@mail.gmail.com> <aQOi1U8bqKy9k0SG@phcomp.co.uk> <20251031032606.GC957218@qaa.vinc17.org> <20251031034354.GK29520@wooledge.org> <CAMPXz=rUdJtvVRqLMtyuZyiJpuvNyAMxpkJt3Y7q5QsZbG0NKw@mail.gmail.com> <20251031133344.GA123970@cventin.lip.ens-lyon.fr> <aQS8sMMCSDOrnVf9@phare.normalesup.org> <CAPU_E+eT47-rzn+hAxFMeHawMLnX_wjwREMNHZj3t_bdQ+V=uQ@mail.gmail.com> <20251031174312.GB1029201@qaa.vinc17.org> <CAMPXz=pYo9UpwrvvqfL-USO3Lbb3a7LB-z=t=bSF8Gbx9UL57A@mail.gmail.com>
On 2025-10-31 21:31:32 +0000, David wrote:
> On Fri, 31 Oct 2025 at 17:43, Vincent Lefevre <vincent@vinc17.net> wrote:
> > And one can make xterm on trixie (not that old) crash:
>
> > xterm -k8 -e 'printf "\x9a\x85\x08"; sleep 2'
>
> Thanks for the runnable demo!
[...]
> When I copied and pasted the above into vim to write this message, I can
> see that the 'echo *' did output the bytes <9a><85>. I guess there might
> have also been a bell <08> that I did not hear (for whatever reason, that's
> not important).
It is the bell character, but it ends an escape sequence, i.e. it
has a special meaning.
> But the xterm did not crash, it continued to function.
Not sure whether you did it right, but to make the crash occurs
depends on the context.
> So that made your demo less convincing to me, I was hoping it would crash.
>
> Do you have a better example?
Perhaps something like an escape sequence to clear the screen first
(just before the \x9a\x85\x08). I have not tried.
> Why did you choose the bytes \x9a\x85\x08 ?
The bug initially occurred when I ran a command generating binary
data for which I forgot to redirect the output to a file. The file
was initially huge (several MB, IIRC). Then I tried to get a minimal
example. To make things easier, I did my tests with something like
xterm -e 'cat file'
(the -k8 is not needed for me since this is from my default config
via X resources -- I had added it in 2005 for more security, at the
time ISO-8859-1 was still in use, to prevent the characters 128-159
from being regarded as control characters).
I think that the "sleep 2" was not needed initially because there
were additional characters from the file that were introducing the
needed delay. In a text editor, I reduced the file with some form
of dichotomy, and eventually obtained a file reduced to the above
3 characters.
--
Vincent Lefèvre <vincent@vinc17.net> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / Pascaline project (LIP, ENS-Lyon)
Reply to: