git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* Bug report: gitk unable to handle Unicode properly
@ 2021-04-16 16:21 Lars Kiesow
  2021-04-16 23:20 ` brian m. carlson
  0 siblings, 1 reply; 4+ messages in thread
From: Lars Kiesow @ 2021-04-16 16:21 UTC (permalink / raw)
  To: git

Hi everyone,
while fixing some Unicode problems in a project, I noticed that gitk
will not display Unicode characters correctly and may even crash if the
branch name consists of Unicode characters.

I'ts certainly not the end of the world (who is crazy enough to use 🖤
as a branch name) but could still cause problems.

Please find some additional information below.

Best regards,
Lars


What did you do before the bug happened? (Steps to reproduce your issue)

- Create a git branch named with a multi-byte Unicode character like:

        git checkout -b 🖤

- Launch gitk
    - Crash (see below)

- Switch to another branch

        git checkout xy

- Launch gitk
    - Branch names are not displayed properly


What did you expect to happen? (Expected behavior)

- Launching gitk, it should not crash and names like “🖤” should be
  displayed correctly


What happened instead? (Actual behavior)

- Launching while on the branch “🖤” crashed gitk.
  The reported error is:

        X Error of failed request:  BadLength (poly request too large or internal Xlib length error)
          Major opcode of failed request:  139 (RENDER)
          Minor opcode of failed request:  20 (RenderAddGlyphs)
          Serial number of failed request:  5225
          Current serial number in output stream:  5263

- Launching while on another branch but with the branch “🖤” makes that
  branch appear as ⌷⌷


What's different between what you expected and what actually happened?

- gitk should launch and display Unicode characters correctly


[System Info]
git version:
git version 2.30.2
cpu: x86_64
no commit associated with this build
sizeof-long: 8
sizeof-size_t: 8
shell-path: /bin/sh
uname: Linux 5.11.11-200.fc33.x86_64 #1 SMP Tue Mar 30 16:53:32 UTC
2021 x86_64 compiler info: gnuc: 10.2
libc info: glibc: 2.32
$SHELL (typically, interactive shell): /bin/zsh


[Enabled Hooks]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Bug report: gitk unable to handle Unicode properly
  2021-04-16 16:21 Bug report: gitk unable to handle Unicode properly Lars Kiesow
@ 2021-04-16 23:20 ` brian m. carlson
  2021-04-17  0:01   ` Chris Torek
  0 siblings, 1 reply; 4+ messages in thread
From: brian m. carlson @ 2021-04-16 23:20 UTC (permalink / raw)
  To: Lars Kiesow; +Cc: git

[-- Attachment #1: Type: text/plain, Size: 2301 bytes --]

On 2021-04-16 at 16:21:21, Lars Kiesow wrote:
> Hi everyone,
> while fixing some Unicode problems in a project, I noticed that gitk
> will not display Unicode characters correctly and may even crash if the
> branch name consists of Unicode characters.
> 
> I'ts certainly not the end of the world (who is crazy enough to use 🖤
> as a branch name) but could still cause problems.

I don't use gitk, but I decided to try to reproduce this nevertheless,
and I'm having a bit of trouble.

> What did you do before the bug happened? (Steps to reproduce your issue)
> 
> - Create a git branch named with a multi-byte Unicode character like:
> 
>         git checkout -b 🖤
> 
> - Launch gitk
>     - Crash (see below)

I don't see a crash.

> - Switch to another branch
> 
>         git checkout xy
> 
> - Launch gitk
>     - Branch names are not displayed properly

I do see the emoji displayed properly.

> What did you expect to happen? (Expected behavior)
> 
> - Launching gitk, it should not crash and names like “🖤” should be
>   displayed correctly

This is the behavior I see.  I'm using the Debian experimental packages
of gitk 1:2.31.0+next.20210315-1 and Debian unstable's tk 8.6.11+1.

Is it possible your version of Tcl or Tk is not properly set up for this
case?  I know nothing about either of those; Tcl is one of the few
reasonably common languages I have never worked with.

> What happened instead? (Actual behavior)
> 
> - Launching while on the branch “🖤” crashed gitk.
>   The reported error is:
> 
>         X Error of failed request:  BadLength (poly request too large or internal Xlib length error)
>           Major opcode of failed request:  139 (RENDER)
>           Minor opcode of failed request:  20 (RenderAddGlyphs)
>           Serial number of failed request:  5225
>           Current serial number in output stream:  5263
> 
> - Launching while on another branch but with the branch “🖤” makes that
>   branch appear as ⌷⌷

Can you tell us about your locale settings?  On most Linux systems,
running the program "locale" should show them.  I would expect something
bad might happen if you were not in a UTF-8 locale.
-- 
brian m. carlson (he/him or they/them)
Houston, Texas, US

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 263 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Bug report: gitk unable to handle Unicode properly
  2021-04-16 23:20 ` brian m. carlson
@ 2021-04-17  0:01   ` Chris Torek
  2021-04-17  0:35     ` brian m. carlson
  0 siblings, 1 reply; 4+ messages in thread
From: Chris Torek @ 2021-04-17  0:01 UTC (permalink / raw)
  To: brian m. carlson, Lars Kiesow, Git List

On Fri, Apr 16, 2021 at 4:21 PM brian m. carlson
<sandals@crustytoothpaste.net> wrote:
> On 2021-04-16 at 16:21:21, Lars Kiesow wrote:
> > - Launch gitk
> >     - Crash (see below)

> I don't see a crash.

I think this is a Tk/X11 interaction bug.

See, e.g., https://bugs.python.org/issue42225 (which has the same symptoms).

I'm no tcl/tk expert, but I vaguely remember other similar bug
reports.  They all turned out to need a tk-side fix.

Chris

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Bug report: gitk unable to handle Unicode properly
  2021-04-17  0:01   ` Chris Torek
@ 2021-04-17  0:35     ` brian m. carlson
  0 siblings, 0 replies; 4+ messages in thread
From: brian m. carlson @ 2021-04-17  0:35 UTC (permalink / raw)
  To: Chris Torek; +Cc: Lars Kiesow, Git List

[-- Attachment #1: Type: text/plain, Size: 929 bytes --]

On 2021-04-17 at 00:01:45, Chris Torek wrote:
> On Fri, Apr 16, 2021 at 4:21 PM brian m. carlson
> <sandals@crustytoothpaste.net> wrote:
> > On 2021-04-16 at 16:21:21, Lars Kiesow wrote:
> > > - Launch gitk
> > >     - Crash (see below)
> 
> > I don't see a crash.
> 
> I think this is a Tk/X11 interaction bug.
> 
> See, e.g., https://bugs.python.org/issue42225 (which has the same symptoms).
> 
> I'm no tcl/tk expert, but I vaguely remember other similar bug
> reports.  They all turned out to need a tk-side fix.

It seems from the linked bug report that this is fixed in Tk 8.6.11,
which I'm using, but not in Tk 8.6.10, which is available in Fedora 33.

So it sounds like this should probably be filed as a bug with Fedora.  I
don't know what their policy on backports is like, but they might be
willing to backport a fix to Fedora 33.
-- 
brian m. carlson (he/him or they/them)
Houston, Texas, US

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 263 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-04-17  0:36 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-16 16:21 Bug report: gitk unable to handle Unicode properly Lars Kiesow
2021-04-16 23:20 ` brian m. carlson
2021-04-17  0:01   ` Chris Torek
2021-04-17  0:35     ` brian m. carlson

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).