{"thread":{"id":"53256","subject":"gitk crashes if the diff contains certain unicode characters","startedAt":"2020-04-19T12:24:17Z","lastAt":"2020-04-19T14:31:18Z","messageCount":3,"participants":["Glax","Andreas Schwab","Danh Doan"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"395716","messageId":"edace460-d252-2742-7576-e7601b6e959c@dragon.best","threadId":"53256","inReplyTo":null,"subject":"gitk crashes if the diff contains certain unicode characters","fromName":"Glax","fromEmail":"glax@dragon.best","sentAt":"2020-04-19T12:15:06Z","receivedAt":"2020-04-19T12:24:17Z","isPatch":false,"sender":{"key":"glax@dragon.best","avatar":null},"body":"Looks like certain characters cause gitk to crash when it tries to\nrender a diff.\n\n\nHow to repro:\n\n\tgit init\n\techo foo >foo\n\tgit add foo\n\tgit commit -m foo\n\t# The following assumes bash builtin echo\n\techo -e '\\u2754' >foo\n\tgitk\n\nNow `foo` should contain the character U+2754 encoded as utf-8.\n\nIf on gitk you click on \"Local uncommitted changes\", it'll crash with\nthe following message:\n\n\tX Error of failed request:  BadLength (poly request too large or\ninternal Xlib length error)\n\t  Major opcode of failed request:  139 (RENDER)\n\t  Minor opcode of failed request:  20 (RenderAddGlyphs)\n\t  Serial number of failed request:  4220\n\t  Current serial number in output stream:  4247\n\n\nNote that if I now commit, gitk will crash at startup because the diff\nwith the character are on the last commit (which gitk selects by default)\n\n\tgit commit -am crash\n\tgitk # crashes\n\tgitk HEAD^ # works fine\n\n\nAfter that, you can add a couple more commits and gitk works fine,\nunless you click on one of the commits whose diff contain the character.\neg:\n\n\techo foo >foo\n\tgit commit -am foo\n\techo bar >foo\n\tgit commit -am bar\n\tgitk\n\n\nVersion / System:\n\n\t$ git --version\n\tgit version 2.20.1\n\t$ lsb_release -d\n\tDescription:    Ubuntu 19.10\n\n"},{"id":"395725","messageId":"878sirmxwb.fsf@igel.home","threadId":"53256","inReplyTo":"edace460-d252-2742-7576-e7601b6e959c@dragon.best","subject":"Re: gitk crashes if the diff contains certain unicode characters","fromName":"Andreas Schwab","fromEmail":"schwab@linux-m68k.org","sentAt":"2020-04-19T13:02:28Z","receivedAt":"2020-04-19T13:03:05Z","isPatch":false,"sender":{"key":"schwab@linux-m68k.org","avatar":"https://avatars.githubusercontent.com/u/2175493?v=4"},"body":"On Apr 19 2020, Glax wrote:\n\n> Now `foo` should contain the character U+2754 encoded as utf-8.\n>\n> If on gitk you click on \"Local uncommitted changes\", it'll crash with\n> the following message:\n\nWorksforme.  Could be a bug in your tk library.\n\nAndreas.\n\n-- \nAndreas Schwab, schwab@linux-m68k.org\nGPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1\n\"And now for something completely different.\"\n"},{"id":"395729","messageId":"20200419143008.GD28207@danh.dev","threadId":"53256","inReplyTo":"edace460-d252-2742-7576-e7601b6e959c@dragon.best","subject":"Re: gitk crashes if the diff contains certain unicode characters","fromName":"Danh Doan","fromEmail":"congdanhqx@gmail.com","sentAt":"2020-04-19T14:30:08Z","receivedAt":"2020-04-19T14:31:18Z","isPatch":false,"sender":{"key":"congdanhqx@gmail.com","avatar":"https://avatars.githubusercontent.com/u/42673067?v=4"},"body":"On 2020-04-19 14:15:06+0200, Glax <glax@dragon.best> wrote:\n> Looks like certain characters cause gitk to crash when it tries to\n> render a diff.\n> \n> \n> How to repro:\n> \n> \tgit init\n> \techo foo >foo\n> \tgit add foo\n> \tgit commit -m foo\n> \t# The following assumes bash builtin echo\n> \techo -e '\\u2754' >foo\n> \tgitk\n> \n> Now `foo` should contain the character U+2754 encoded as utf-8.\n> \n> If on gitk you click on \"Local uncommitted changes\", it'll crash with\n> the following message:\n> \n> \tX Error of failed request:  BadLength (poly request too large or\n> internal Xlib length error)\n> \t  Major opcode of failed request:  139 (RENDER)\n> \t  Minor opcode of failed request:  20 (RenderAddGlyphs)\n> \t  Serial number of failed request:  4220\n> \t  Current serial number in output stream:  4247\n\nU+2754 is *WHITE* QUESTION MARK ORNAMENT\nThe error message is very familiar to me.\n\nI /think/ it's a bug in libXft, it can't handle colored emoji, yet.\n\nThere're similar issue reported to Google Noto Emoji font:\nhttps://github.com/googlefonts/noto-emoji/issues/183\n\n\n-- \nDanh\n"}]}