NetBSD Problem Report #56647
From www@netbsd.org Thu Jan 20 16:18:08 2022
Return-Path: <www@netbsd.org>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits))
(Client CN "mail.NetBSD.org", Issuer "mail.NetBSD.org CA" (not verified))
by mollari.NetBSD.org (Postfix) with ESMTPS id DD77A1A9239
for <gnats-bugs@gnats.NetBSD.org>; Thu, 20 Jan 2022 16:18:07 +0000 (UTC)
Message-Id: <20220120161806.EB3A71A923A@mollari.NetBSD.org>
Date: Thu, 20 Jan 2022 16:18:06 +0000 (UTC)
From: walter.lozano@collabora.com
Reply-To: walter.lozano@collabora.com
To: gnats-bugs@NetBSD.org
Subject: Fix misbehaviour in libedit support for readline
X-Send-Pr-Version: www-1.0
>Number: 56647
>Category: lib
>Synopsis: Fix misbehaviour in libedit support for readline
>Confidential: no
>Severity: non-critical
>Priority: medium
>Responsible: lib-bug-people
>State: open
>Class: change-request
>Submitter-Id: net
>Arrival-Date: Thu Jan 20 16:20:00 +0000 2022
>Last-Modified: Mon Jan 31 13:15:01 +0000 2022
>Originator: Walter Lozano
>Release:
>Organization:
Collabora
>Environment:
>Description:
Currently libedit does not properly:
- Updates rl_point and rl_end when using callback
- Does not update the screen with buffer contents when using rl_redisplay
>How-To-Repeat:
>Fix:
A possible improvement is in the patch below.
The _rl_update_pos() seems to be required in the callback is order to be able to use functions like rl_copy_text() or rl_replace_line().
For the update part, I still don't understand the whole refresh process, but I think that the patch is a step in the right direction.
Index: readline.c
===================================================================
RCS file: /cvsroot/src/lib/libedit/readline.c,v
retrieving revision 1.169
diff -r1.169 readline.c
2151a2152
> _rl_update_pos();
2175a2177,2178
>
> rl_forced_update_display();
>Audit-Trail:
From: Christos Zoulas <christos@zoulas.com>
To: gnats-bugs@netbsd.org
Cc: lib-bug-people@netbsd.org,
gnats-admin@netbsd.org,
netbsd-bugs@netbsd.org
Subject: Re: lib/56647: Fix misbehaviour in libedit support for readline
Date: Sat, 22 Jan 2022 12:35:17 -0500
--Apple-Mail=_1043A9AA-0694-4C68-ACF4-DA26BA94C693
Content-Transfer-Encoding: 7bit
Content-Type: text/plain;
charset=us-ascii
Hi Walter,
Please submit patches with diff -u so we can get some context.
It would also be nice if you had a description how to reproduce the issue.
Anyway is this what you mean in your patch?
Thanks,
christos
Index: readline.c
===================================================================
RCS file: /cvsroot/src/lib/libedit/readline.c,v
retrieving revision 1.169
diff -u -p -u -r1.169 readline.c
--- readline.c 11 Jan 2022 18:30:15 -0000 1.169
+++ readline.c 22 Jan 2022 17:34:06 -0000
@@ -2149,6 +2149,7 @@ rl_callback_read_char(void)
wbuf = NULL;
(*(void (*)(const char *))rl_linefunc)(wbuf);
}
+ _rl_update_pos();
}
void
@@ -2176,6 +2177,7 @@ rl_redisplay(void)
a[0] = (char)e->el_tty.t_c[TS_IO][C_REPRINT];
a[1] = '\0';
el_push(e, a);
+ rl_forced_update_display();
}
int
--Apple-Mail=_1043A9AA-0694-4C68-ACF4-DA26BA94C693
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
filename=signature.asc
Content-Type: application/pgp-signature;
name=signature.asc
Content-Description: Message signed with OpenPGP
-----BEGIN PGP SIGNATURE-----
Comment: GPGTools - http://gpgtools.org
iF0EARECAB0WIQS+BJlbqPkO0MDBdsRxESqxbLM7OgUCYexAVQAKCRBxESqxbLM7
OuRiAJ0UXp/HxtaQ4HYRZEuhQongOV410ACcDvUFNDdWeF34bpCeyLtCypK6aS8=
=p4aS
-----END PGP SIGNATURE-----
--Apple-Mail=_1043A9AA-0694-4C68-ACF4-DA26BA94C693--
From: Walter Lozano <walter.lozano@collabora.com>
To: gnats-bugs@netbsd.org, lib-bug-people@netbsd.org, gnats-admin@netbsd.org,
netbsd-bugs@netbsd.org
Cc:
Subject: Re: lib/56647: Fix misbehaviour in libedit support for readline
Date: Mon, 24 Jan 2022 10:10:10 -0300
This is a multi-part message in MIME format.
--------------YxbVEabjAisKkv17iQN7OiCj
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Hi Christos,
Thank you for your quick review, let me comment
On 1/22/22 14:40, Christos Zoulas wrote:
> The following reply was made to PR lib/56647; it has been noted by GNATS.
>
> From: Christos Zoulas<christos@zoulas.com>
> To:gnats-bugs@netbsd.org
> Cc:lib-bug-people@netbsd.org,
> gnats-admin@netbsd.org,
> netbsd-bugs@netbsd.org
> Subject: Re: lib/56647: Fix misbehaviour in libedit support for readline
> Date: Sat, 22 Jan 2022 12:35:17 -0500
>
> --Apple-Mail=_1043A9AA-0694-4C68-ACF4-DA26BA94C693
> Content-Transfer-Encoding: 7bit
> Content-Type: text/plain;
> charset=us-ascii
>
> Hi Walter,
>
> Please submit patches with diff -u so we can get some context.
You are completely right, I missed it this time.
> It would also be nice if you had a description how to reproduce the issue.
This is a difficult part since I'm improving libedit compatibility with
readline in order to make it work with Linux packages such as connman
[1] [2] and bluez [3][4]. Both these packages use a cli application to
connect to services, which might report their status as events while the
user is typing a line. In order to make it simpler I have written a
simple test application to test the changes, will that be enough? How
should I provided it?
> Anyway is this what you mean in your patch?
Yes, exactly that, thank you for trying it find out the change. As
mentioned with these changes the compatibility has improved but
additional work needs to be done.
>
> Thanks,
Thank you for taking the time to review this patch. Please let me know
if there is a way to submit patches that will make your like easier
besides the comments you have already shared.
Walter
[1] https://salsa.debian.org/debian/connman
[2] https://gitlab.apertis.org/pkg/connman
[3] https://salsa.debian.org/bluetooth-team/bluez
[4] https://gitlab.apertis.org/pkg/bluez
>
> christos
>
> Index: readline.c
> ===================================================================
> RCS file: /cvsroot/src/lib/libedit/readline.c,v
> retrieving revision 1.169
> diff -u -p -u -r1.169 readline.c
> --- readline.c 11 Jan 2022 18:30:15 -0000 1.169
> +++ readline.c 22 Jan 2022 17:34:06 -0000
> @@ -2149,6 +2149,7 @@ rl_callback_read_char(void)
> wbuf = NULL;
> (*(void (*)(const char *))rl_linefunc)(wbuf);
> }
> + _rl_update_pos();
> }
>
> void
> @@ -2176,6 +2177,7 @@ rl_redisplay(void)
> a[0] = (char)e->el_tty.t_c[TS_IO][C_REPRINT];
> a[1] = '\0';
> el_push(e, a);
> + rl_forced_update_display();
> }
>
> int
>
>
> --Apple-Mail=_1043A9AA-0694-4C68-ACF4-DA26BA94C693
> Content-Transfer-Encoding: 7bit
> Content-Disposition: attachment;
> filename=signature.asc
> Content-Type: application/pgp-signature;
> name=signature.asc
> Content-Description: Message signed with OpenPGP
>
> -----BEGIN PGP SIGNATURE-----
> Comment: GPGTools -http://gpgtools.org
>
> iF0EARECAB0WIQS+BJlbqPkO0MDBdsRxESqxbLM7OgUCYexAVQAKCRBxESqxbLM7
> OuRiAJ0UXp/HxtaQ4HYRZEuhQongOV410ACcDvUFNDdWeF34bpCeyLtCypK6aS8=
> =p4aS
> -----END PGP SIGNATURE-----
>
> --Apple-Mail=_1043A9AA-0694-4C68-ACF4-DA26BA94C693--
>
--
Walter Lozano
Collabora Ltd.
--------------YxbVEabjAisKkv17iQN7OiCj
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: 7bit
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<p>Hi Christos,</p>
<p>Thank you for your quick review, let me comment<br>
</p>
<div class="moz-cite-prefix">On 1/22/22 14:40, Christos Zoulas
wrote:<br>
</div>
<blockquote type="cite"
cite="mid:20220122174001.9912D1A923B@mollari.NetBSD.org">
<pre class="moz-quote-pre" wrap="">The following reply was made to PR lib/56647; it has been noted by GNATS.
From: Christos Zoulas <a class="moz-txt-link-rfc2396E" href="mailto:christos@zoulas.com"><christos@zoulas.com></a>
To: <a class="moz-txt-link-abbreviated" href="mailto:gnats-bugs@netbsd.org">gnats-bugs@netbsd.org</a>
Cc: <a class="moz-txt-link-abbreviated" href="mailto:lib-bug-people@netbsd.org">lib-bug-people@netbsd.org</a>,
<a class="moz-txt-link-abbreviated" href="mailto:gnats-admin@netbsd.org">gnats-admin@netbsd.org</a>,
<a class="moz-txt-link-abbreviated" href="mailto:netbsd-bugs@netbsd.org">netbsd-bugs@netbsd.org</a>
Subject: Re: lib/56647: Fix misbehaviour in libedit support for readline
Date: Sat, 22 Jan 2022 12:35:17 -0500
--Apple-Mail=_1043A9AA-0694-4C68-ACF4-DA26BA94C693
Content-Transfer-Encoding: 7bit
Content-Type: text/plain;
charset=us-ascii
Hi Walter,
Please submit patches with diff -u so we can get some context.</pre>
</blockquote>
<p>You are completely right, I missed it this time.<br>
</p>
<blockquote type="cite"
cite="mid:20220122174001.9912D1A923B@mollari.NetBSD.org">
<pre class="moz-quote-pre" wrap="">
It would also be nice if you had a description how to reproduce the issue.</pre>
</blockquote>
<p>This is a difficult part since I'm improving libedit
compatibility with readline in order to make it work with Linux
packages such as connman [1] [2] and bluez [3]<span
class="transaction-comment" data-sigil="transaction-comment"
data-meta="40_1"></span> [4]. Both these packages use a cli
application to connect to services, which might report their
status as events while the user is typing a line. In order to make
it simpler I have written a simple test application to test the
changes, will that be enough? How should I provided it?<br>
</p>
<blockquote type="cite"
cite="mid:20220122174001.9912D1A923B@mollari.NetBSD.org">
<pre class="moz-quote-pre" wrap="">
Anyway is this what you mean in your patch?</pre>
</blockquote>
<p>Yes, exactly that, thank you for trying it find out the change.
As mentioned with these changes the compatibility has improved but
additional work needs to be done.</p>
<blockquote type="cite"
cite="mid:20220122174001.9912D1A923B@mollari.NetBSD.org">
<pre class="moz-quote-pre" wrap="">
Thanks,</pre>
</blockquote>
<p>Thank you for taking the time to review this patch. Please let me
know if there is a way to submit patches that will make your like
easier besides the comments you have already shared.</p>
<p>Walter</p>
<p><br>
</p>
<p>[1] <a class="moz-txt-link-freetext" href="https://salsa.debian.org/debian/connman">https://salsa.debian.org/debian/connman</a></p>
<p>[2] <a class="moz-txt-link-freetext" href="https://gitlab.apertis.org/pkg/connman">https://gitlab.apertis.org/pkg/connman</a><br>
</p>
<p>[3] <a class="moz-txt-link-freetext" href="https://salsa.debian.org/bluetooth-team/bluez">https://salsa.debian.org/bluetooth-team/bluez</a></p>
<p>[4] <a class="moz-txt-link-freetext" href="https://gitlab.apertis.org/pkg/bluez">https://gitlab.apertis.org/pkg/bluez</a><br>
</p>
<blockquote type="cite"
cite="mid:20220122174001.9912D1A923B@mollari.NetBSD.org">
<pre class="moz-quote-pre" wrap="">
christos
Index: readline.c
===================================================================
RCS file: /cvsroot/src/lib/libedit/readline.c,v
retrieving revision 1.169
diff -u -p -u -r1.169 readline.c
--- readline.c 11 Jan 2022 18:30:15 -0000 1.169
+++ readline.c 22 Jan 2022 17:34:06 -0000
@@ -2149,6 +2149,7 @@ rl_callback_read_char(void)
wbuf = NULL;
(*(void (*)(const char *))rl_linefunc)(wbuf);
}
+ _rl_update_pos();
}
void
@@ -2176,6 +2177,7 @@ rl_redisplay(void)
a[0] = (char)e->el_tty.t_c[TS_IO][C_REPRINT];
a[1] = '\0';
el_push(e, a);
+ rl_forced_update_display();
}
int
--Apple-Mail=_1043A9AA-0694-4C68-ACF4-DA26BA94C693
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
filename=signature.asc
Content-Type: application/pgp-signature;
name=signature.asc
Content-Description: Message signed with OpenPGP
-----BEGIN PGP SIGNATURE-----
Comment: GPGTools - <a class="moz-txt-link-freetext" href="http://gpgtools.org">http://gpgtools.org</a>
iF0EARECAB0WIQS+BJlbqPkO0MDBdsRxESqxbLM7OgUCYexAVQAKCRBxESqxbLM7
OuRiAJ0UXp/HxtaQ4HYRZEuhQongOV410ACcDvUFNDdWeF34bpCeyLtCypK6aS8=
=p4aS
-----END PGP SIGNATURE-----
--Apple-Mail=_1043A9AA-0694-4C68-ACF4-DA26BA94C693--
</pre>
</blockquote>
<pre class="moz-signature" cols="72">--
Walter Lozano
Collabora Ltd.</pre>
</body>
</html>
--------------YxbVEabjAisKkv17iQN7OiCj--
From: Christos Zoulas <christos@zoulas.com>
To: gnats-bugs@netbsd.org
Cc: lib-bug-people@netbsd.org,
gnats-admin@netbsd.org,
netbsd-bugs@netbsd.org,
walter.lozano@collabora.com
Subject: Re: lib/56647: Fix misbehaviour in libedit support for readline
Date: Mon, 24 Jan 2022 13:28:53 -0500
--Apple-Mail=_7360A00D-633C-4677-88AA-097E77CAED16
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain;
charset=us-ascii
Hi Walter, thanks for taking the time to write a reproducer. Just attach =
it to a mail message
and it will be added to this request. In the meantime I will commit the =
changes.
Best,
christos
--Apple-Mail=_7360A00D-633C-4677-88AA-097E77CAED16
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
filename=signature.asc
Content-Type: application/pgp-signature;
name=signature.asc
Content-Description: Message signed with OpenPGP
-----BEGIN PGP SIGNATURE-----
Comment: GPGTools - http://gpgtools.org
iF0EARECAB0WIQS+BJlbqPkO0MDBdsRxESqxbLM7OgUCYe7v5QAKCRBxESqxbLM7
OmPgAKCleXLoeOIbk0JfYT1BXk8DlJIbugCffSiwsCAjwvD6tQrLTKm4Umc0gTI=
=Ca1G
-----END PGP SIGNATURE-----
--Apple-Mail=_7360A00D-633C-4677-88AA-097E77CAED16--
From: Walter Lozano <walter.lozano@collabora.com>
To: Christos Zoulas <christos@zoulas.com>, gnats-bugs@netbsd.org
Cc: lib-bug-people@netbsd.org, gnats-admin@netbsd.org, netbsd-bugs@netbsd.org
Subject: Re: lib/56647: Fix misbehaviour in libedit support for readline
Date: Wed, 26 Jan 2022 13:35:36 -0300
This is a multi-part message in MIME format.
--------------i36T0iK89PRoJ4mZNCW6gGut
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Hi Christos,
On 1/24/22 15:28, Christos Zoulas wrote:
> Hi Walter, thanks for taking the time to write a reproducer. Just attach it to a mail message
> and it will be added to this request. In the meantime I will commit the changes.
Here is the test program I use to test my changes. I this based on and
example I found and in the code found in connman [1][2] and bluez [3][4].
Unfortunately I still have issues, the message is not rendered properly.
With the example I attach the output is
WOOP> Typingwarning something needs your attentionTypingWOOP> Typing
but it shoud be
WOOP> Typing
warning something needs your attention
WOOP> Typing
However at least now the message is seeing and the test typed is restored.
I'll keep trying to improve it as I still have time, but I'm not sure if
I will be able to have a better solution.
Please note that my test are done under Apertis (Linux Debian
derivative), but my understanding is that this type of changes should
apply without issues on NetBSD.
Regards,
Walter
[1] https://salsa.debian.org/debian/connman
[2] https://gitlab.apertis.org/pkg/connman
[3] https://salsa.debian.org/bluetooth-team/bluez
[4] https://gitlab.apertis.org/pkg/bluez
> Best,
>
> christos
>
--
Walter Lozano
Collabora Ltd.
--------------i36T0iK89PRoJ4mZNCW6gGut
Content-Type: text/x-csrc; charset=UTF-8; name="test.c"
Content-Disposition: attachment; filename="test.c"
Content-Transfer-Encoding: base64
Ly8gRXhhbXBsZSBmcm9tIGh0dHA6Ly93d3cubWNsZC5jby51ay9ibG9nLzIwMDkvc2ltcGxl
LWdudS1yZWFkbGluZS1jYWxsYmFjay1zdHlsZS1leGFtcGxlLmh0bWwKCiNpbmNsdWRlIDxz
dGRpby5oPgojaW5jbHVkZSA8cmVhZGxpbmUvcmVhZGxpbmUuaD4KI2luY2x1ZGUgPHJlYWRs
aW5lL2hpc3RvcnkuaD4KI2luY2x1ZGUgPHN0ZGxpYi5oPiAgLyogZm9yIGZyZWUoKSAqLwoj
aW5jbHVkZSA8dW5pc3RkLmg+IC8qIGZvciB1c2xlZXAoKSAqLwojaW5jbHVkZSA8cHRocmVh
ZC5oPgojaW5jbHVkZSA8c3RyaW5nLmg+CgpjaGFyIHJ1bm5pbmcgPSAxOwoKLy8gVGhlIGZ1
bmN0aW9uIHRoYXQnbGwgZ2V0IHBhc3NlZCBlYWNoIGxpbmUgb2YgaW5wdXQKdm9pZCBteV9y
bGhhbmRsZXIoY2hhciogbGluZSk7CnZvaWQgbXlfcmxoYW5kbGVyKGNoYXIqIGxpbmUpewog
ICAgICAgIGlmKGxpbmU9PU5VTEwpewogICAgICAgICAgICAgICAgLy8gQ3RybC1EIHdpbGwg
YWxsb3cgdXMgdG8gZXhpdCBuaWNlbHkKICAgICAgICAgICAgICAgIHByaW50ZigiXG5OVUxM
QlVSR0VSXG4iKTsKICAgICAgICAgICAgICAgIHJ1bm5pbmcgPSAwOwogICAgICAgIH1lbHNl
ewogICAgICAgICAgICAgICAgaWYoKmxpbmUhPTApewogICAgICAgICAgICAgICAgICAgICAg
ICAgIC8vIElmIGxpbmUgd2Fzbid0IGVtcHR5LCBzdG9yZSBpdCBzbyB0aGF0IHVwYXJyb3cg
cmV0cmlldmVzIGl0CiAgICAgICAgICAgICAgICAgICAgICAgIGFkZF9oaXN0b3J5KGxpbmUp
OwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICBwcmludGYoIllv
dXIgaW5wdXQgd2FzOlxuJXNcbiIsIGxpbmUpOwogICAgICAgICAgICAgICAgICAgICAgICBm
cmVlKGxpbmUpOwogICAgICAgIH0KfQoKLy8jZGVmaW5lIFVTRV9QUklOVEYKCnZvaWQgKiBw
cmludF93YXJuaW5nKHZvaWQgKiBub3RoaW5nKXsKICAgICAgICBpbnQgc2F2ZWRfcG9pbnQ7
CiAgICAgICAgY2hhciAqIHNhdmVkX2xpbmU7CgogICAgICAgIHVzbGVlcCg1MDAwMDAwKTsK
I2lmZGVmIFVTRV9QUklOVEYKICAgICAgICBwcmludGYoIndhcm5pbmcgc29tZXRoaW5nIG5l
ZWRzIHlvdXIgYXR0ZW50aW9uXG4iKTsKICAgICAgICBybF9yZWRpc3BsYXkoKTsKICAgICAg
ICB1c2xlZXAoMTAwMDAwMCk7CiNlbHNlCiAgICAgICAgc2F2ZWRfcG9pbnQgPSBybF9wb2lu
dDsKICAgICAgICBybF9zYXZlX3Byb21wdCgpOwogICAgICAgIHNhdmVkX2xpbmUgPSBybF9j
b3B5X3RleHQoMCwgcmxfZW5kKTsKICAgICAgICBybF9yZXBsYWNlX2xpbmUoIiIsIDApOwog
ICAgICAgIHJsX21lc3NhZ2UoIndhcm5pbmcgc29tZXRoaW5nIG5lZWRzIHlvdXIgYXR0ZW50
aW9uXG4iKTsKICAgICAgICBybF9yZWRpc3BsYXkoKTsKICAgICAgICAvL3VzbGVlcCgxMDAw
MDAwKTsKICAgICAgICBybF9yZXN0b3JlX3Byb21wdCgpOwogICAgICAgIHJsX3JlcGxhY2Vf
bGluZShzYXZlZF9saW5lLCAwKTsKICAgICAgICBybF9wb2ludCA9IHNhdmVkX3BvaW50Owog
ICAgICAgIHJsX3JlZGlzcGxheSgpOwojZW5kaWYKICAgICAgICByZXR1cm4gTlVMTDsKfQoK
Ly8gVGhlIG1haW4gZW50cnktcG9pbnQgZm9yIHRoZSBwcm9ncmFtCmludCBtYWluKCkKewog
ICAgICAgIGNvbnN0IGNoYXIgKnByb21wdCA9ICJXT09QPiAiOwogICAgICAgIHB0aHJlYWRf
dCB0aHJlYWRfaWQ7CgogICAgICAgIC8vIEluc3RhbGwgdGhlIGhhbmRsZXIKICAgICAgICBy
bF9jYWxsYmFja19oYW5kbGVyX2luc3RhbGwocHJvbXB0LCAocmxfdmNwZnVuY190KikgJm15
X3JsaGFuZGxlcik7CgogICAgICAgIC8vIEVudGVyIHRoZSBldmVudCBsb29wIChzaW1wbGUg
ZXhhbXBsZSwgc28gaXQgZG9lc24ndCBkbyBtdWNoIGV4Y2VwdCB3YWl0KQogICAgICAgIHJ1
bm5pbmcgPSAxOwoKICAgICAgICBwdGhyZWFkX2NyZWF0ZSgmdGhyZWFkX2lkLCBOVUxMLCAm
cHJpbnRfd2FybmluZywgTlVMTCk7CgogICAgICAgIHdoaWxlKHJ1bm5pbmcpewogICAgICAg
ICAgICAgICAgLy9wcmludGYoIndhaXRpbmdcbiIpOwogICAgICAgICAgICAgICAgdXNsZWVw
KDEwMDAwKTsKICAgICAgICAgICAgICAgIHJsX2NhbGxiYWNrX3JlYWRfY2hhcigpOwogICAg
ICAgIH07CiAgICAgICAgcHJpbnRmKCJcbkV2ZW50IGxvb3AgaGFzIGV4aXRlZFxuIik7Cgog
ICAgICAgIC8vIFJlbW92ZSB0aGUgaGFuZGxlcgogICAgICAgIHJsX2NhbGxiYWNrX2hhbmRs
ZXJfcmVtb3ZlKCk7CgogICAgICAgIHJldHVybiAwOyAvLyBoYXBweSBlbmRpbmcKfQo=
--------------i36T0iK89PRoJ4mZNCW6gGut--
From: Christos Zoulas <christos@zoulas.com>
To: gnats-bugs@netbsd.org
Cc: lib-bug-people@netbsd.org,
gnats-admin@netbsd.org,
netbsd-bugs@netbsd.org,
walter.lozano@collabora.com
Subject: Re: lib/56647: Fix misbehaviour in libedit support for readline
Date: Sat, 29 Jan 2022 15:53:03 -0500
--Apple-Mail=_2EE391CB-C248-473A-A50A-B4FD774C36C5
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain;
charset=us-ascii
Committed!
christos
> On Jan 26, 2022, at 11:40 AM, Walter Lozano =
<walter.lozano@collabora.com> wrote:
>=20
> The following reply was made to PR lib/56647; it has been noted by =
GNATS.
>=20
> From: Walter Lozano <walter.lozano@collabora.com>
> To: Christos Zoulas <christos@zoulas.com>, gnats-bugs@netbsd.org
> Cc: lib-bug-people@netbsd.org, gnats-admin@netbsd.org, =
netbsd-bugs@netbsd.org
> Subject: Re: lib/56647: Fix misbehaviour in libedit support for =
readline
> Date: Wed, 26 Jan 2022 13:35:36 -0300
>=20
> This is a multi-part message in MIME format.
> --------------i36T0iK89PRoJ4mZNCW6gGut
> Content-Type: text/plain; charset=3DUTF-8; format=3Dflowed
> Content-Transfer-Encoding: 7bit
>=20
> Hi Christos,
>=20
> On 1/24/22 15:28, Christos Zoulas wrote:
>> Hi Walter, thanks for taking the time to write a reproducer. Just =
attach it to a mail message
>> and it will be added to this request. In the meantime I will commit =
the changes.
>=20
> Here is the test program I use to test my changes. I this based on and
> example I found and in the code found in connman [1][2] and bluez =
[3][4].
>=20
> Unfortunately I still have issues, the message is not rendered =
properly.
> With the example I attach the output is
>=20
> WOOP> Typingwarning something needs your attentionTypingWOOP> Typing
>=20
> but it shoud be
>=20
> WOOP> Typing
> warning something needs your attention
> WOOP> Typing
>=20
> However at least now the message is seeing and the test typed is =
restored.
>=20
> I'll keep trying to improve it as I still have time, but I'm not sure =
if
> I will be able to have a better solution.
>=20
> Please note that my test are done under Apertis (Linux Debian
> derivative), but my understanding is that this type of changes should
> apply without issues on NetBSD.
>=20
> Regards,
>=20
> Walter
>=20
> [1] https://salsa.debian.org/debian/connman
> [2] https://gitlab.apertis.org/pkg/connman
> [3] https://salsa.debian.org/bluetooth-team/bluez
> [4] https://gitlab.apertis.org/pkg/bluez
>=20
>> Best,
>>=20
>> christos
>>=20
>=20
> --
> Walter Lozano
> Collabora Ltd.
> --------------i36T0iK89PRoJ4mZNCW6gGut
> Content-Type: text/x-csrc; charset=3DUTF-8; name=3D"test.c"
> Content-Disposition: attachment; filename=3D"test.c"
> Content-Transfer-Encoding: base64
>=20
> =
Ly8gRXhhbXBsZSBmcm9tIGh0dHA6Ly93d3cubWNsZC5jby51ay9ibG9nLzIwMDkvc2ltcGxl
> =
LWdudS1yZWFkbGluZS1jYWxsYmFjay1zdHlsZS1leGFtcGxlLmh0bWwKCiNpbmNsdWRlIDxz
> =
dGRpby5oPgojaW5jbHVkZSA8cmVhZGxpbmUvcmVhZGxpbmUuaD4KI2luY2x1ZGUgPHJlYWRs
> =
aW5lL2hpc3RvcnkuaD4KI2luY2x1ZGUgPHN0ZGxpYi5oPiAgLyogZm9yIGZyZWUoKSAqLwoj
> =
aW5jbHVkZSA8dW5pc3RkLmg+IC8qIGZvciB1c2xlZXAoKSAqLwojaW5jbHVkZSA8cHRocmVh
> =
ZC5oPgojaW5jbHVkZSA8c3RyaW5nLmg+CgpjaGFyIHJ1bm5pbmcgPSAxOwoKLy8gVGhlIGZ1
> =
bmN0aW9uIHRoYXQnbGwgZ2V0IHBhc3NlZCBlYWNoIGxpbmUgb2YgaW5wdXQKdm9pZCBteV9y
> =
bGhhbmRsZXIoY2hhciogbGluZSk7CnZvaWQgbXlfcmxoYW5kbGVyKGNoYXIqIGxpbmUpewog
> =
ICAgICAgIGlmKGxpbmU9PU5VTEwpewogICAgICAgICAgICAgICAgLy8gQ3RybC1EIHdpbGwg
> =
YWxsb3cgdXMgdG8gZXhpdCBuaWNlbHkKICAgICAgICAgICAgICAgIHByaW50ZigiXG5OVUxM
> =
QlVSR0VSXG4iKTsKICAgICAgICAgICAgICAgIHJ1bm5pbmcgPSAwOwogICAgICAgIH1lbHNl
> =
ewogICAgICAgICAgICAgICAgaWYoKmxpbmUhPTApewogICAgICAgICAgICAgICAgICAgICAg
> =
ICAgIC8vIElmIGxpbmUgd2Fzbid0IGVtcHR5LCBzdG9yZSBpdCBzbyB0aGF0IHVwYXJyb3cg
> =
cmV0cmlldmVzIGl0CiAgICAgICAgICAgICAgICAgICAgICAgIGFkZF9oaXN0b3J5KGxpbmUp
> =
OwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICBwcmludGYoIllv
> =
dXIgaW5wdXQgd2FzOlxuJXNcbiIsIGxpbmUpOwogICAgICAgICAgICAgICAgICAgICAgICBm
> =
cmVlKGxpbmUpOwogICAgICAgIH0KfQoKLy8jZGVmaW5lIFVTRV9QUklOVEYKCnZvaWQgKiBw
> =
cmludF93YXJuaW5nKHZvaWQgKiBub3RoaW5nKXsKICAgICAgICBpbnQgc2F2ZWRfcG9pbnQ7
> =
CiAgICAgICAgY2hhciAqIHNhdmVkX2xpbmU7CgogICAgICAgIHVzbGVlcCg1MDAwMDAwKTsK
> =
I2lmZGVmIFVTRV9QUklOVEYKICAgICAgICBwcmludGYoIndhcm5pbmcgc29tZXRoaW5nIG5l
> =
ZWRzIHlvdXIgYXR0ZW50aW9uXG4iKTsKICAgICAgICBybF9yZWRpc3BsYXkoKTsKICAgICAg
> =
ICB1c2xlZXAoMTAwMDAwMCk7CiNlbHNlCiAgICAgICAgc2F2ZWRfcG9pbnQgPSBybF9wb2lu
> =
dDsKICAgICAgICBybF9zYXZlX3Byb21wdCgpOwogICAgICAgIHNhdmVkX2xpbmUgPSBybF9j
> =
b3B5X3RleHQoMCwgcmxfZW5kKTsKICAgICAgICBybF9yZXBsYWNlX2xpbmUoIiIsIDApOwog
> =
ICAgICAgIHJsX21lc3NhZ2UoIndhcm5pbmcgc29tZXRoaW5nIG5lZWRzIHlvdXIgYXR0ZW50
> =
aW9uXG4iKTsKICAgICAgICBybF9yZWRpc3BsYXkoKTsKICAgICAgICAvL3VzbGVlcCgxMDAw
> =
MDAwKTsKICAgICAgICBybF9yZXN0b3JlX3Byb21wdCgpOwogICAgICAgIHJsX3JlcGxhY2Vf
> =
bGluZShzYXZlZF9saW5lLCAwKTsKICAgICAgICBybF9wb2ludCA9IHNhdmVkX3BvaW50Owog
> =
ICAgICAgIHJsX3JlZGlzcGxheSgpOwojZW5kaWYKICAgICAgICByZXR1cm4gTlVMTDsKfQoK
> =
Ly8gVGhlIG1haW4gZW50cnktcG9pbnQgZm9yIHRoZSBwcm9ncmFtCmludCBtYWluKCkKewog
> =
ICAgICAgIGNvbnN0IGNoYXIgKnByb21wdCA9ICJXT09QPiAiOwogICAgICAgIHB0aHJlYWRf
> =
dCB0aHJlYWRfaWQ7CgogICAgICAgIC8vIEluc3RhbGwgdGhlIGhhbmRsZXIKICAgICAgICBy
> =
bF9jYWxsYmFja19oYW5kbGVyX2luc3RhbGwocHJvbXB0LCAocmxfdmNwZnVuY190KikgJm15
> =
X3JsaGFuZGxlcik7CgogICAgICAgIC8vIEVudGVyIHRoZSBldmVudCBsb29wIChzaW1wbGUg
> =
ZXhhbXBsZSwgc28gaXQgZG9lc24ndCBkbyBtdWNoIGV4Y2VwdCB3YWl0KQogICAgICAgIHJ1
> =
bm5pbmcgPSAxOwoKICAgICAgICBwdGhyZWFkX2NyZWF0ZSgmdGhyZWFkX2lkLCBOVUxMLCAm
> =
cHJpbnRfd2FybmluZywgTlVMTCk7CgogICAgICAgIHdoaWxlKHJ1bm5pbmcpewogICAgICAg
> =
ICAgICAgICAgLy9wcmludGYoIndhaXRpbmdcbiIpOwogICAgICAgICAgICAgICAgdXNsZWVw
> =
KDEwMDAwKTsKICAgICAgICAgICAgICAgIHJsX2NhbGxiYWNrX3JlYWRfY2hhcigpOwogICAg
> =
ICAgIH07CiAgICAgICAgcHJpbnRmKCJcbkV2ZW50IGxvb3AgaGFzIGV4aXRlZFxuIik7Cgog
> =
ICAgICAgIC8vIFJlbW92ZSB0aGUgaGFuZGxlcgogICAgICAgIHJsX2NhbGxiYWNrX2hhbmRs
> ZXJfcmVtb3ZlKCk7CgogICAgICAgIHJldHVybiAwOyAvLyBoYXBweSBlbmRpbmcKfQo=3D
>=20
> --------------i36T0iK89PRoJ4mZNCW6gGut--
>=20
--Apple-Mail=_2EE391CB-C248-473A-A50A-B4FD774C36C5
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
filename=signature.asc
Content-Type: application/pgp-signature;
name=signature.asc
Content-Description: Message signed with OpenPGP
-----BEGIN PGP SIGNATURE-----
Comment: GPGTools - http://gpgtools.org
iF0EARECAB0WIQS+BJlbqPkO0MDBdsRxESqxbLM7OgUCYfWpLwAKCRBxESqxbLM7
OpJKAKCEq8iUZbXjQbic0yCo6TXOBs9BxgCfaorsuaD373jDnocEv1EZ+k0qxUM=
=++SY
-----END PGP SIGNATURE-----
--Apple-Mail=_2EE391CB-C248-473A-A50A-B4FD774C36C5--
From: Walter Lozano <walter.lozano@collabora.com>
To: gnats-bugs@netbsd.org, lib-bug-people@netbsd.org, gnats-admin@netbsd.org,
netbsd-bugs@netbsd.org
Cc:
Subject: Re: lib/56647: Fix misbehaviour in libedit support for readline
Date: Mon, 31 Jan 2022 10:14:44 -0300
On 1/29/22 17:55, Christos Zoulas wrote:
> The following reply was made to PR lib/56647; it has been noted by GNATS.
>
> From: Christos Zoulas <christos@zoulas.com>
> To: gnats-bugs@netbsd.org
> Cc: lib-bug-people@netbsd.org,
> gnats-admin@netbsd.org,
> netbsd-bugs@netbsd.org,
> walter.lozano@collabora.com
> Subject: Re: lib/56647: Fix misbehaviour in libedit support for readline
> Date: Sat, 29 Jan 2022 15:53:03 -0500
>
> --Apple-Mail=_2EE391CB-C248-473A-A50A-B4FD774C36C5
> Content-Transfer-Encoding: quoted-printable
> Content-Type: text/plain;
> charset=us-ascii
>
> Committed!
Thank you!
Regards,
Walter
>
> christos
>
> > On Jan 26, 2022, at 11:40 AM, Walter Lozano =
> <walter.lozano@collabora.com> wrote:
> >=20
> > The following reply was made to PR lib/56647; it has been noted by =
> GNATS.
> >=20
> > From: Walter Lozano <walter.lozano@collabora.com>
> > To: Christos Zoulas <christos@zoulas.com>, gnats-bugs@netbsd.org
> > Cc: lib-bug-people@netbsd.org, gnats-admin@netbsd.org, =
> netbsd-bugs@netbsd.org
> > Subject: Re: lib/56647: Fix misbehaviour in libedit support for =
> readline
> > Date: Wed, 26 Jan 2022 13:35:36 -0300
> >=20
> > This is a multi-part message in MIME format.
> > --------------i36T0iK89PRoJ4mZNCW6gGut
> > Content-Type: text/plain; charset=3DUTF-8; format=3Dflowed
> > Content-Transfer-Encoding: 7bit
> >=20
> > Hi Christos,
> >=20
> > On 1/24/22 15:28, Christos Zoulas wrote:
> >> Hi Walter, thanks for taking the time to write a reproducer. Just =
> attach it to a mail message
> >> and it will be added to this request. In the meantime I will commit =
> the changes.
> >=20
> > Here is the test program I use to test my changes. I this based on and
> > example I found and in the code found in connman [1][2] and bluez =
> [3][4].
> >=20
> > Unfortunately I still have issues, the message is not rendered =
> properly.
> > With the example I attach the output is
> >=20
> > WOOP> Typingwarning something needs your attentionTypingWOOP> Typing
> >=20
> > but it shoud be
> >=20
> > WOOP> Typing
> > warning something needs your attention
> > WOOP> Typing
> >=20
> > However at least now the message is seeing and the test typed is =
> restored.
> >=20
> > I'll keep trying to improve it as I still have time, but I'm not sure =
> if
> > I will be able to have a better solution.
> >=20
> > Please note that my test are done under Apertis (Linux Debian
> > derivative), but my understanding is that this type of changes should
> > apply without issues on NetBSD.
> >=20
> > Regards,
> >=20
> > Walter
> >=20
> > [1] https://salsa.debian.org/debian/connman
> > [2] https://gitlab.apertis.org/pkg/connman
> > [3] https://salsa.debian.org/bluetooth-team/bluez
> > [4] https://gitlab.apertis.org/pkg/bluez
> >=20
> >> Best,
> >>=20
> >> christos
> >>=20
> >=20
> > --
> > Walter Lozano
> > Collabora Ltd.
> > --------------i36T0iK89PRoJ4mZNCW6gGut
> > Content-Type: text/x-csrc; charset=3DUTF-8; name=3D"test.c"
> > Content-Disposition: attachment; filename=3D"test.c"
> > Content-Transfer-Encoding: base64
> >=20
> > =
> Ly8gRXhhbXBsZSBmcm9tIGh0dHA6Ly93d3cubWNsZC5jby51ay9ibG9nLzIwMDkvc2ltcGxl
> > =
> LWdudS1yZWFkbGluZS1jYWxsYmFjay1zdHlsZS1leGFtcGxlLmh0bWwKCiNpbmNsdWRlIDxz
> > =
> dGRpby5oPgojaW5jbHVkZSA8cmVhZGxpbmUvcmVhZGxpbmUuaD4KI2luY2x1ZGUgPHJlYWRs
> > =
> aW5lL2hpc3RvcnkuaD4KI2luY2x1ZGUgPHN0ZGxpYi5oPiAgLyogZm9yIGZyZWUoKSAqLwoj
> > =
> aW5jbHVkZSA8dW5pc3RkLmg+IC8qIGZvciB1c2xlZXAoKSAqLwojaW5jbHVkZSA8cHRocmVh
> > =
> ZC5oPgojaW5jbHVkZSA8c3RyaW5nLmg+CgpjaGFyIHJ1bm5pbmcgPSAxOwoKLy8gVGhlIGZ1
> > =
> bmN0aW9uIHRoYXQnbGwgZ2V0IHBhc3NlZCBlYWNoIGxpbmUgb2YgaW5wdXQKdm9pZCBteV9y
> > =
> bGhhbmRsZXIoY2hhciogbGluZSk7CnZvaWQgbXlfcmxoYW5kbGVyKGNoYXIqIGxpbmUpewog
> > =
> ICAgICAgIGlmKGxpbmU9PU5VTEwpewogICAgICAgICAgICAgICAgLy8gQ3RybC1EIHdpbGwg
> > =
> YWxsb3cgdXMgdG8gZXhpdCBuaWNlbHkKICAgICAgICAgICAgICAgIHByaW50ZigiXG5OVUxM
> > =
> QlVSR0VSXG4iKTsKICAgICAgICAgICAgICAgIHJ1bm5pbmcgPSAwOwogICAgICAgIH1lbHNl
> > =
> ewogICAgICAgICAgICAgICAgaWYoKmxpbmUhPTApewogICAgICAgICAgICAgICAgICAgICAg
> > =
> ICAgIC8vIElmIGxpbmUgd2Fzbid0IGVtcHR5LCBzdG9yZSBpdCBzbyB0aGF0IHVwYXJyb3cg
> > =
> cmV0cmlldmVzIGl0CiAgICAgICAgICAgICAgICAgICAgICAgIGFkZF9oaXN0b3J5KGxpbmUp
> > =
> OwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICBwcmludGYoIllv
> > =
> dXIgaW5wdXQgd2FzOlxuJXNcbiIsIGxpbmUpOwogICAgICAgICAgICAgICAgICAgICAgICBm
> > =
> cmVlKGxpbmUpOwogICAgICAgIH0KfQoKLy8jZGVmaW5lIFVTRV9QUklOVEYKCnZvaWQgKiBw
> > =
> cmludF93YXJuaW5nKHZvaWQgKiBub3RoaW5nKXsKICAgICAgICBpbnQgc2F2ZWRfcG9pbnQ7
> > =
> CiAgICAgICAgY2hhciAqIHNhdmVkX2xpbmU7CgogICAgICAgIHVzbGVlcCg1MDAwMDAwKTsK
> > =
> I2lmZGVmIFVTRV9QUklOVEYKICAgICAgICBwcmludGYoIndhcm5pbmcgc29tZXRoaW5nIG5l
> > =
> ZWRzIHlvdXIgYXR0ZW50aW9uXG4iKTsKICAgICAgICBybF9yZWRpc3BsYXkoKTsKICAgICAg
> > =
> ICB1c2xlZXAoMTAwMDAwMCk7CiNlbHNlCiAgICAgICAgc2F2ZWRfcG9pbnQgPSBybF9wb2lu
> > =
> dDsKICAgICAgICBybF9zYXZlX3Byb21wdCgpOwogICAgICAgIHNhdmVkX2xpbmUgPSBybF9j
> > =
> b3B5X3RleHQoMCwgcmxfZW5kKTsKICAgICAgICBybF9yZXBsYWNlX2xpbmUoIiIsIDApOwog
> > =
> ICAgICAgIHJsX21lc3NhZ2UoIndhcm5pbmcgc29tZXRoaW5nIG5lZWRzIHlvdXIgYXR0ZW50
> > =
> aW9uXG4iKTsKICAgICAgICBybF9yZWRpc3BsYXkoKTsKICAgICAgICAvL3VzbGVlcCgxMDAw
> > =
> MDAwKTsKICAgICAgICBybF9yZXN0b3JlX3Byb21wdCgpOwogICAgICAgIHJsX3JlcGxhY2Vf
> > =
> bGluZShzYXZlZF9saW5lLCAwKTsKICAgICAgICBybF9wb2ludCA9IHNhdmVkX3BvaW50Owog
> > =
> ICAgICAgIHJsX3JlZGlzcGxheSgpOwojZW5kaWYKICAgICAgICByZXR1cm4gTlVMTDsKfQoK
> > =
> Ly8gVGhlIG1haW4gZW50cnktcG9pbnQgZm9yIHRoZSBwcm9ncmFtCmludCBtYWluKCkKewog
> > =
> ICAgICAgIGNvbnN0IGNoYXIgKnByb21wdCA9ICJXT09QPiAiOwogICAgICAgIHB0aHJlYWRf
> > =
> dCB0aHJlYWRfaWQ7CgogICAgICAgIC8vIEluc3RhbGwgdGhlIGhhbmRsZXIKICAgICAgICBy
> > =
> bF9jYWxsYmFja19oYW5kbGVyX2luc3RhbGwocHJvbXB0LCAocmxfdmNwZnVuY190KikgJm15
> > =
> X3JsaGFuZGxlcik7CgogICAgICAgIC8vIEVudGVyIHRoZSBldmVudCBsb29wIChzaW1wbGUg
> > =
> ZXhhbXBsZSwgc28gaXQgZG9lc24ndCBkbyBtdWNoIGV4Y2VwdCB3YWl0KQogICAgICAgIHJ1
> > =
> bm5pbmcgPSAxOwoKICAgICAgICBwdGhyZWFkX2NyZWF0ZSgmdGhyZWFkX2lkLCBOVUxMLCAm
> > =
> cHJpbnRfd2FybmluZywgTlVMTCk7CgogICAgICAgIHdoaWxlKHJ1bm5pbmcpewogICAgICAg
> > =
> ICAgICAgICAgLy9wcmludGYoIndhaXRpbmdcbiIpOwogICAgICAgICAgICAgICAgdXNsZWVw
> > =
> KDEwMDAwKTsKICAgICAgICAgICAgICAgIHJsX2NhbGxiYWNrX3JlYWRfY2hhcigpOwogICAg
> > =
> ICAgIH07CiAgICAgICAgcHJpbnRmKCJcbkV2ZW50IGxvb3AgaGFzIGV4aXRlZFxuIik7Cgog
> > =
> ICAgICAgIC8vIFJlbW92ZSB0aGUgaGFuZGxlcgogICAgICAgIHJsX2NhbGxiYWNrX2hhbmRs
> > ZXJfcmVtb3ZlKCk7CgogICAgICAgIHJldHVybiAwOyAvLyBoYXBweSBlbmRpbmcKfQo=3D
> >=20
> > --------------i36T0iK89PRoJ4mZNCW6gGut--
> >=20
>
>
> --Apple-Mail=_2EE391CB-C248-473A-A50A-B4FD774C36C5
> Content-Transfer-Encoding: 7bit
> Content-Disposition: attachment;
> filename=signature.asc
> Content-Type: application/pgp-signature;
> name=signature.asc
> Content-Description: Message signed with OpenPGP
>
> -----BEGIN PGP SIGNATURE-----
> Comment: GPGTools - http://gpgtools.org
>
> iF0EARECAB0WIQS+BJlbqPkO0MDBdsRxESqxbLM7OgUCYfWpLwAKCRBxESqxbLM7
> OpJKAKCEq8iUZbXjQbic0yCo6TXOBs9BxgCfaorsuaD373jDnocEv1EZ+k0qxUM=
> =++SY
> -----END PGP SIGNATURE-----
>
> --Apple-Mail=_2EE391CB-C248-473A-A50A-B4FD774C36C5--
>
--
Walter Lozano
Collabora Ltd.
(Contact us)
$NetBSD: query-full-pr,v 1.46 2020/01/03 16:35:01 leot Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2020
The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.