Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Kevin Buettner <kevinb@redhat.com>
To: gdb-patches@sourceware.org
Subject: Re: [PATCH v2] [gdb/testsuite, Tcl 9] Fix EILSEQ problems for UTF8 related tests
Date: Fri, 29 May 2026 14:36:24 -0700	[thread overview]
Message-ID: <20260529143624.4882c16b@f42-zbm-amd> (raw)
In-Reply-To: <20260526192701.3835262-2-kevinb@redhat.com>

On Tue, 26 May 2026 12:27:02 -0700
Kevin Buettner <kevinb@redhat.com> wrote:

> On Fedora 44 and Rawhide (Fedora 45), these tests...
> 
>   gdb.ada/non-ascii-utf-8.exp
>   gdb.base/utf8-identifiers.exp
>   gdb.rust/unicode.exp
> 
> ...all die due to these errors:
> 
>   Running ...gdb/testsuite/gdb.base/utf8-identifiers.exp ...
>   ERROR: tcl error sourcing
> .../gdb/testsuite/gdb.base/utf8-identifiers.exp. ERROR: tcl error code
> POSIX EILSEQ {invalid or incomplete multibyte or wide character} error
> writing "file6": invalid or incomplete multibyte or wide character ...
> 
> (I've shortened some of the pathnames for brevity.)
> 
> These Fedora systems are using Tcl 9 and also an updated version of
> dejagnu with this change applied:
> 
>   * Thu Apr 16 2026 Jakub Jelinek <jakub@redhat.com> - 1:1.6.3-17
>   - Apply full set of Tcl 9 compatibility fixes from upstream PR80674
> branch (#2448542)
> 
> That runtest change is responsible for the POSIX EILSEQ errors on
> machines with that change.  The change to runtest causing the change
> in behavior for GDB is the addition of these lines near the top of
> the runtest script:
> 
>   # Ensure that DejaGnu will be run in the POSIX locale
>   LC_ALL=C
>   export LC_ALL
> 
> Tcl 8 used a permissive encoding strategy: bytes that could not be
> represented in the current encoding were silently mangled or
> substituted.  Tcl 9 changed this default to a strict profile, which
> means that any attempt to write a character that cannot be expressed
> in the channel's encoding raises a POSIX EILSEQ error ("invalid or
> incomplete multibyte or wide character").
> 
> So, together, this Tcl 9 behavior combined with the dejagnu change
> to runtest causes the EILSEQ error for the tests mentioned earlier.
> 
> Fix it by using "fconfigure $handle -encoding utf-8 -profile replace"
> in proc spawn_capture_tty_name, and proc gdb_stdin_log_init.  Also,
> the open_logs wrapper has been changed to invoke fconfigure using only
> "-encoding utf-8".  Testing showed that "-profile replace" wasn't
> necessary there.
> 
> Tested on Fedora 28 (Tcl 8.6.8), Fedora 43 (Tcl 9.0.2 / 8.6.16; expect
> uses 8.6.16), Fedora 44 (Tcl 9.0.2 / 8.6.17; expect uses 9.0.2), and
> Rawhide / Fedora 45 (Tcl 9.0.3 / 8.6.18; expect uses 9.0.3).
> 
> With regard to the Bug noted below, I haven't been able to reproduce
> the failures in gdb.ada/lazy-string.exp, but I've been informed that
> this commit fixes it.
> 
> Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=34146
> Reviewed-By: Tom de Vries <tdevries@suse.de>

I've pushed this change.

Kevin


      reply	other threads:[~2026-05-29 21:36 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-26 19:27 Kevin Buettner
2026-05-29 21:36 ` Kevin Buettner [this message]

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=20260529143624.4882c16b@f42-zbm-amd \
    --to=kevinb@redhat.com \
    --cc=gdb-patches@sourceware.org \
    /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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox