Re: [hackers] [st][PATCH] remove secondary call to select

From: Hiltjo Posthuma <hiltjo_AT_codemadness.org>
Date: Fri, 28 Jun 2024 21:19:58 +0200

On Fri, Jun 28, 2024 at 11:36:20AM -0700, Jeremy wrote:
> On 06/28/24 10:52AM, Hiltjo Posthuma wrote:
> > Do you perhaps also have a way to easily reproduce this deadlock condition?
>
> I cannot reproduce the deadlock on my machine. All I want to do is
> simplify ttywrite & I'm trusting that the author of 261ea4b has actually
> seen this problem before.

OK

>
> This is the comment from 261ea4b which I believe implies a deadlock
> when using st over serial:
> ...
> * Remember that we are using a pty, which might be a modem line.
> * Writing too much will clog the line. That's why we are doing this
> * dance.
> * FIXME: Migrate the world to Plan 9.
> ...
>
> Assuming there is a deadlock when writing more than 255 bytes to a TTY
> over serial, then it's straightforward to reproduce. Just paste 256
> bytes in the terminal.
>
> NRK pointed out a regression in my patch, wherein nothing garantees that
> "`siz * 2` will make enough space for `n`", and this is correct, which is
> why it segfaults when pasting 512+ bytes(Thanks).
>
> I will rewrite the patch to address NRK's critique. Thank you for
> your reivew, NRK.
>
> All things considered, I am not opposed to making ttywrite do exactly
> what it says. What are your thoughts on this Hiltjo, NRK, Roberto?
>

I would really prefer a simplified test-case to at the very least be able to
reproduce it. And these parts of the code can be subtle and cause regressions.
If there is no test-case and considering I haven't heard real issues with this
it is likely I won't apply the change.

> Jeremy
>

-- 
Kind regards,
Hiltjo
Received on Fri Jun 28 2024 - 21:19:58 CEST

This archive was generated by hypermail 2.3.0 : Fri Jun 28 2024 - 21:24:37 CEST