From unknown Sat Jun 21 03:30:00 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#49066 <49066@debbugs.gnu.org> To: bug#49066 <49066@debbugs.gnu.org> Subject: Status: 26.3; Segmentation fault on specific utf8 string Reply-To: bug#49066 <49066@debbugs.gnu.org> Date: Sat, 21 Jun 2025 10:30:00 +0000 retitle 49066 26.3; Segmentation fault on specific utf8 string reassign 49066 emacs submitter 49066 "Miguel V. S. Frasson" severity 49066 normal tag 49066 patch thanks From debbugs-submit-bounces@debbugs.gnu.org Wed Jun 16 17:07:47 2021 Received: (at submit) by debbugs.gnu.org; 16 Jun 2021 21:07:47 +0000 Received: from localhost ([127.0.0.1]:53442 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ltclG-0004iq-CZ for submit@debbugs.gnu.org; Wed, 16 Jun 2021 17:07:46 -0400 Received: from lists.gnu.org ([209.51.188.17]:34138) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ltclE-0004ih-2b for submit@debbugs.gnu.org; Wed, 16 Jun 2021 17:07:44 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:56512) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ltclC-0002KQ-Pb for bug-gnu-emacs@gnu.org; Wed, 16 Jun 2021 17:07:43 -0400 Received: from mail-lj1-x22d.google.com ([2a00:1450:4864:20::22d]:34309) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ltcl6-00079N-8p for bug-gnu-emacs@gnu.org; Wed, 16 Jun 2021 17:07:42 -0400 Received: by mail-lj1-x22d.google.com with SMTP id a21so770725ljj.1 for ; Wed, 16 Jun 2021 14:07:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to :content-transfer-encoding; bh=7KS4ZzIvTTS1zM6jpO2eEJtD5ua1C7B0Fxz3guU+eO8=; b=GNCJw3akyq6U66twRvobiRI2p5ME5wmMfUeoWQvvM93mW+aobWp8wkLSovPCbDNoCf 2jcwuGyhWD34A3AI9abefYXLw4RuJotYIcJnBVuWEmi9x08vJrFPNFHIFAG1aL60SvN3 X9qPnuZlFC6o4qNcP8FXLbQzGvQD/KEAFCfoE26Jx/x5kfpQGR+gCmbYvnTXmXF3lns4 hfcTV33b7osboqPfhFzOt6yCPxiH3Ey5kK5O02cmlbb2jXfwe3Ks0y6mD27Z+p6VQ5n2 bMcUviLg25ybyFinl+abb//o/I5cWJzrkfjAqVRxBd4CK+v+pe8OqyWwBe7Q//BEsorC wCtA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to :content-transfer-encoding; bh=7KS4ZzIvTTS1zM6jpO2eEJtD5ua1C7B0Fxz3guU+eO8=; b=ryceuCQDcPyqUXxnTXUuZi/EqH8t7kmmb2RAxgNU1VEnIKBtuPcKrwzdq53sD8ICWm BkE+pHD760/UzgQsVhs1QyUNTW/Bkjaf0zBkV1J9Rr7PgIj+HpEy7Yc323KWPEBmACiE UlMlA0csc+568g0ZjzHuO8GV6ILUhHEu7kbIrh1UODF6jejAbGkBG2D2J58xbcbRq8QY 2z070aA1a5VAE7zItZyXmbZMVDLTPgyzpf5ovIATKGCHvSuHVxXTCwENnLwvuENEkcDG Q7JdobXiVqW4SLbH6BQjcKXlKQQOubWv+sJKVi3ULy6hrfbYFE9ukPVJsxcRyTZ8L6gj xb8A== X-Gm-Message-State: AOAM53063nYbQuAzHGy7SbdE6MJSwWy9+z4Sw43MKT/vVQHKPbfEDQP1 ecUN42EkOD6YVXIuSyKPpQjSNuGtrfcHHkwT72oIKbl+uC9O8Q== X-Google-Smtp-Source: ABdhPJwcZvtf2A7W3kmoj8mgAPjprGQVeW/mvBefVfg0EPbfrIc9qOrCO3NDzed4hQA8mTnSq/ogMVussKSbB7Yd68Q= X-Received: by 2002:a2e:8e74:: with SMTP id t20mr1494618ljk.397.1623877652888; Wed, 16 Jun 2021 14:07:32 -0700 (PDT) MIME-Version: 1.0 From: "Miguel V. S. Frasson" Date: Wed, 16 Jun 2021 18:07:06 -0300 Message-ID: Subject: 26.3; Segmentation fault on specific utf8 string To: bug-gnu-emacs@gnu.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=2a00:1450:4864:20::22d; envelope-from=mvsfrasson@gmail.com; helo=mail-lj1-x22d.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.3 (-) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) Dear Emacs developers I was editting a "comma-separated values" csv file for a geographic map creation, tried simple edition commands that now I see that wer irrelevant to bug reprodution. I managed to isolate the problem. It seams that my version of emacs with gui is unable to display a specific UTF8 line of a file possibly with mixing of text LTR and RTL and crashes. To help debug, I read /usr/share/emacs/26.3/etc/DEBUG, downloaded Emacs sources from 2 places, builded to see if I can reproduce that. I tried these versions: * from Ubuntu package GNU Emacs 26.3 (build 2, x86_64-pc-linux-gnu, GTK+ Version 3.24.13) of 2019-12-24 -> emacs -Q foo -> always crash (I did it more tahn 20 times) same emacs, no gui -> emacs -nw -Q foo -> no crash * git GNU Emacs 28.0.50 (build 1, x86_64-pc-linux-gnu) of 2021-06-16 without toolkits and images --> no crash (1h30 of compilation time discoraged me to try to recompile) * 26.3 compiled from source download from http://ftpmirror.gnu.org/emacs/ - without toolkits -> no crash - with gtk3 -> no crash So I got stuck with my usual emacs without debug symbols and gtk ... How to reproduce: 1) Since just displaying the line crashes my Emacs I like to avoid display it below. So please download the 641 bytes file "foo" from wget https://sites.icmc.usp.br/frasson/foo Its content is just 1 line of UTF8 text with the name of Saint Pierre and Miquelon Islands in several languages. You can obtain it also decoding the following base64 output with "base64 -d= ": UTM0NjE3LNiz2KfZhiDYqNmK2YrYsSDZiNmF2YrZg9mE2YjZhizgprjgpr7gpoEg4Kaq4Ka/4Ka= v 4Ka84KeH4KawIOCmkyDgpq7gpr/gppXigIzgprLgp4vgpoEsU2FpbnQtUGllcnJlIHVuZCBNaXF= 1 ZWxvbixTYWludCBQaWVycmUgYW5kIE1pcXVlbG9uLFNhbiBQZWRybyB5IE1pcXVlbMOzbixTYWl= u dC1QaWVycmUtZXQtTWlxdWVsb24szqPOsc65zr0gzqDOuc61z4EgzrrOsc65IM6czrnOus61zrv= P jM69LOCkuOCkvuCkgS3gpKrgpY3gpK/gpYfgpLAg4KSU4KSwIOCkruClgOCkleClh+CksuCli+C= k gixTYWludC1QaWVycmUgw6lzIE1pcXVlbG9uLFNhaW50IFBpZXJyZSBkYW4gTWlxdWVsb24sU2F= p bnQtUGllcnJlIGUgTWlxdWVsb24s44K144Oz44OU44Ko44O844Or5bO244O744Of44Kv44Ot44O= z 5bO2LOyDne2UvOyXkOultCDrr7jtgbTrobEsU2FpbnQtUGllcnJlIGVuIE1pcXVlbG9uLFNhaW5= 0 LVBpZXJyZSBpIE1pcXVlbG9uLFNhaW50LVBpZXJyZSBlIE1pcXVlbG9uLNCh0LXQvS3Qn9GM0LX= R gCDQuCDQnNC40LrQtdC70L7QvSxTYWludC1QaWVycmUgb2NoIE1pcXVlbG9uLFNhaW50IFBpZXJ= y ZSB2ZSBNaXF1ZWxvbixTYWludC1QaWVycmUgdsOgIE1pcXVlbG9uLOWco+earuWfg+WwlOWSjOW= v huWFi+mahue+pOWymwo=3D 2) emacs -nw -Q foo Ok, exit Emacs, no crash. 3) emacs -Q foo Emacs crashes :-X 4) I see that with "emacs -nw -Q foo", if I delete the initial Q (or maybe a character that resembles Q), text direction changes abruptly, display/navigation gets crasy, just navigating with left and right arrow keys, we jump from first line to last, some up and down keys jumps a lot. This happens even with trunk git emacs that I compiled. If you like to see this, I recorded a screencast (2.63Mb): wget https://sites.icmc.usp.br/frasson/emacs-navigation.mp4 >From command line I get the following output: Fatal error 11: Segmentation fault Backtrace: emacs[0x51ab42] emacs[0x500211] emacs[0x518f14] emacs[0x51914d] emacs[0x5191cd] /lib/x86_64-linux-gnu/libpthread.so.0(+0x153c0)[0x7f7fca29b3c0] emacs[0x5ebe9b] emacs[0x5ef70d] emacs[0x58a752] emacs[0x57913c] emacs[0x5b8174] emacs[0x57bb61] emacs[0x5790bb] emacs[0x5783fa] emacs[0x4369ac] emacs[0x443276] emacs[0x5d9aa8] emacs[0x5ddbe0] emacs[0x44f664] emacs[0x44d695] emacs[0x4556f8] emacs[0x45a843] emacs[0x46f0c3] emacs[0x472183] emacs[0x57829e] emacs[0x43a016] emacs[0x45e079] emacs[0x50a447] emacs[0x50dad0] emacs[0x50f1e4] emacs[0x578206] emacs[0x5005d4] emacs[0x578175] emacs[0x500573] emacs[0x5057b7] emacs[0x505b18] emacs[0x4206d2] /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf3)[0x7f7fc9f870b3] emacs[0x4213de] Falha de segmenta=C3=A7=C3=A3o Best regards Miguel In GNU Emacs 26.3 (build 2, x86_64-pc-linux-gnu, GTK+ Version 3.24.13) of 2019-12-24 built on lcy01-amd64-029 Windowing system distributor 'The X.Org Foundation', version 11.0.12009000 System Description: Ubuntu 20.04.2 LTS Recent messages: For information about GNU Emacs and the GNU system, type C-h C-a. saida-raw50.csv has auto save data; consider M-x recover-this-file Mark set Type y, n, ! or SPC (the space bar): Defining kbd macro... Mark set [2 times] Replaced 169 occurrences Keyboard macro defined Configured using: 'configure --build=3Dx86_64-linux-gnu --prefix=3D/usr '--includedir=3D${prefix}/include' '--mandir=3D${prefix}/share/man' '--infodir=3D${prefix}/share/info' --sysconfdir=3D/etc --localstatedir=3D/= var --disable-silent-rules '--libdir=3D${prefix}/lib/x86_64-linux-gnu' '--libexecdir=3D${prefix}/lib/x86_64-linux-gnu' --disable-maintainer-mode --disable-dependency-tracking --prefix=3D/usr --sharedstatedir=3D/var/lib --program-suffix=3D26 --with-modules --with-file-notification=3Dinotify --with-mailutils --with-x=3Dyes --with-x-toolkit=3Dgtk3 --with-xwidgets --with-lcms2 'CFLAGS=3D-g -O2 -fdebug-prefix-map=3D/build/emacs26-XQGPla/emacs26-26.3~1.git96dd019=3D. -fstack-protector-strong -Wformat -Werror=3Dformat-security -no-pie' 'CPPFLAGS=3D-Wdate-time -D_FORTIFY_SOURCE=3D2' 'LDFLAGS=3D-Wl,-Bsymbolic-functions -Wl,-z,relro -no-pie'' Configured features: XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK SOUND GPM DBUS GSETTINGS GLIB NOTIFY LIBSELINUX GNUTLS LIBXML2 FREETYPE M17N_FLT LIBOTF XFT ZLIB TOOLKIT_SCROLL_BARS GTK3 X11 XDBE XIM MODULES THREADS XWIDGETS LIBSYSTEMD LCMS2 Important settings: value of $LANG: pt_BR.UTF-8 locale-coding-system: utf-8-unix Major mode: Fundamental Minor modes in effect: tooltip-mode: t global-eldoc-mode: t electric-indent-mode: t mouse-wheel-mode: t tool-bar-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t line-number-mode: t transient-mark-mode: t Load-path shadows: None found. Features: (shadow sort mail-extr emacsbug message rmc puny seq byte-opt gv bytecomp byte-compile cconv dired dired-loaddefs format-spec rfc822 mml mml-sec password-cache epa derived epg epg-config gnus-util rmail rmail-loaddefs mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils macros misearch multi-isearch kmacro cl-extra help-mode easymenu cl-loaddefs cl-lib novice elec-pair time-date mule-util tooltip eldoc electric uniquify ediff-hook vc-hooks lisp-float-type mwheel term/x-win x-win term/common-win x-dnd tool-bar dnd fontset image regexp-opt fringe tabulated-list replace newcomment text-mode elisp-mode lisp-mode prog-mode register page menu-bar rfn-eshadow isearch timer select scroll-bar mouse jit-lock font-lock syntax facemenu font-core term/tty-colors frame cl-generic cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese composite charscript charprop case-table epa-hook jka-cmpr-hook help simple abbrev obarray minibuffer cl-preloaded nadvice loaddefs button faces cus-face macroexp files text-properties overlay sha1 md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote threads dbusbind inotify lcms2 dynamic-setting system-font-setting font-render-setting xwidget-internal move-toolbar gtk x-toolkit x multi-tty make-network-process emacs) Memory information: ((conses 16 99690 8444) (symbols 48 20739 1) (miscs 40 284 240) (strings 32 29677 1323) (string-bytes 1 787981) (vectors 16 15049) (vector-slots 8 550898 10514) (floats 8 51 224) (intervals 56 261 0) (buffers 992 13)) --=20 Miguel Vinicius Santini Frasson mvsfrasson@gmail.com From debbugs-submit-bounces@debbugs.gnu.org Wed Jun 16 17:12:55 2021 Received: (at 49066) by debbugs.gnu.org; 16 Jun 2021 21:12:55 +0000 Received: from localhost ([127.0.0.1]:53451 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ltcqF-0004rO-Lf for submit@debbugs.gnu.org; Wed, 16 Jun 2021 17:12:55 -0400 Received: from quimby.gnus.org ([95.216.78.240]:48704) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ltcqD-0004rB-Vk for 49066@debbugs.gnu.org; Wed, 16 Jun 2021 17:12:54 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=kE7OR0bcvhvGes8rpGUwYjwIxYmVmcdpASwUKSBb2Fw=; b=uxPJzkYSYzZM0ScjswPpyF6Zl7 6V4tWVvfZmbVW/rffcSzBhurMk9PAFcQ2OBy8UnKJM8rkZU4f7pID7jRv1r2AqHj1alKpmdZVI3SE 9uiqzLw6rpTH1Vs7tjoE2d/KmER++lMg0plrnkQW94yflMeIZKhoB00bEZS+Cxnci+WM=; Received: from cm-84.212.220.105.getinternet.no ([84.212.220.105] helo=xo) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ltcq4-000071-P7; Wed, 16 Jun 2021 23:12:47 +0200 From: Lars Ingebrigtsen To: "Miguel V. S. Frasson" Subject: Re: bug#49066: 26.3; Segmentation fault on specific utf8 string References: Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAABGdBTUEAALGPC/xhBQAAACBj SFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAFVBMVEVXbq5uktalelSq qLpSMCRALi////+1HfPUAAAAAWJLR0QGYWa4fQAAAAd0SU1FB+UGEBULOIQfgmAAAAGXSURBVDjL dZJbjoMwDEXNTPtPxA6cdAGQLmAUOf8Vsve/lbHjQAttrUZQH1+/AgwBzvaTcyIYcph/5+mAYwMh BDswqCcYHyHnhQ45xj3V3RSjxo9hzCHMwV+XqIphznmaQp4nLTY7WrrCSni024he3MGLja3dAOFs qiBVXN9BU8C7YvLJv4HwESyfQcz5myKnb4oEV1GDw4zQFOL2MCHYUyPjEndgst1yijqgnG/2esmk 4HFy34R5MVCPxHKyKhKQHHKR1l4b4EovmovGPbqi8t+1ix7A1FKtBqhWrlsBMiDLqsVJ3/Vnfmam +go2q+wCAy2Vu5MwsYN7aaBbYuoCSSUuNod2rGUKcRfIHWMGsXItvdexa7hhxL5dk7TyBtZbMYUb u4ZVT5iwPMHWrh4kLBHqDsTGs4NiYL9ARVXslCNoQ7gfVwfs66quKchYGmBfSZtGGFHWDbjEGm1+ KaQAoWfgVqjgzQBrw+CdeF+YnKIpLE3tfmzPtYPq69BN4B6g/0Bs272ffVT7YLt/ffr7l9wvW0o6 gn9wV9K5EXjSaQAAACV0RVh0ZGF0ZTpjcmVhdGUAMjAyMS0wNi0xNlQyMToxMTo1NiswMDowMGvb OQ4AAAAldEVYdGRhdGU6bW9kaWZ5ADIwMjEtMDYtMTZUMjE6MTE6NTYrMDA6MDAahoGyAAAAAElF TkSuQmCC X-Now-Playing: Laura Veirs's _Troubled by the Fire_: "The Ballad of John Vogelin" Date: Wed, 16 Jun 2021 23:12:44 +0200 In-Reply-To: (Miguel V. S. Frasson's message of "Wed, 16 Jun 2021 18:07:06 -0300") Message-ID: <871r91ikdv.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: "Miguel V. S. Frasson" writes: > * git GNU Emacs 28.0.50 (build 1, x86_64-pc-linux-gnu) of 2021-06-16 > without toolkits and images --> no crash > (1h30 of compilation time discoraged me to try to recompile) Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 49066 Cc: 49066@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) "Miguel V. S. Frasson" writes: > * git GNU Emacs 28.0.50 (build 1, x86_64-pc-linux-gnu) of 2021-06-16 > without toolkits and images --> no crash > (1h30 of compilation time discoraged me to try to recompile) I can reproduce the crash in Emacs 26.1, but not in Emacs 27.1, so I guess this has been fixed in later versions of Emacs? -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From debbugs-submit-bounces@debbugs.gnu.org Wed Jun 16 17:23:11 2021 Received: (at 49066) by debbugs.gnu.org; 16 Jun 2021 21:23:11 +0000 Received: from localhost ([127.0.0.1]:53457 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ltd0B-00059B-Jg for submit@debbugs.gnu.org; Wed, 16 Jun 2021 17:23:11 -0400 Received: from mail-lf1-f42.google.com ([209.85.167.42]:38446) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ltd09-00058w-2t for 49066@debbugs.gnu.org; Wed, 16 Jun 2021 17:23:09 -0400 Received: by mail-lf1-f42.google.com with SMTP id r5so6660434lfr.5 for <49066@debbugs.gnu.org>; Wed, 16 Jun 2021 14:23:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=V4lXUENbMtoJjIzPPk5ScWhiEYuREfccmZxN60z5578=; b=Hi/4eY4x3CH0lXePlAQw9jcQLHg08MgMq8OE2zGSB4tDdUczf4y5Fo8fNy9aJQNi44 owuXuhB+PeKbwsaPf2134e41DHztONX4wugrM4Zigf2/2IEffE1ub/ER5hggXbb96JkG oMDovBG0Ncf/eHVV9S5TLMtbHF1wwxmSJj/hmLtAvSBu4EVG1qfRMM8uCnOoAbCut/0C SFCz4u7mVtzVWPa2JtFObYKWv3lv6JdLnRGBNYD3DpHro8EzkA8dTjT8okMI87ObsqiM iAzmLxySKWgT7VxifVkMjaco+c4QD9vslfhDVKAAxlQhR0QF3KPuz4HSbkRbOpPas3PF WTLQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=V4lXUENbMtoJjIzPPk5ScWhiEYuREfccmZxN60z5578=; b=mD2jfwGPkjN5WBRYwKsuE85YkVL8WNDESQkg6k1pZd1c7Td61EDzV1xtCGeTjHYTT2 Zibf4Iz8zGRWa9HFUTHYdFZporWvFElvUYVc1aruQ5HdGnu/2VyHkJFO08eNh1L3V8L+ pEYUjQYdMxJ4p3scof8DeeTk4CPEapsAD6EVq4VeeNRgP3aaf++OZAnWoNCr57byN8lb STS/o5DFMN0wy6K+7QSnvx/yz2Rm0+ndx/xRLhAiUutCTykZUtdZ0X2Ju9wTlkEgHA64 NXT289IZTCkgB9z+NwcIDaDf+06CtLHEQuIH4+0Lb+2+ysHrstPfxJgmkrSJYZuu9roh 1//w== X-Gm-Message-State: AOAM530sRyM5k6whbszk9IfXPY0EmWSw9CzkOV2I5xX8kmq6ng52qk60 /XRDuxrcpqLhxJHs6wZXDgj0UpdiRaMhD73YNiu1Bh6RTWo= X-Google-Smtp-Source: ABdhPJwWUCXMUxPnYS5Bjtea8xQ9tePDitAThDz7R+gjskm8+vJxUKkaO6Y5Le3qZra0/leH1CpfFiwSgJQimYoKa3w= X-Received: by 2002:a05:6512:3a4:: with SMTP id v4mr1317279lfp.127.1623878582368; Wed, 16 Jun 2021 14:23:02 -0700 (PDT) MIME-Version: 1.0 From: "Miguel V. S. Frasson" Date: Wed, 16 Jun 2021 18:22:35 -0300 Message-ID: Subject: file foo To: 49066@debbugs.gnu.org Content-Type: multipart/mixed; boundary="0000000000000ffb3605c4e8b205" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 49066 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --0000000000000ffb3605c4e8b205 Content-Type: text/plain; charset="UTF-8" -- Miguel Vinicius Santini Frasson mvsfrasson@gmail.com --0000000000000ffb3605c4e8b205 Content-Type: application/octet-stream; name=foo Content-Disposition: attachment; filename=foo Content-Transfer-Encoding: base64 Content-ID: X-Attachment-Id: f_kpzzd0tw0 UTM0NjE3LNiz2KfZhiDYqNmK2YrYsSDZiNmF2YrZg9mE2YjZhizgprjgpr7gpoEg4Kaq4Ka/4Kav 4Ka84KeH4KawIOCmkyDgpq7gpr/gppXigIzgprLgp4vgpoEsU2FpbnQtUGllcnJlIHVuZCBNaXF1 ZWxvbixTYWludCBQaWVycmUgYW5kIE1pcXVlbG9uLFNhbiBQZWRybyB5IE1pcXVlbMOzbixTYWlu dC1QaWVycmUtZXQtTWlxdWVsb24szqPOsc65zr0gzqDOuc61z4EgzrrOsc65IM6czrnOus61zrvP jM69LOCkuOCkvuCkgS3gpKrgpY3gpK/gpYfgpLAg4KSU4KSwIOCkruClgOCkleClh+CksuCli+Ck gixTYWludC1QaWVycmUgw6lzIE1pcXVlbG9uLFNhaW50IFBpZXJyZSBkYW4gTWlxdWVsb24sU2Fp bnQtUGllcnJlIGUgTWlxdWVsb24s44K144Oz44OU44Ko44O844Or5bO244O744Of44Kv44Ot44Oz 5bO2LOyDne2UvOyXkOultCDrr7jtgbTrobEsU2FpbnQtUGllcnJlIGVuIE1pcXVlbG9uLFNhaW50 LVBpZXJyZSBpIE1pcXVlbG9uLFNhaW50LVBpZXJyZSBlIE1pcXVlbG9uLNCh0LXQvS3Qn9GM0LXR gCDQuCDQnNC40LrQtdC70L7QvSxTYWludC1QaWVycmUgb2NoIE1pcXVlbG9uLFNhaW50IFBpZXJy ZSB2ZSBNaXF1ZWxvbixTYWludC1QaWVycmUgdsOgIE1pcXVlbG9uLOWco+earuWfg+WwlOWSjOWv huWFi+mahue+pOWymwo= --0000000000000ffb3605c4e8b205-- From debbugs-submit-bounces@debbugs.gnu.org Thu Jun 17 02:43:49 2021 Received: (at 49066) by debbugs.gnu.org; 17 Jun 2021 06:43:49 +0000 Received: from localhost ([127.0.0.1]:53654 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ltlki-0002mC-PT for submit@debbugs.gnu.org; Thu, 17 Jun 2021 02:43:48 -0400 Received: from eggs.gnu.org ([209.51.188.92]:52234) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ltlkg-0002lz-Lq for 49066@debbugs.gnu.org; Thu, 17 Jun 2021 02:43:47 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:50722) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ltlkb-0003D0-AK; Thu, 17 Jun 2021 02:43:41 -0400 Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:1259 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ltlkX-00019I-6e; Thu, 17 Jun 2021 02:43:41 -0400 Date: Thu, 17 Jun 2021 09:43:40 +0300 Message-Id: <83czsl0z4z.fsf@gnu.org> From: Eli Zaretskii To: Lars Ingebrigtsen In-Reply-To: <871r91ikdv.fsf@gnus.org> (message from Lars Ingebrigtsen on Wed, 16 Jun 2021 23:12:44 +0200) Subject: Re: bug#49066: 26.3; Segmentation fault on specific utf8 string References: <871r91ikdv.fsf@gnus.org> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 49066 Cc: 49066@debbugs.gnu.org, mvsfrasson@gmail.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Lars Ingebrigtsen > Date: Wed, 16 Jun 2021 23:12:44 +0200 > Cc: 49066@debbugs.gnu.org > > "Miguel V. S. Frasson" writes: > > > * git GNU Emacs 28.0.50 (build 1, x86_64-pc-linux-gnu) of 2021-06-16 > > without toolkits and images --> no crash > > (1h30 of compilation time discoraged me to try to recompile) > > I can reproduce the crash in Emacs 26.1, but not in Emacs 27.1, so I > guess this has been fixed in later versions of Emacs? I cannot reproduce at all, neither in Emacs 26 nor in all subsequent versions. Lars, can you show a backtrace from the crash? Perhaps if I see that, I could tell if it's a known (and fixed) problem. Thanks. From debbugs-submit-bounces@debbugs.gnu.org Thu Jun 17 03:43:20 2021 Received: (at 49066) by debbugs.gnu.org; 17 Jun 2021 07:43:20 +0000 Received: from localhost ([127.0.0.1]:53715 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ltmgG-0006Uo-FB for submit@debbugs.gnu.org; Thu, 17 Jun 2021 03:43:20 -0400 Received: from mail-wm1-f51.google.com ([209.85.128.51]:39515) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ltmgA-0006UT-Rx for 49066@debbugs.gnu.org; Thu, 17 Jun 2021 03:43:15 -0400 Received: by mail-wm1-f51.google.com with SMTP id l18-20020a1ced120000b029014c1adff1edso5665314wmh.4 for <49066@debbugs.gnu.org>; Thu, 17 Jun 2021 00:43:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :mime-version; bh=OLyxXLpoRPQKovIASSbDC2afmnYUa5aDNx75piVJJCw=; b=TiQ1MfrDKioXgl18iZhm5WU5UK+jLDmn0KO+TPZAjUeJ8hx9Jpxv05oKe1pRV/AaSF QBizF6qLgff6KVx561AXeeepSMBYcDPthofn4f7luyfRD2OuNoWtKblKibYju3Utnxyp 6elQbTFXY5X6t/GTzWEc2f3GF6wqPGPbsgDvsAtJW58/nwPXEv67wHdJZy8qmtAWIpG3 pHvh0dEvhallk6cyIKs9xwdXXH3Dn2+BowJfhRSKQsomFmmjqF9MYvc5xcYLTOwTOEIr 0q6zqyxY7mxSSLIiXBLfeIByFsEHTWZll8/sB3NbN86RoGQGdEfV1IqSnbxillgUmVAu THiQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:mime-version; bh=OLyxXLpoRPQKovIASSbDC2afmnYUa5aDNx75piVJJCw=; b=BecCO8hUhwNdxdfPZc0dCOZFZ8LlO/0swsIqkjDhhtDvSNcg4agVxUrLYH/f1YpZ8e FxoZloQ/egv4qGsqNgmsqenC0TXMino987j20DfvetpAIkVU/UwP3qGbqbDkL8QSpjnx fiat9wgNlbnGN1ZXBXpTvNB8Ew0TGLGKCI8lJVclSgHfJWAf1kKtFpNFmrH77ameynzD nxFuKjPNaXhiFAf9B2iHZwWbJcFXdSD4cf0ZskkT4ZP1W3LF2Yh7Y2tjrFEXZ8J+YxQZ b5Y1NxO4WrXG1xqFxX4PPGbw8ZtJzd+Z6LCJhuLKFWmxqqHis5j1olPx8CdL4qrCC8Wr 4X1A== X-Gm-Message-State: AOAM533pl/CZ8OHvE1a5syoL9CapKNNyi0u+iOcSN14iXLctRiNWdr7I rlbs02xytMDgtIMxeRT4kV0= X-Google-Smtp-Source: ABdhPJwGCHgRjdqYMzpS/6PgzKtVxmNDL0ZzdXLqc/Xu/231KvRiyc4thjn7qK2UoPSRY7jRWOA4ZA== X-Received: by 2002:a7b:cd8f:: with SMTP id y15mr3395430wmj.20.1623915785040; Thu, 17 Jun 2021 00:43:05 -0700 (PDT) Received: from rltb ([82.66.8.55]) by smtp.gmail.com with ESMTPSA id p5sm4794441wrd.25.2021.06.17.00.43.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 17 Jun 2021 00:43:04 -0700 (PDT) From: Robert Pluim To: Eli Zaretskii Subject: Re: bug#49066: 26.3; Segmentation fault on specific utf8 string References: <871r91ikdv.fsf@gnus.org> <83czsl0z4z.fsf@gnu.org> Date: Thu, 17 Jun 2021 09:43:03 +0200 In-Reply-To: <83czsl0z4z.fsf@gnu.org> (Eli Zaretskii's message of "Thu, 17 Jun 2021 09:43:40 +0300") Message-ID: <87czsl543c.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 49066 Cc: 49066@debbugs.gnu.org, Lars Ingebrigtsen , mvsfrasson@gmail.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) >>>>> On Thu, 17 Jun 2021 09:43:40 +0300, Eli Zaretskii said: >> I can reproduce the crash in Emacs 26.1, but not in Emacs 27.1, so I >> guess this has been fixed in later versions of Emacs? Eli> I cannot reproduce at all, neither in Emacs 26 nor in all subsequent Eli> versions. Eli> Lars, can you show a backtrace from the crash? Perhaps if I see that, Eli> I could tell if it's a known (and fixed) problem. Eli> Thanks. This is from an optimized build of emacs-26.1. I can redo it with a '-g3 -O0' if you want. Thread 1 "emacs" received signal SIGSEGV, Segmentation fault. ftfont_shape_by_flt (matrix=, otf=, ft_face=, font=, lgstring=...) at ftfont.c:2573 2573 g->g.to = LGLYPH_TO (LGSTRING_GLYPH (lgstring, g->g.to)); (gdb) bt #0 ftfont_shape_by_fltPython Exception value has been optimized out: (matrix=, otf=, ft_face=, font=, lgstring=) at ftfont.c:2573 #1 ftfont_shapePython Exception value has been optimized out: (lgstring=, lgstring@entry=XIL(0xaa2755)) at ftfont.c:2615 #2 0x00000000005d97f5 in xftfont_shape (lgstring=XIL(0xaa2755)) at xftfont.c:670 #3 0x000000000057fc2a in Ffont_shape_gstringPython Exception value has been optimized out: (gstring=) at font.c:4427 #4 0x000000000056fede in funcall_subr (subr=0x97fac0 , numargs=numargs@entry=1, args=args@entry=0x7fffffff59a0) at eval.c:2844 #5 0x000000000056ecff in Ffuncall (nargs=, args=args@entry=0x7fffffff5998) at lisp.h:600 Robert -- From debbugs-submit-bounces@debbugs.gnu.org Thu Jun 17 04:13:30 2021 Received: (at 49066) by debbugs.gnu.org; 17 Jun 2021 08:13:30 +0000 Received: from localhost ([127.0.0.1]:53741 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ltn9S-0007Ks-9H for submit@debbugs.gnu.org; Thu, 17 Jun 2021 04:13:30 -0400 Received: from eggs.gnu.org ([209.51.188.92]:43596) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ltn9M-0007KY-TC for 49066@debbugs.gnu.org; Thu, 17 Jun 2021 04:13:25 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:55068) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ltn9H-0004yi-74; Thu, 17 Jun 2021 04:13:15 -0400 Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:2768 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ltn9G-0005Po-R1; Thu, 17 Jun 2021 04:13:15 -0400 Date: Thu, 17 Jun 2021 11:13:17 +0300 Message-Id: <831r9029k2.fsf@gnu.org> From: Eli Zaretskii To: Robert Pluim In-Reply-To: <87czsl543c.fsf@gmail.com> (message from Robert Pluim on Thu, 17 Jun 2021 09:43:03 +0200) Subject: Re: bug#49066: 26.3; Segmentation fault on specific utf8 string References: <871r91ikdv.fsf@gnus.org> <83czsl0z4z.fsf@gnu.org> <87czsl543c.fsf@gmail.com> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 49066 Cc: 49066@debbugs.gnu.org, larsi@gnus.org, mvsfrasson@gmail.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Robert Pluim > Cc: Lars Ingebrigtsen , 49066@debbugs.gnu.org, > mvsfrasson@gmail.com > Date: Thu, 17 Jun 2021 09:43:03 +0200 > > This is from an optimized build of emacs-26.1. I can redo it with a > '-g3 -O0' if you want. That'd help. > Thread 1 "emacs" received signal SIGSEGV, Segmentation fault. > ftfont_shape_by_flt (matrix=, otf=, ft_face=, font=, lgstring=...) > at ftfont.c:2573 > 2573 g->g.to = LGLYPH_TO (LGSTRING_GLYPH (lgstring, g->g.to)); So, is 'g' a NULL pointer or something? Or is 'lgstring' faulty in some way? IOW, what is the immediate reason for the segfault? > (gdb) bt > #0 ftfont_shape_by_fltPython Exception value has been optimized out: What's the story with these Python exceptions? Looks like some problem in our .gdbinit? > (matrix=, otf=, ft_face=, font=, lgstring=) > at ftfont.c:2573 > #1 ftfont_shapePython Exception value has been optimized out: > (lgstring=, lgstring@entry=XIL(0xaa2755)) at ftfont.c:2615 > #2 0x00000000005d97f5 in xftfont_shape (lgstring=XIL(0xaa2755)) at xftfont.c:670 > #3 0x000000000057fc2a in Ffont_shape_gstringPython Exception value has been optimized out: > (gstring=) at font.c:4427 > #4 0x000000000056fede in funcall_subr (subr=0x97fac0 , numargs=numargs@entry=1, args=args@entry=0x7fffffff59a0) > at eval.c:2844 > #5 0x000000000056ecff in Ffuncall (nargs=, args=args@entry=0x7fffffff5998) at lisp.h:600 The backtrace stops too soon. Can you show more? I'd like at the very least to see which sequence of characters causes the trouble. >From the above, I can only glean that we were performing a character composition. It could be some problem with the shaping engine: I guess versions after Emacs 26 are built with HarfBuzz, not m17n-flt? If you forcibly use m17n-flt in a later Emacs, does it still not crash? Thanks. From debbugs-submit-bounces@debbugs.gnu.org Thu Jun 17 09:07:32 2021 Received: (at 49066) by debbugs.gnu.org; 17 Jun 2021 13:07:32 +0000 Received: from localhost ([127.0.0.1]:53939 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ltrk3-0000BU-LQ for submit@debbugs.gnu.org; Thu, 17 Jun 2021 09:07:32 -0400 Received: from mail-wm1-f52.google.com ([209.85.128.52]:38611) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ltrjy-0000BE-MK for 49066@debbugs.gnu.org; Thu, 17 Jun 2021 09:07:30 -0400 Received: by mail-wm1-f52.google.com with SMTP id t4-20020a1c77040000b029019d22d84ebdso6346588wmi.3 for <49066@debbugs.gnu.org>; Thu, 17 Jun 2021 06:07:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :mime-version:content-transfer-encoding; bh=tl0rasaIN32ly3C6vykhohvC+I6Ci8ICmUofZkh8h5o=; b=W4uIcMd/vR0pk0HjzChAu+ScRE+/DwnR2ku12umxZfn+QmCPtsaOEllipsUMg5xQ53 9GentUuNhbJSam92/lpgAHLSL4XPNe9iaDt2izetmgE8ZcgYJdvGSV3ioL5nkLh02eCk LLvMT6XZSgcMAZtQdh9cp+Wv/Ncc1NcyWqUATlc07Arr6EGWJJEKhKxIGWye9bU3mrP9 0mjf5cs+LgHn+bbJNnNKoXaQUduf4SJC/9MzNcG3Qk00NnapodNdeIXpj4utTdla4ymy kg3grzzdBZxn+Dmdr5kMSHfyZW1YsknlrosN/s2Tefq95KMBxkJt8jrBHeyi1OOYfRHZ 2qIw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:mime-version:content-transfer-encoding; bh=tl0rasaIN32ly3C6vykhohvC+I6Ci8ICmUofZkh8h5o=; b=FYelIYpqtWQbu20sppag8Fz56LUzXFseh68qnY1HngBjKmo6VGTEJrOD177SOokxSD tUTmVlBQp4VCtKm9q4T6izkKAwj3wbwzyaOYV24W/ibNKNjYkUPcNMtuaWpfTBREW/YF ZGxfrXMAN2bF1KA36naLFSf159Hmyv88RNBlfGsCrdJL5PXD+fLgf6tU3/AUxeBX8ibM mcchAfBwIvVQUrxjcNQYvwAG6EAPohaz7X5FxOEWKOGVGk51JA9SBw7gmUP+LOeUupcb NgoUJS9rPgciAClvwgqsozplvnLYYzmyw87nZoIjA6cTHfPPbQVYA0KI3dggtwIhkzjX kRZg== X-Gm-Message-State: AOAM533LKCKaAB9KbK+cI84KX+ceipiozisLCaAfs73y92sSzuNNEhDM FC7QY+Eirci4Up2BMUP9br8= X-Google-Smtp-Source: ABdhPJx4FsjyB7Crvod0NRx5BqkaAivf9hRGzTgagnhvrr8Hpy6P95ZaLsStyx+OGC/bdQiCO5t9kw== X-Received: by 2002:a1c:5413:: with SMTP id i19mr5152055wmb.12.1623935240726; Thu, 17 Jun 2021 06:07:20 -0700 (PDT) Received: from rltb ([82.66.8.55]) by smtp.gmail.com with ESMTPSA id t11sm5403906wrz.7.2021.06.17.06.07.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 17 Jun 2021 06:07:19 -0700 (PDT) From: Robert Pluim To: Eli Zaretskii Subject: Re: bug#49066: 26.3; Segmentation fault on specific utf8 string References: <871r91ikdv.fsf@gnus.org> <83czsl0z4z.fsf@gnu.org> <87czsl543c.fsf@gmail.com> <831r9029k2.fsf@gnu.org> Date: Thu, 17 Jun 2021 15:07:18 +0200 In-Reply-To: <831r9029k2.fsf@gnu.org> (Eli Zaretskii's message of "Thu, 17 Jun 2021 11:13:17 +0300") Message-ID: <878s3863nd.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: 49066 Cc: 49066@debbugs.gnu.org, larsi@gnus.org, mvsfrasson@gmail.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) >>>>> On Thu, 17 Jun 2021 11:13:17 +0300, Eli Zaretskii said: >> From: Robert Pluim >> Cc: Lars Ingebrigtsen , 49066@debbugs.gnu.org, >> mvsfrasson@gmail.com >> Date: Thu, 17 Jun 2021 09:43:03 +0200 >>=20 >> This is from an optimized build of emacs-26.1. I can redo it with a >> '-g3 -O0' if you want. Eli> That'd help. Full backtrace from an unoptimized build: Thread 1 "emacs" received signal SIGSEGV, Segmentation fault. 0x0000000000557a9d in AREF (array=3DXIL(0), idx=3D1) at lisp.h:1614 1614 return XVECTOR (array)->contents[idx]; (gdb) bt #0 0x0000000000557a9d in AREF (array=3DXIL(0), idx=3D1) at lisp.h:1614 #1 0x0000000000693602 in ftfont_shape_by_flt (lgstring=3DXIL(0xb64755), font=3D0x1308cb0 , = ft_face=3D0x340fef0, otf=3D0x342c810, matrix=3D0x1308da8 ) at ftfont.c:2573 #2 0x00000000006939c4 in ftfont_shape (lgstring=3DXIL(0xb64755)) at ftfont= .c:2615 #3 0x0000000000695ae8 in xftfont_shape (lgstring=3DXIL(0xb64755)) at xftfo= nt.c:670 #4 0x0000000000624f14 in Ffont_shape_gstring (gstring=3DXIL(0xb64755)) at = font.c:4427 #5 0x000000000060714d in funcall_subr (subr=3D0xa41d60 , numargs=3D1, args=3D0x7fffffff6830) at eval.c:2844 #6 0x0000000000606d80 in Ffuncall (nargs=3D2, args=3D0x7fffffff6828) at ev= al.c:2769 #7 0x000000000064ef3a in exec_byte_code (bytestr=3DXIL(0x81e114), vector=3DXIL(0x81e135), maxdepth=3Dmake_numbe= r(6), args_template=3DXIL(0), nargs=3D0, args=3D0x0) at bytecode.c:629 #8 0x0000000000607b03 in funcall_lambda (fun=3DXIL(0x81e0a5), nargs=3D5, a= rg_vector=3D0x81e135 ) at eval.c:3052 #9 0x0000000000606dc4 in Ffuncall (nargs=3D6, args=3D0x7fffffff6d20) at ev= al.c:2771 #10 0x000000000060392c in internal_condition_case_n (bfun=3D0x606c02 , nargs=3D6, args=3D0x7fffffff6d20, handlers=3DXIL(0xc090), hfun=3D 0x43f2a4 ) at eval.c:1412 #11 0x000000000043f519 in safe__call (inhibit_quit=3Dfalse, nargs=3D6, func= =3DXIL(0x8e6520), ap=3D0x7fffffff6e00) at xdisp.c:2617 #12 0x000000000043f60c in safe_call (nargs=3D6, func=3DXIL(0x8e6520)) at xd= isp.c:2633 #13 0x000000000067e4e6 in autocmp_chars (rule=3DXIL(0xf2b705), charpos=3D40, bytepos=3D78, limit=3D42, win=3D0x= 103bc30 , face=3D0x349d570, string=3DXIL(0)) at composite.c:928 #14 0x000000000067fad8 in composition_reseat_it (cmp_it=3D0x7fffffff8f30, charpos=3D40, bytepos=3D78, endpos=3D464, w= =3D0x103bc30 , face=3D0x349d570, string=3DXIL(0)) at composite.c:1228 #15 0x000000000044e88f in next_element_from_buffer (it=3D0x7fffffff86b0) at= xdisp.c:8483 #16 0x000000000044ab2a in get_next_display_element (it=3D0x7fffffff86b0) at= xdisp.c:7026 #17 0x00000000004715db in display_line (it=3D0x7fffffff86b0, cursor_vpos=3D= 3) at xdisp.c:21409 #18 0x0000000000466d36 in try_window (window=3DXIL(0x103bc35), pos=3D..., f= lags=3D1) at xdisp.c:17627 #19 0x00000000004648da in redisplay_window (window=3DXIL(0x103bc35), just_t= his_one_p=3Dfalse) at xdisp.c:17074 #20 0x000000000045de89 in redisplay_window_0 (window=3DXIL(0x103bc35)) at x= disp.c:14831 #21 0x00000000006037bc in internal_condition_case_1 (bfun=3D0x45de47 , arg=3DXIL(0x103bc35), handlers= =3DXIL(0xb3de33), hfun=3D0x45de0f ) at eval.c:1356 #22 0x000000000045dde4 in redisplay_windows (window=3DXIL(0x103bc35)) at xd= isp.c:14811 #23 0x000000000045cd16 in redisplay_internal () at xdisp.c:14300 #24 0x000000000045ada7 in redisplay () at xdisp.c:13518 #25 0x0000000000563326 in read_char (commandflag=3D1, map=3DXIL(0x142c4b3),= prev_event=3DXIL(0), used_mouse_menu=3D0x7fffffffdaef, end_time=3D0x0) at keyboard.c:2480 #26 0x000000000057056f in read_key_sequence (keybuf=3D0x7fffffffdc40, bufsize=3D30, prompt=3DXIL(0), dont_downcase_= last=3Dfalse, can_return_switch_frame=3Dtrue, fix_current_buffer=3Dtrue, pr= event_redisplay=3Dfalse) at keyboard.c:9147 #27 0x00000000005607c3 in command_loop_1 () at keyboard.c:1368 #28 0x0000000000603715 in internal_condition_case (bfun=3D0x5603b5 , handlers=3DXIL(0x5250), hfun=3D0x55fb97 ) at eval.c:1332 #29 0x00000000005600a6 in command_loop_2 (ignore=3DXIL(0)) at keyboard.c:11= 10 #30 0x0000000000602fed in internal_catch (tag=3DXIL(0xc6f0), func=3D0x56007= 9 , arg=3DXIL(0)) at eval.c:1097 #31 0x0000000000560045 in command_loop () at keyboard.c:1089 #32 0x000000000055f76a in recursive_edit_1 () at keyboard.c:695 #33 0x000000000055f8ea in Frecursive_edit () at keyboard.c:766 #34 0x000000000055d58e in main (argc=3D2, argv=3D0x7fffffffe128) at emacs.c= :1713 Lisp Backtrace: "font-shape-gstring" (0xffff6830) "auto-compose-chars" (0xffff6d28) "redisplay_internal (C function)" (0x0) (gdb)=20 >> Thread 1 "emacs" received signal SIGSEGV, Segmentation fault. >> ftfont_shape_by_flt (matrix=3D, otf=3D= , ft_face=3D, font=3D, lgstring=3D...) >> at ftfont.c:2573 >> 2573 g->g.to =3D LGLYPH_TO (LGSTRING_GLYPH (lgstring, g->g.to)= ); Eli> So, is 'g' a NULL pointer or something? Or is 'lgstring' faulty in Eli> some way? IOW, what is the immediate reason for the Eli> segfault? It=CA=BCs lgstring, I think this is one of those 'nil's in lgstring 0 0x0000000000557a9d in AREF (array=3DXIL(0), idx=3D1) at lisp.h:1614 1614 return XVECTOR (array)->contents[idx]; (gdb) up #1 0x0000000000693602 in ftfont_shape_by_flt (lgstring=3DXIL(0xb64755), fo= nt=3D0x1308cb0 , ft_face=3D0x340fef0,=20 otf=3D0x342c810, matrix=3D0x1308da8 ) at ftfon= t.c:2573 2573 g->g.to =3D LGLYPH_TO (LGSTRING_GLYPH (lgstring, g->g.to)); (gdb) pp lgstring [[# 2453 8204] nil [0 0 2453 20 16 -1 17 12 0 nil] [1 1 8204 658= 0 -1 1 15 4 nil] nil nil nil [5 5 0 3039 11 0 12 7 5 nil] [6 6 1606 1044 1= 1 0 11 8 3 nil] nil] (gdb) p g $2 =3D (MFLTGlyphFT *) 0x2e631e0 (gdb) p *g $3 =3D { g =3D { c =3D 2453, code =3D 20, from =3D 0, to =3D 2, xadv =3D 1024, yadv =3D 0, ascent =3D 768, descent =3D 0, lbearing =3D -64, rbearing =3D 1024, xoff =3D 0, yoff =3D 0, encoded =3D 1, measured =3D 1, adjusted =3D 0, internal =3D 0 }, libotf_positioning_type =3D 0 } >> (gdb) bt >> #0 ftfont_shape_by_fltPython Exception value ha= s been optimized out:=20 Eli> What's the story with these Python exceptions? Looks like some Eli> problem in our .gdbinit? They don=CA=BCt happen with an unoptimized build. Eli> The backtrace stops too soon. Can you show more? I'd like at the Eli> very least to see which sequence of characters causes the trouble. Eli> From the above, I can only glean that we were performing a charact= er Eli> composition. This is enough to cause the crash: =E0=A6=95=E2=80=8C Thats #x995 followed by #x200c. Why are we trying to compose a ZWNJ? Eli> It could be some problem with the shaping engine: I guess versions Eli> after Emacs 26 are built with HarfBuzz, not m17n-flt? If you forc= ibly Eli> use m17n-flt in a later Emacs, does it still not crash? emacs-27 built '--without-harfbuzz' and thus with m17n-flt crashes the same= way. Robert --=20 From debbugs-submit-bounces@debbugs.gnu.org Thu Jun 17 09:59:48 2021 Received: (at 49066) by debbugs.gnu.org; 17 Jun 2021 13:59:48 +0000 Received: from localhost ([127.0.0.1]:54827 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ltsYd-0001fY-KI for submit@debbugs.gnu.org; Thu, 17 Jun 2021 09:59:47 -0400 Received: from eggs.gnu.org ([209.51.188.92]:59912) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ltsYb-0001fJ-F5 for 49066@debbugs.gnu.org; Thu, 17 Jun 2021 09:59:46 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:34848) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ltsYW-0006u2-1F; Thu, 17 Jun 2021 09:59:40 -0400 Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:1481 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ltsYV-0007Ef-Km; Thu, 17 Jun 2021 09:59:39 -0400 Date: Thu, 17 Jun 2021 16:59:42 +0300 Message-Id: <83r1h0zj5d.fsf@gnu.org> From: Eli Zaretskii To: Robert Pluim , Kenichi Handa In-Reply-To: <878s3863nd.fsf@gmail.com> (message from Robert Pluim on Thu, 17 Jun 2021 15:07:18 +0200) Subject: Re: bug#49066: 26.3; Segmentation fault on specific utf8 string References: <871r91ikdv.fsf@gnus.org> <83czsl0z4z.fsf@gnu.org> <87czsl543c.fsf@gmail.com> <831r9029k2.fsf@gnu.org> <878s3863nd.fsf@gmail.com> MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 49066 Cc: 49066@debbugs.gnu.org, larsi@gnus.org, mvsfrasson@gmail.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Robert Pluim > Cc: larsi@gnus.org, 49066@debbugs.gnu.org, mvsfrasson@gmail.com > Date: Thu, 17 Jun 2021 15:07:18 +0200 > > Full backtrace from an unoptimized build: Thanks. > >> Thread 1 "emacs" received signal SIGSEGV, Segmentation fault. > >> ftfont_shape_by_flt (matrix=, otf=, ft_face=, font=, lgstring=...) > >> at ftfont.c:2573 > >> 2573 g->g.to = LGLYPH_TO (LGSTRING_GLYPH (lgstring, g->g.to)); > > Eli> So, is 'g' a NULL pointer or something? Or is 'lgstring' faulty in > Eli> some way? IOW, what is the immediate reason for the > Eli> segfault? > > Itʼs lgstring, I think this is one of those 'nil's in lgstring Yes, I think so. We can verify that by looking at the value of g->g.to: (gdb) p *g $3 = { g = { c = 2453, code = 20, from = 0, to = 2, <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< And the LGLYPH whose index is 2 is indeed nil: (gdb) pp lgstring [[# 2453 8204] nil [0 0 2453 20 16 -1 17 12 0 nil] [1 1 8204 658 0 -1 1 15 4 nil] nil nil nil [5 5 0 3039 11 0 12 7 5 nil] [6 6 1606 1044 11 0 11 8 3 nil] nil] ^^^ I think this is a bug in that loop: it should actually exit whenever it finds the first LGLYPH that is nil, and update gstring.used accordingly. Something like this: for (i = 0; i < gstring.used; i++) { MFLTGlyphFT *g = (MFLTGlyphFT *) (gstring.glyphs) + i; if (NILP (LGSTRING_GLYPH (lgstring, g->g.from)) || NILP (LGSTRING_GLYPH (lgstring, g->g.to))) break; g->g.from = LGLYPH_FROM (LGSTRING_GLYPH (lgstring, g->g.from)); g->g.to = LGLYPH_TO (LGSTRING_GLYPH (lgstring, g->g.to)); } gstring.used = i; CC'ing Handa-san, as I'm not really familiar with this code. > This is enough to cause the crash: ক‌ > > Thats #x995 followed by #x200c. Why are we trying to compose a ZWNJ? Because #x995 is a Bengali character, and lisp/language/indian.el says: (defconst bengali-composable-pattern (let ((table '(("a" . "\u0981") ; SIGN CANDRABINDU ("A" . "[\u0982\u0983]") ; SIGN ANUSVARA .. VISARGA ("V" . "[\u0985-\u0994\u09E0\u09E1]") ; independent vowel ("C" . "[\u0995-\u09B9\u09DC-\u09DF\u09F1]") ; consonant ("B" . "[\u09AC\u09AF\u09B0\u09F0]") ; BA, YA, RA ("R" . "[\u09B0\u09F0]") ; RA ("n" . "\u09BC") ; NUKTA ("v" . "[\u09BE-\u09CC\u09D7\u09E2\u09E3]") ; vowel sign ("H" . "\u09CD") ; HALANT ("T" . "\u09CE") ; KHANDA TA ("N" . "\u200C") ; ZWNJ <<<<<<<<<<<<<<<<<<<<<<<<<<< ("J" . "\u200D") ; ZWJ ("X" . "[\u0980-\u09FF]")))) ; all coverage (indian-compose-regexp (concat ;; syllables with an independent vowel, or "\\(?:RH\\)?Vn?\\(?:J?HB\\)?v*n?a?A?\\|" ;; consonant-based syllables, or "Cn?\\(?:J?HJ?Cn?\\)*\\(?:H[NJ]?\\|v*[NJ]?v?a?A?\\)\\|" ;; another syllables with an independent vowel, or "\\(?:RH\\)?T\\|" ;; special consonant form, or "JHB\\|" ;; any other singleton characters "X") table)) "Regexp matching a composable sequence of Bengali characters.") (which is used below that in setting up composition-function-table for Bengali characters). > Eli> It could be some problem with the shaping engine: I guess versions > Eli> after Emacs 26 are built with HarfBuzz, not m17n-flt? If you forcibly > Eli> use m17n-flt in a later Emacs, does it still not crash? > > emacs-27 built '--without-harfbuzz' and thus with m17n-flt crashes the same way. Yes, it figures. I hope Handa-san will suggest a solution, for those who want to stick with m17n-flt. From debbugs-submit-bounces@debbugs.gnu.org Thu Jun 17 11:04:33 2021 Received: (at 49066) by debbugs.gnu.org; 17 Jun 2021 15:04:33 +0000 Received: from localhost ([127.0.0.1]:55010 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lttZJ-0003Nr-Jq for submit@debbugs.gnu.org; Thu, 17 Jun 2021 11:04:33 -0400 Received: from eggs.gnu.org ([209.51.188.92]:33214) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lttZE-0003NZ-QY for 49066@debbugs.gnu.org; Thu, 17 Jun 2021 11:04:32 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:37676) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lttZ9-0004Th-Bg; Thu, 17 Jun 2021 11:04:23 -0400 Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:1589 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lttZ8-0004Pt-W3; Thu, 17 Jun 2021 11:04:23 -0400 Date: Thu, 17 Jun 2021 18:04:26 +0300 Message-Id: <83pmwkzg5h.fsf@gnu.org> From: Eli Zaretskii To: Kenichi Handa In-Reply-To: <83r1h0zj5d.fsf@gnu.org> (message from Eli Zaretskii on Thu, 17 Jun 2021 16:59:42 +0300) Subject: Re: bug#49066: 26.3; Segmentation fault on specific utf8 string References: <871r91ikdv.fsf@gnus.org> <83czsl0z4z.fsf@gnu.org> <87czsl543c.fsf@gmail.com> <831r9029k2.fsf@gnu.org> <878s3863nd.fsf@gmail.com> <83r1h0zj5d.fsf@gnu.org> MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 49066 Cc: 49066@debbugs.gnu.org, rpluim@gmail.com, larsi@gnus.org, mvsfrasson@gmail.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Date: Thu, 17 Jun 2021 16:59:42 +0300 > From: Eli Zaretskii > Cc: 49066@debbugs.gnu.org, larsi@gnus.org, mvsfrasson@gmail.com > > > This is enough to cause the crash: ক‌ > > > > Thats #x995 followed by #x200c. Why are we trying to compose a ZWNJ? > > Because #x995 is a Bengali character, and lisp/language/indian.el > says: Btw, I think there's a bug in those patterns: ZWJ and ZWNJ shouldn't compose unless they are followed by a character. See section 12.2 in the Unicode Standard. From debbugs-submit-bounces@debbugs.gnu.org Sat Jun 26 22:29:52 2021 Received: (at 49066) by debbugs.gnu.org; 27 Jun 2021 02:29:52 +0000 Received: from localhost ([127.0.0.1]:48806 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lxKYS-00047a-E1 for submit@debbugs.gnu.org; Sat, 26 Jun 2021 22:29:52 -0400 Received: from eggs.gnu.org ([209.51.188.92]:42544) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lxKYO-00047G-5A for 49066@debbugs.gnu.org; Sat, 26 Jun 2021 22:29:50 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:52158) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lxKYH-0002uA-9i; Sat, 26 Jun 2021 22:29:41 -0400 Received: from fl1-122-134-93-72.iba.mesh.ad.jp ([122.134.93.72]:65388 helo=shatin) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lxKYB-0002Oq-GI; Sat, 26 Jun 2021 22:29:35 -0400 Received: from handa by shatin with local (Exim 4.93) (envelope-from ) id 1lxKY4-000HtY-KJ; Sun, 27 Jun 2021 11:29:28 +0900 From: handa To: Eli Zaretskii Subject: Re: bug#49066: 26.3; Segmentation fault on specific utf8 string In-Reply-To: <83r1h0zj5d.fsf@gnu.org> (message from Eli Zaretskii on Thu, 17 Jun 2021 16:59:42 +0300) Date: Sun, 27 Jun 2021 11:29:28 +0900 Message-ID: <87sg14kpkn.fsf@gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 49066 Cc: 49066@debbugs.gnu.org, rpluim@gmail.com, eggert@cs.ucla.edu, larsi@gnus.org, mvsfrasson@gmail.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Hi, > (gdb) pp lgstring > [[# 2453 8204] nil [0 0 2453 20 16 -1 17 12 0 nil] [1 1 8204= 658 0 -1 1 15 4 nil] nil nil nil [5 5 0 3039 11 0 12 7 5 nil] [6 6 1606 10= 44 11 0 11 8 3 nil] nil] ^^^ > I think this is a bug in that loop: it should actually exit whenever > it finds the first LGLYPH that is nil, and update gstring.used > accordingly. Something like this: > for (i =3D 0; i < gstring.used; i++) > { > MFLTGlyphFT *g =3D (MFLTGlyphFT *) (gstring.glyphs) + i; > if (NILP (LGSTRING_GLYPH (lgstring, g->g.from)) > || NILP (LGSTRING_GLYPH (lgstring, g->g.to))) > break; > g->g.from =3D LGLYPH_FROM (LGSTRING_GLYPH (lgstring, g->g.from)); > g->g.to =3D LGLYPH_TO (LGSTRING_GLYPH (lgstring, g->g.to)); > } > gstring.used =3D i; I don't think so because glyphs of indices g->g.from and g->g.to should not be nil. > > This is enough to cause the crash: =E0=A6=95=E2=80=8C As I surely remember that rendering that string with m17n-flt had no problem before, I suspect that some change after I wrote the code has a problem. So, I tried to restore the old code as the attached patch, and then the patched emacs has no problem of rendering the above Bengali string. The patch cancels this change:=20 ------------------------------------------------------------ commit 04ac097f34d887e1ae8dea1e884118728e931c7a Author: Paul Eggert Date: Fri Nov 13 12:02:21 2015 -0800 Spruce up ftfont.c memory allocation =20=20=20=20 * src/ftfont.c (setup_otf_gstring): Avoid O(N**2) behavior when reallocating. (ftfont_shape_by_flt): Prefer xpalloc to xrealloc when reallocating buffers; this simplifies the code. Do not trust mflt_run to leave the output areas unchanged on failure, as this isn=E2=80=99t part of its interface spec. ------------------------------------------------------------ But, at the moment I don't know why the new code does not work. --- K. Handa handa@gnu.org diff --git a/src/ftfont.c b/src/ftfont.c index 0603dd9ce6..26198928d8 100644 --- a/src/ftfont.c +++ b/src/ftfont.c @@ -2720,6 +2720,37 @@ ftfont_shape_by_flt (Lisp_Object lgstring, struct fo= nt *font, } } =20 +#define RESTORE_OLD_CODE +#ifdef RESTORE_OLD_CODE + if (gstring.allocated =3D=3D 0) + { + gstring.glyph_size =3D sizeof (MFLTGlyph); + gstring.glyphs =3D xnmalloc (len * 2, sizeof *gstring.glyphs); + gstring.allocated =3D len * 2; + } + else if (gstring.allocated < len * 2) + { + gstring.glyphs =3D xnrealloc (gstring.glyphs, len * 2, + sizeof *gstring.glyphs); + gstring.allocated =3D len * 2; + } + memset (gstring.glyphs, 0, len * sizeof *gstring.glyphs); + for (i =3D 0; i < len; i++) + { + Lisp_Object g =3D LGSTRING_GLYPH (lgstring, i); + + gstring.glyphs[i].c =3D LGLYPH_CHAR (g); + if (with_variation_selector) + { + gstring.glyphs[i].code =3D LGLYPH_CODE (g); + gstring.glyphs[i].encoded =3D 1; + } + } + + gstring.used =3D len; + gstring.r2l =3D 0; +#endif + { Lisp_Object family =3D Ffont_get (LGSTRING_FONT (lgstring), QCfamily); =20 @@ -2763,6 +2794,20 @@ ftfont_shape_by_flt (Lisp_Object lgstring, struct fo= nt *font, return make_fixnum (0); } =20 +#ifdef RESTORE_OLD_CODE + for (i =3D 0; i < 3; i++) + { + int result =3D mflt_run (&gstring, 0, len, &flt_font_ft.flt_font, fl= t); + if (result !=3D -2) + break; + int len2; + if (INT_MULTIPLY_WRAPV (gstring.allocated, 2, &len2)) + memory_full (SIZE_MAX); + gstring.glyphs =3D xnrealloc (gstring.glyphs, + gstring.allocated, 2 * sizeof (MFLTGlyphFT)); + gstring.allocated =3D len2; + } +#else MFLTGlyphFT *glyphs =3D (MFLTGlyphFT *) gstring.glyphs; ptrdiff_t allocated =3D gstring.allocated; ptrdiff_t incr_min =3D len - allocated; @@ -2795,6 +2840,7 @@ ftfont_shape_by_flt (Lisp_Object lgstring, struct fon= t *font, gstring.r2l =3D 0; } while (mflt_run (&gstring, 0, len, &flt_font_ft.flt_font, flt) =3D=3D -2= ); +#endif =20 if (gstring.used > LGSTRING_GLYPH_LEN (lgstring)) return Qnil; From debbugs-submit-bounces@debbugs.gnu.org Sun Jun 27 02:20:54 2021 Received: (at 49066) by debbugs.gnu.org; 27 Jun 2021 06:20:54 +0000 Received: from localhost ([127.0.0.1]:48888 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lxOA2-0001yy-DI for submit@debbugs.gnu.org; Sun, 27 Jun 2021 02:20:54 -0400 Received: from eggs.gnu.org ([209.51.188.92]:59830) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lxO9z-0001yk-PK for 49066@debbugs.gnu.org; Sun, 27 Jun 2021 02:20:52 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:56912) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lxO9t-0000qY-Hw; Sun, 27 Jun 2021 02:20:45 -0400 Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:4734 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lxO9t-00022X-55; Sun, 27 Jun 2021 02:20:45 -0400 Date: Sun, 27 Jun 2021 09:20:41 +0300 Message-Id: <83tuljq152.fsf@gnu.org> From: Eli Zaretskii To: handa In-Reply-To: <87sg14kpkn.fsf@gnu.org> (message from handa on Sun, 27 Jun 2021 11:29:28 +0900) Subject: Re: bug#49066: 26.3; Segmentation fault on specific utf8 string References: <87sg14kpkn.fsf@gnu.org> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 49066 Cc: 49066@debbugs.gnu.org, rpluim@gmail.com, eggert@cs.ucla.edu, larsi@gnus.org, mvsfrasson@gmail.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: handa > Cc: rpluim@gmail.com, larsi@gnus.org, 49066@debbugs.gnu.org, > mvsfrasson@gmail.com, eggert@cs.ucla.edu > Date: Sun, 27 Jun 2021 11:29:28 +0900 > > So, I tried to restore the old code as the attached patch, and then the > patched emacs has no problem of rendering the above Bengali string. Thanks. Robert, Miguel: could you please try this patch and see if it fixes the problem? Since we are moving away of m17n-flt, I don't think we should optimize memory management when m17n-flt is used, especially if that causes problems. So if the patch fixes the crash, I think we should install it. From debbugs-submit-bounces@debbugs.gnu.org Sun Jun 27 14:02:36 2021 Received: (at 49066) by debbugs.gnu.org; 27 Jun 2021 18:02:36 +0000 Received: from localhost ([127.0.0.1]:50362 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lxZ76-0007Dq-9L for submit@debbugs.gnu.org; Sun, 27 Jun 2021 14:02:36 -0400 Received: from zimbra.cs.ucla.edu ([131.179.128.68]:58840) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lxZ73-0007Dc-80 for 49066@debbugs.gnu.org; Sun, 27 Jun 2021 14:02:35 -0400 Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id B85801600BB; Sun, 27 Jun 2021 11:02:27 -0700 (PDT) Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id d9UMduDTUPyK; Sun, 27 Jun 2021 11:02:27 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 180651600E0; Sun, 27 Jun 2021 11:02:27 -0700 (PDT) X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id YY01fTlmTQAT; Sun, 27 Jun 2021 11:02:27 -0700 (PDT) Received: from [192.168.1.9] (cpe-172-91-119-151.socal.res.rr.com [172.91.119.151]) by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id D73091600BB; Sun, 27 Jun 2021 11:02:26 -0700 (PDT) Subject: Re: bug#49066: 26.3; Segmentation fault on specific utf8 string To: Eli Zaretskii , handa References: <87sg14kpkn.fsf@gnu.org> <83tuljq152.fsf@gnu.org> From: Paul Eggert Organization: UCLA Computer Science Department Message-ID: <28ac2c34-52f9-e09c-d5e1-9a4a9e454060@cs.ucla.edu> Date: Sun, 27 Jun 2021 11:02:26 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: <83tuljq152.fsf@gnu.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Score: -4.1 (----) X-Debbugs-Envelope-To: 49066 Cc: 49066@debbugs.gnu.org, rpluim@gmail.com, larsi@gnus.org, mvsfrasson@gmail.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.1 (-----) On 6/26/21 11:20 PM, Eli Zaretskii wrote: > Since we are moving away of m17n-flt, I don't think we should optimize > memory management when m17n-flt is used, especially if that causes > problems. So if the patch fixes the crash, I think we should install > it. Sure, and I can volunteer to do that. Would you like me to do it in master now, or wait for confirmation and install it on the emacs-27 branch? or perhaps some other course of action? From debbugs-submit-bounces@debbugs.gnu.org Sun Jun 27 15:16:03 2021 Received: (at 49066) by debbugs.gnu.org; 27 Jun 2021 19:16:03 +0000 Received: from localhost ([127.0.0.1]:50408 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lxaGB-0000aA-8L for submit@debbugs.gnu.org; Sun, 27 Jun 2021 15:16:03 -0400 Received: from eggs.gnu.org ([209.51.188.92]:54352) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lxaG8-0000ZW-PL for 49066@debbugs.gnu.org; Sun, 27 Jun 2021 15:16:02 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:40956) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lxaG2-0006Ux-N2; Sun, 27 Jun 2021 15:15:54 -0400 Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:1158 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lxaG2-0004vY-5H; Sun, 27 Jun 2021 15:15:54 -0400 Date: Sun, 27 Jun 2021 22:15:50 +0300 Message-Id: <83im1zp195.fsf@gnu.org> From: Eli Zaretskii To: Paul Eggert In-Reply-To: <28ac2c34-52f9-e09c-d5e1-9a4a9e454060@cs.ucla.edu> (message from Paul Eggert on Sun, 27 Jun 2021 11:02:26 -0700) Subject: Re: bug#49066: 26.3; Segmentation fault on specific utf8 string References: <87sg14kpkn.fsf@gnu.org> <83tuljq152.fsf@gnu.org> <28ac2c34-52f9-e09c-d5e1-9a4a9e454060@cs.ucla.edu> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 49066 Cc: 49066@debbugs.gnu.org, handa@gnu.org, rpluim@gmail.com, larsi@gnus.org, mvsfrasson@gmail.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Cc: rpluim@gmail.com, larsi@gnus.org, 49066@debbugs.gnu.org, > mvsfrasson@gmail.com > From: Paul Eggert > Date: Sun, 27 Jun 2021 11:02:26 -0700 > > On 6/26/21 11:20 PM, Eli Zaretskii wrote: > > Since we are moving away of m17n-flt, I don't think we should optimize > > memory management when m17n-flt is used, especially if that causes > > problems. So if the patch fixes the crash, I think we should install > > it. > > Sure, and I can volunteer to do that. Would you like me to do it in > master now, or wait for confirmation and install it on the emacs-27 > branch? or perhaps some other course of action? I'd like to see the confirmation, and then install this on master. Thanks. From debbugs-submit-bounces@debbugs.gnu.org Mon Jun 28 06:56:17 2021 Received: (at 49066) by debbugs.gnu.org; 28 Jun 2021 10:56:17 +0000 Received: from localhost ([127.0.0.1]:51119 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lxow5-00015Y-0h for submit@debbugs.gnu.org; Mon, 28 Jun 2021 06:56:17 -0400 Received: from mail-wr1-f46.google.com ([209.85.221.46]:42565) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lxow2-00015G-4B for 49066@debbugs.gnu.org; Mon, 28 Jun 2021 06:56:16 -0400 Received: by mail-wr1-f46.google.com with SMTP id j1so20675019wrn.9 for <49066@debbugs.gnu.org>; Mon, 28 Jun 2021 03:56:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :mime-version; bh=Ro5U1u3aJeQXPTuNAjMC84CYXyo1oEpVMFy3wHBKhLc=; b=Ofcgycqebhc8CiuPm7/QGZFPTOE5ZlrQH9oyDyQSeWI9/uQdL4BnHTH0D2BScRpHJH bHlWJkHOv+32hMT869w0E3+wJ1eLQOuNm9TfUJtDjW7zTS1OPGXH49FFUy+3oJLAF3bB +I9yhdIfQa1WAryiqITBYPFcLjp+18phryJC9FGQWZ+PMwRxTAYSCOTpqz/inuF9mLBm NSB2oEwfBZP8gKnKaTk9qN+LYF/qFDdRLrFCnKLvrPy1j8lWE8JBbDBbtH5TcO1kLLNf HIzz5PTkpwIYu0xvxU32PwWOcNRNPl44jrlKeavn/ArtIqmxuuWxUSxqpWCWa/6IRY04 ikow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:mime-version; bh=Ro5U1u3aJeQXPTuNAjMC84CYXyo1oEpVMFy3wHBKhLc=; b=tKpglQfy8Yo7BVtRbvV9n12RneloJ4MopiA0ZxJ3e/SNOu/AB5r2mRs728q5JrZXD1 vkBhRm1umoGpli8LY9wwriER7J7brZMv3pMR43JlQzjqOhH8qUrrt0bfyXrwz1xH+ZKr JpfMWVqBh0RbPIeh5ITF1z7GsLPGCrGjk7Dm8g2NNVk2BB3HFBsbocWLMok+UH+M/m2e mQ6mo8A4UVm4EulN7hcdFJNYmYKnyXCcqVlxn2iaaBsjnxDgjQ0w14+bWNDXBfz02mm4 28okgvFUiy+w/rGHKGRXstDZDTvo+LHOxuszLLCsbMeBpCDZrx1Z0nqGLLJcVdXptEYr vWuw== X-Gm-Message-State: AOAM5334IdcKZmacvhHhIl70+r8+FC9pyQH0dypV6axR9fn2aC6OHiD6 bW5cnvDHUHwdxgMVVFnTRtg= X-Google-Smtp-Source: ABdhPJzDr05nEuXMwQG30nSCN65Un8iGNmPQxVxJ/KKjOllm3NTrCI7An5XFQ8AVeImpZQRKd0Mw5Q== X-Received: by 2002:a5d:648e:: with SMTP id o14mr26722113wri.5.1624877768105; Mon, 28 Jun 2021 03:56:08 -0700 (PDT) Received: from rltb ([82.66.8.55]) by smtp.gmail.com with ESMTPSA id w8sm14069290wre.70.2021.06.28.03.56.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Jun 2021 03:56:07 -0700 (PDT) From: Robert Pluim To: Eli Zaretskii Subject: Re: bug#49066: 26.3; Segmentation fault on specific utf8 string References: <87sg14kpkn.fsf@gnu.org> <83tuljq152.fsf@gnu.org> <28ac2c34-52f9-e09c-d5e1-9a4a9e454060@cs.ucla.edu> <83im1zp195.fsf@gnu.org> Date: Mon, 28 Jun 2021 12:56:06 +0200 In-Reply-To: <83im1zp195.fsf@gnu.org> (Eli Zaretskii's message of "Sun, 27 Jun 2021 22:15:50 +0300") Message-ID: <871r8mqmux.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: 49066 Cc: 49066@debbugs.gnu.org, handa@gnu.org, larsi@gnus.org, Paul Eggert , mvsfrasson@gmail.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) >>>>> On Sun, 27 Jun 2021 22:15:50 +0300, Eli Zaretskii said: >> Cc: rpluim@gmail.com, larsi@gnus.org, 49066@debbugs.gnu.org, >> mvsfrasson@gmail.com >> From: Paul Eggert >> Date: Sun, 27 Jun 2021 11:02:26 -0700 >> >> On 6/26/21 11:20 PM, Eli Zaretskii wrote: >> > Since we are moving away of m17n-flt, I don't think we should optimize >> > memory management when m17n-flt is used, especially if that causes >> > problems. So if the patch fixes the crash, I think we should install >> > it. >> >> Sure, and I can volunteer to do that. Would you like me to do it in >> master now, or wait for confirmation and install it on the emacs-27 >> branch? or perhaps some other course of action? Eli> I'd like to see the confirmation, and then install this on master. Eli> Thanks. With the patch it still crashes for me in emacs-master with harfbuzz disabled: Thread 1 "emacs" received signal SIGSEGV, Segmentation fault. 0x000055555576d4e7 in AREF (array=XIL(0), idx=1) at lisp.h:1838 1838 return XVECTOR (array)->contents[idx]; (gdb) bt #0 0x000055555576d4e7 in AREF (array=XIL(0), idx=1) at lisp.h:1838 #1 0x0000555555774be0 in ftfont_shape_by_flt (lgstring=XIL(0x7ffff1e5301d), font=0x55555604f410, ft_face=0x5555566a2400, otf=0x555556696b60, matrix=0x55555604f508) at ftfont.c:2852 #2 0x0000555555775002 in ftfont_shape (lgstring=XIL(0x7ffff1e5301d), direction=XIL(0)) at ftfont.c:2890 #3 0x000055555577629e in ftcrfont_shape (lgstring=XIL(0x7ffff1e5301d), direction=XIL(0)) at ftcrfont.c:477 #4 0x000055555571344c in Ffont_shape_gstring (gstring=XIL(0x7ffff1e5301d), direction=XIL(0)) at font.c:4499 #5 0x00005555557019fb in Ffuncall (nargs=3, args=args@entry=0x7fffffffd670) at eval.c:3039 #6 0x000055555573cdf8 in exec_byte_code (bytestr=, vector=, maxdepth=, args_template=, nargs=, args=) at bytecode.c:632 #7 0x0000555555701937 in Ffuncall (nargs=nargs@entry=7, args=args@entry=0x7fffffffd990) at eval.c:3055 #8 0x0000555555700cf9 in internal_condition_case_n (bfun= 0x555555701760 , nargs=nargs@entry=7, args=args@entry=0x7fffffffd990, handlers=handlers@entry=XIL(0x30), hfun=hfun@entry= 0x5555555ca5e0 ) at eval.c:1642 #9 0x00005555555b8603 in safe__call (inhibit_quit=inhibit_quit@entry=false, nargs=nargs@entry=7, func=, ap=ap@entry=0x7fffffffda28) at lisp.h:1002 #10 0x00005555555c79b5 in safe_call (nargs=nargs@entry=7, func=) at xdisp.c:3009 #11 0x00005555557609c5 in autocmp_chars (rule=XIL(0x7ffff1e501bd), charpos=charpos@entry=146, bytepos=, limit=, limit@entry=148, win=win@entry=0x555556030100, face=face@entry=0x0, string=XIL(0), direction=XIL(0)) at lisp.h:731 #12 0x000055555576426d in find_automatic_composition (pos=pos@entry=146, limit=146, limit@entry=-1, backlim=backlim@entry=-1, start=start@entry=0x7fffffffdc68, end=end@entry=0x7fffffffdc70, gstring=gstring@entry=0x7fffffffdc78, string=XIL(0)) at composite.c:1661 #13 0x0000555555764f39 in composition_adjust_point (last_pt=last_pt@entry=146, new_pt=new_pt@entry=146) at lisp.h:1002 #14 0x00005555556960ff in command_loop_1 () at keyboard.c:1569 #15 0x00005555557009d7 in internal_condition_case (bfun=bfun@entry=0x555555695020 , handlers=handlers@entry=XIL(0x90), hfun=hfun@entry=0x55555568bac0 ) at eval.c:1478 #16 0x0000555555686064 in command_loop_2 (ignore=ignore@entry=XIL(0)) at lisp.h:1002 #17 0x0000555555702ed3 in internal_catch (tag=tag@entry=XIL(0xe520), func=func@entry=0x555555686040 , arg=arg@entry=XIL(0)) at eval.c:1198 #18 0x000055555568600b in command_loop () at lisp.h:1002 #19 0x000055555568b6d6 in recursive_edit_1 () at keyboard.c:720 #20 0x000055555568ba02 in Frecursive_edit () at keyboard.c:789 #21 0x00005555555a177f in main (argc=2, argv=) at emacs.c:2308 Lisp Backtrace: "font-shape-gstring" (0xffffd678) "auto-compose-chars" (0xffffd998) (gdb) up #1 0x0000555555774be0 in ftfont_shape_by_flt (lgstring=XIL(0x7ffff1e5301d), font=0x55555604f410, ft_face=0x5555566a2400, otf=0x555556696b60, matrix=0x55555604f508) at ftfont.c:2852 2852 g->g.to = LGLYPH_TO (LGSTRING_GLYPH (lgstring, g->g.to)); (gdb) up #2 0x0000555555775002 in ftfont_shape (lgstring=XIL(0x7ffff1e5301d), direction=XIL(0)) at ftfont.c:2890 2890 return ftfont_shape_by_flt (lgstring, font, ftfont_info->ft_size->face, otf, (gdb) pp lgstring [[# 2453 8204] nil [0 0 2453 20 16 -1 16 12 0 nil] [1 1 8204 658 0 -1 1 15 4 nil] nil nil nil nil nil nil] (gdb) down #1 0x0000555555774be0 in ftfont_shape_by_flt (lgstring=XIL(0x7ffff1e5301d), font=0x55555604f410, ft_face=0x5555566a2400, otf=0x555556696b60, matrix=0x55555604f508) at ftfont.c:2852 2852 g->g.to = LGLYPH_TO (LGSTRING_GLYPH (lgstring, g->g.to)); (gdb) p *g $1 = { g = { c = 2453, code = 0, from = 0, to = 2, xadv = 704, yadv = 0, ascent = 896, descent = 0, lbearing = 64, rbearing = 640, xoff = 0, yoff = 0, encoded = 1, measured = 1, adjusted = 0, internal = 1073741823 }, libotf_positioning_type = 8204 } Robert -- From debbugs-submit-bounces@debbugs.gnu.org Mon Jun 28 08:05:45 2021 Received: (at 49066) by debbugs.gnu.org; 28 Jun 2021 12:05:45 +0000 Received: from localhost ([127.0.0.1]:51197 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lxq1J-00052a-DV for submit@debbugs.gnu.org; Mon, 28 Jun 2021 08:05:45 -0400 Received: from eggs.gnu.org ([209.51.188.92]:53632) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lxq1H-00052N-4v for 49066@debbugs.gnu.org; Mon, 28 Jun 2021 08:05:44 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:35694) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lxq19-0001Sv-Su; Mon, 28 Jun 2021 08:05:35 -0400 Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:4348 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lxq19-0001Pi-8I; Mon, 28 Jun 2021 08:05:35 -0400 Date: Mon, 28 Jun 2021 15:05:33 +0300 Message-Id: <83bl7qp52q.fsf@gnu.org> From: Eli Zaretskii To: Robert Pluim In-Reply-To: <871r8mqmux.fsf@gmail.com> (message from Robert Pluim on Mon, 28 Jun 2021 12:56:06 +0200) Subject: Re: bug#49066: 26.3; Segmentation fault on specific utf8 string References: <87sg14kpkn.fsf@gnu.org> <83tuljq152.fsf@gnu.org> <28ac2c34-52f9-e09c-d5e1-9a4a9e454060@cs.ucla.edu> <83im1zp195.fsf@gnu.org> <871r8mqmux.fsf@gmail.com> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 49066 Cc: 49066@debbugs.gnu.org, handa@gnu.org, larsi@gnus.org, eggert@cs.ucla.edu, mvsfrasson@gmail.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Robert Pluim > Cc: Paul Eggert , handa@gnu.org, larsi@gnus.org, > 49066@debbugs.gnu.org, mvsfrasson@gmail.com > Date: Mon, 28 Jun 2021 12:56:06 +0200 > > Eli> I'd like to see the confirmation, and then install this on master. > > Eli> Thanks. > > With the patch it still crashes for me in emacs-master with harfbuzz disabled: Too bad. Kenichi, any suggestions? From debbugs-submit-bounces@debbugs.gnu.org Fri Jul 02 22:05:26 2021 Received: (at 49066) by debbugs.gnu.org; 3 Jul 2021 02:05:26 +0000 Received: from localhost ([127.0.0.1]:37409 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lzV26-0000Q7-Bl for submit@debbugs.gnu.org; Fri, 02 Jul 2021 22:05:26 -0400 Received: from eggs.gnu.org ([209.51.188.92]:52876) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lzV22-0000Ps-Sp for 49066@debbugs.gnu.org; Fri, 02 Jul 2021 22:05:25 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:55392) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lzV1w-0005xj-Tm; Fri, 02 Jul 2021 22:05:16 -0400 Received: from fl1-122-134-93-72.iba.mesh.ad.jp ([122.134.93.72]:50725 helo=shatin) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lzV1r-0000qM-VD; Fri, 02 Jul 2021 22:05:14 -0400 Received: from handa by shatin with local (Exim 4.93) (envelope-from ) id 1lzV1l-000sHn-Ic; Sat, 03 Jul 2021 11:05:05 +0900 From: handa To: Eli Zaretskii Subject: Re: bug#49066: 26.3; Segmentation fault on specific utf8 string In-Reply-To: <83bl7qp52q.fsf@gnu.org> (message from Eli Zaretskii on Mon, 28 Jun 2021 15:05:33 +0300) Date: Sat, 03 Jul 2021 11:05:05 +0900 Message-ID: <87zgv4cfu6.fsf@gnu.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 49066 Cc: 49066@debbugs.gnu.org, rpluim@gmail.com, eggert@cs.ucla.edu, larsi@gnus.org, mvsfrasson@gmail.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) --=-=-= Content-Type: text/plain In article <83bl7qp52q.fsf@gnu.org>, Eli Zaretskii writes: > > With the patch it still crashes for me in emacs-master with harfbuzz disabled: > Too bad. > Kenichi, any suggestions? I checked the code again, and found that it was a fault of m17n-lib which was not robust enough to handle an OTF table that is different from what the library expects. Here is a revised patch to handle such a case. Could you please try it? ------------------------------------------------------------ diff --git a/src/ftfont.c b/src/ftfont.c index 0603dd9ce6..12d0d72d27 100644 --- a/src/ftfont.c +++ b/src/ftfont.c @@ -2798,10 +2798,31 @@ ftfont_shape_by_flt (Lisp_Object lgstring, struct font *font, if (gstring.used > LGSTRING_GLYPH_LEN (lgstring)) return Qnil; + + /* mflt_run may fail to set g->g.to (which must be a valid index + into lgstring) correctly if the font has an OTF table that is + different from what the m17n library expects. */ for (i = 0; i < gstring.used; i++) { MFLTGlyphFT *g = (MFLTGlyphFT *) (gstring.glyphs) + i; + if (g->g.to >= len) + { + /* Invalid g->g.to. */ + g->g.to = len - 1; + int from = g->g.from; + /* Fix remaining glyphs. */ + for (++i; i < gstring.used; i++) + { + g = (MFLTGlyphFT *) (gstring.glyphs) + i; + g->g.from = from; + g->g.to = len - 1; + } + } + } + for (i = 0; i < gstring.used; i++) + { + MFLTGlyphFT *g = (MFLTGlyphFT *) (gstring.glyphs) + i; g->g.from = LGLYPH_FROM (LGSTRING_GLYPH (lgstring, g->g.from)); g->g.to = LGLYPH_TO (LGSTRING_GLYPH (lgstring, g->g.to)); } ------------------------------------------------------------ > Btw, I think there's a bug in those patterns: ZWJ and ZWNJ shouldn't > compose unless they are followed by a character. See section 12.2 in > the Unicode Standard. Even if they should not be composed with, we must include them in the string to shape because their existence may change the glyph of the previous character. A shaper (m17n-lib or harfbuzz) must return a glyph string that has an independent grapheme cluster for the last ZWJ/ZWNJ. At the time of developing m17n-lib, the above rule was not clear. To conform to that rule, please to put the attached BNG2-OTF.flt under the directory ~/.m17n.d/. --- K. Handa handa@gnu.org --=-=-= Content-Type: application/octet-stream Content-Disposition: attachment; filename=BNG2-OTF.flt Content-Transfer-Encoding: base64 OzsgQk5HMi1PVEYuZmx0IC0tIEZvbnQgTGF5b3V0IFRhYmxlIGZvciBibmcyIE9wZW5UeXBlIGZv bnRzCjs7IENvcHlyaWdod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8oKHBuPyk/YT9BPykgIgogICAgKDIg Om90Zj9ibmcyPWxvY2wsbnVrdCxha2huLGJsd2YscHN0ZispCiAgICB8ICgzID0gKikgKDEgOm90 Zj1ibmcyPXJwaGYrKSAoMiBiNHBvc3QpICg0ID0gKikgKDIgcG9zdCkgKDUgPSAqKSB8KQoKICAg OzsgT3RoZXIgb3JkaW5hcnkgc3lsbGFibGVzCiAgIDs7IDEgICAgICAgICAgIDIgICAgIDMgICAg IDQ1CiAgICgiIChbQ1JuSEpWTl0rKShtbj8pPyhibj8pPygocG4/KT9hP0E/KSAiCiAgICAoMSA6 b3RmP2JuZzI9bG9jbCxudWt0LGFraG4sYmx3Zixwc3RmKykKICAgIHwgKDIgPSAqKSAoMSBiNHBv c3QpICgzID0gKikgKDEgcG9zdCkgKDQgPSAqKSB8KQoKICAgKCIuIiA9KSkKICAqKQoKIChiNHBv c3QKICAoY29uZAogICA7OzEgICAgICAgICAgICAgICAgIDIzICAgICAgIDQKICAgKCIoW0NSbkhK UF0qW0NSVl1uPykoKEo/UFApKykoW05KXSk/JCIKICAgICgxIDpvdGY9Ym5nMj1sb2NsLG51a3Qs YWtobixibHdmLGhhbGYsdmF0dSxjamN0KykgKDQgPSkpCiAgICgiLisiCiAgICAoMCA6b3RmPWJu ZzI9bG9jbCxudWt0LGFraG4sYmx3ZixoYWxmLHZhdHUsY2pjdCspICg0ID0pKSkpCgogKHBvc3QK ICAoY29uZAogICAoIltDUm5ISlBdKltDUlZdbj8oKEo/UFApKykoW05KXSk/JCIKICAgICgxIDpv dGY9Ym5nMj1wc3RmKykpKSkKICkKCjs7IFN0YWdlIDMKOzsgRmluYWwgcmVvcmRlcmluZyAjMSAo TW92ZSBwcmUtYmFzZSBtYXRyYSBhZnRlciB0aGUgbGFzdCBoYWxhbnQpCihnZW5lcmF0b3IKICgw CiAgKGNvbmQKICAgOzsgMSAgICAyICAgICAgICAgMwogICAoIiAobW4/KShbXiBdK0hKPykoW15I IF0rKSAiCiAgICB8ICg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Cjs7IExlc3NlciBHZW5lcmFsIFB1YmxpYyBM aWNlbnNlIGZvciBtb3JlIGRldGFpbHMuCgo7OyBZb3Ugc2hvdWxkIGhhdmUgcmVjZWl2ZWQgYSBj b3B5IG9mIHRoZSBHTlUgTGVzc2VyIEdlbmVyYWwgUHVibGljCjs7IExpY2Vuc2UgYWxvbmcgd2l0 aCB0aGUgbTE3biBsaWJyYXJ5OyBpZiBub3QsIHdyaXRlIHRvIHRoZSBGcmVlCjs7IFNvZnR3YXJl IEZvdW5kYXRpb24sIEluYy4sIDUxIEZyYW5rbGluIFN0cmVldCwgRmlmdGggRmxvb3IsCjs7IEJv c3RvbiwgTUEgMDIxMTAtMTMwMSwgVVNBLgoKOzsgTG9jYWwgVmFyaWFibGVzOgo7OyBtb2RlOiBl bWFjcy1saXNwCjs7IEVuZDoK --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Mon Jul 05 05:28:55 2021 Received: (at 49066) by debbugs.gnu.org; 5 Jul 2021 09:28:55 +0000 Received: from localhost ([127.0.0.1]:44035 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m0KuM-0007Kc-Vz for submit@debbugs.gnu.org; Mon, 05 Jul 2021 05:28:55 -0400 Received: from mail-wm1-f47.google.com ([209.85.128.47]:46783) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m0KuJ-0007KO-Dl for 49066@debbugs.gnu.org; Mon, 05 Jul 2021 05:28:53 -0400 Received: by mail-wm1-f47.google.com with SMTP id k16-20020a05600c1c90b02901f4ed0fcfe7so9781639wms.5 for <49066@debbugs.gnu.org>; Mon, 05 Jul 2021 02:28:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :mime-version; bh=w3bnV15PwDZMvAVl0K7sb19GiwzvhT6TGq5Xp2qLjE0=; b=LUrbntSxqWInYLrMJ5IRZm4FlASVXm7XontA9yI6+65WgWgxKjKHlpStimcaA2zZaQ AMjcJLSqsCLPtZvBVA5WdvKdvZkaGrCVUcsVufeGAH4QzJglY6Th98noqWTURMENhnf3 B14W9obkntOtqWSrIgDiAm7ev3M0Pi3FDa/dBR7UvC/XzlZSqz+ba13zkwEM/hNiHhDY AAiOH8dsLuIZGNweJzgAznwcqjWkAT50zjjIHv9ZZiNjIRlA3aI33I48HvNH7/GqFdNK vB7btqvl2CWNvDXsVWEmpav30Lcsvokn7yp0iHZiEYeehIk0vp2m7pbEOrjkbCSaI3Sq RvYQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:mime-version; bh=w3bnV15PwDZMvAVl0K7sb19GiwzvhT6TGq5Xp2qLjE0=; b=RfayM7CONiFf4pZjhPSG1beMq7t6CRWdcpBwhhTo7u8ZiOyb+fOrJ7R6h9JvcyzNH0 rOiLvLgfMASVSlR4ueLYBOX0BuAJ43U7x8jNc2V/rN0hxT6s8swS3LRSMVwkgozPTnDq 4R8VLTXB90Nf2Rmg3+eJXOZ3sIHrs9J1pD8LkjzRlnD6GSwo5i2HYRsfXjzbXfVyyM6p 98EASqSHImNQgV12hfbnaApAPNgqYVwYKpeOSPBgiBjPZjo3xUyUQKg4aB0q+56UI7V3 9HXrNdATqgfMFFSpx6s9YJzY8Lx46mYdmP28fi2VaRqt8pfAaQjlS/ZtezvlL7WKQlQ8 T8Lw== X-Gm-Message-State: AOAM531jxz2aXz8Py8dQ821zd9H2Ys67K8IwJr3jxQq6DGgri+841RKZ Dl2i+4fUmbRTMKFDmUU+fYI= X-Google-Smtp-Source: ABdhPJyRPHo/zI1Ew4TrswYCFzHN0Po5oq4lqXqfJwU+7/M2UtPeV9qgTGBss7jcssGwTfGvxOcwhw== X-Received: by 2002:a05:600c:350e:: with SMTP id h14mr7986358wmq.68.1625477325380; Mon, 05 Jul 2021 02:28:45 -0700 (PDT) Received: from rltb ([82.66.8.55]) by smtp.gmail.com with ESMTPSA id a186sm14578193wme.25.2021.07.05.02.28.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 05 Jul 2021 02:28:44 -0700 (PDT) From: Robert Pluim To: handa Subject: Re: bug#49066: 26.3; Segmentation fault on specific utf8 string References: <87zgv4cfu6.fsf@gnu.org> Date: Mon, 05 Jul 2021 11:28:43 +0200 In-Reply-To: <87zgv4cfu6.fsf@gnu.org> (handa@gnu.org's message of "Sat, 03 Jul 2021 11:05:05 +0900") Message-ID: <87k0m5cdo4.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 49066 Cc: 49066@debbugs.gnu.org, Eli Zaretskii , eggert@cs.ucla.edu, larsi@gnus.org, mvsfrasson@gmail.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) >>>>> On Sat, 03 Jul 2021 11:05:05 +0900, handa said: handa> In article <83bl7qp52q.fsf@gnu.org>, Eli Zaretskii writes: >> > With the patch it still crashes for me in emacs-master with harfbuzz disabled: >> Too bad. >> Kenichi, any suggestions? handa> I checked the code again, and found that it was a fault of m17n-lib handa> which was not robust enough to handle an OTF table that is different handa> from what the library expects. handa> Here is a revised patch to handle such a case. Could you please try it? Thanks, that fixes the crash, and results in the ZWNJ being composed. >> Btw, I think there's a bug in those patterns: ZWJ and ZWNJ shouldn't >> compose unless they are followed by a character. See section 12.2 in >> the Unicode Standard. handa> Even if they should not be composed with, we must include them in the handa> string to shape because their existence may change the glyph of the handa> previous character. A shaper (m17n-lib or harfbuzz) must return a glyph handa> string that has an independent grapheme cluster for the last ZWJ/ZWNJ. handa> At the time of developing m17n-lib, the above rule was not clear. To handa> conform to that rule, please to put the attached BNG2-OTF.flt under the handa> directory ~/.m17n.d/. I believe you, but I did not test this specifically. Robert -- From debbugs-submit-bounces@debbugs.gnu.org Mon Jul 05 09:27:59 2021 Received: (at control) by debbugs.gnu.org; 5 Jul 2021 13:27:59 +0000 Received: from localhost ([127.0.0.1]:44465 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m0Odj-00043e-Mh for submit@debbugs.gnu.org; Mon, 05 Jul 2021 09:27:59 -0400 Received: from quimby.gnus.org ([95.216.78.240]:57402) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m0Odh-00043P-4E for control@debbugs.gnu.org; Mon, 05 Jul 2021 09:27:57 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Subject:From:To:Message-Id:Date:Sender:Reply-To:Cc: MIME-Version:Content-Type:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=rGl77zAhtcUDoNzmd4geUGtjE1moDjL0dCHdrCbMc6I=; b=WoriBJKv5a+WOZ+5evKu0lF7IR PSbh6oDxg6CR4CpjEZW8OBoHYpsUqUrD16ICkMNWlZoZ8aApw98r4qVYfKErvm0iaiz3asnDpOqCC bDCwfzvZmrvOL5ug1dbjvZIwIdsdc25O/ASu1oa9fNAjaEWvdXhFpU+yZR0aG3XRtLvE=; Received: from cm-84.212.220.105.getinternet.no ([84.212.220.105] helo=elva) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1m0OdZ-0004dU-6U for control@debbugs.gnu.org; Mon, 05 Jul 2021 15:27:51 +0200 Date: Mon, 05 Jul 2021 15:27:48 +0200 Message-Id: <877di4zy97.fsf@gnus.org> To: control@debbugs.gnu.org From: Lars Ingebrigtsen Subject: control message for bug #49066 X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: tags 49066 + patch quit Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) tags 49066 + patch quit From debbugs-submit-bounces@debbugs.gnu.org Tue Jul 20 08:23:53 2021 Received: (at 49066) by debbugs.gnu.org; 20 Jul 2021 12:23:54 +0000 Received: from localhost ([127.0.0.1]:33123 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m5omv-0007TK-Oa for submit@debbugs.gnu.org; Tue, 20 Jul 2021 08:23:53 -0400 Received: from quimby.gnus.org ([95.216.78.240]:56878) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m5omt-0007T5-41 for 49066@debbugs.gnu.org; Tue, 20 Jul 2021 08:23:51 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=pTXAXEcHiZ7E9eQek4gb4WQTlDJ5HoB0R1j3/00iCoM=; b=n4/0yRu82tB6fI2pY4yDzE0u9c 1n1zieDc0KnLkDUHZzbnAOc1zEUt0U1xkMDcrjDkeDSrfbMQgCxpOe40szm81AGA5SOJCVHTl7ZHQ Q7AB/w3oMjXV2YxfwGd6j92F6a0VYAnCfkQ2VBA5UvMjnZ5Wz2+8DwiO+aN/MBgjRjQk=; Received: from cm-84.212.220.105.getinternet.no ([84.212.220.105] helo=elva) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1m5omj-00033F-Ia; Tue, 20 Jul 2021 14:23:44 +0200 From: Lars Ingebrigtsen To: Robert Pluim Subject: Re: bug#49066: 26.3; Segmentation fault on specific utf8 string References: <87zgv4cfu6.fsf@gnu.org> <87k0m5cdo4.fsf@gmail.com> X-Now-Playing: Squarepusher's _Be Up A Hello_: "Mekrev Bass" Date: Tue, 20 Jul 2021 14:23:40 +0200 In-Reply-To: <87k0m5cdo4.fsf@gmail.com> (Robert Pluim's message of "Mon, 05 Jul 2021 11:28:43 +0200") Message-ID: <87h7gpfa2b.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: Robert Pluim writes: > handa> Here is a revised patch to handle such a case. Could you > handa> please try it? > > Thanks, that fixes the crash, and results in the ZWNJ being composed. Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 49066 Cc: 49066@debbugs.gnu.org, handa , Eli Zaretskii , eggert@cs.ucla.edu, mvsfrasson@gmail.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Robert Pluim writes: > handa> Here is a revised patch to handle such a case. Could you > handa> please try it? > > Thanks, that fixes the crash, and results in the ZWNJ being composed. I see that the patch wasn't applied, so I pushed it now to Emacs 28. -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From debbugs-submit-bounces@debbugs.gnu.org Tue Jul 20 08:23:58 2021 Received: (at control) by debbugs.gnu.org; 20 Jul 2021 12:23:58 +0000 Received: from localhost ([127.0.0.1]:33126 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m5omz-0007Td-Us for submit@debbugs.gnu.org; Tue, 20 Jul 2021 08:23:58 -0400 Received: from quimby.gnus.org ([95.216.78.240]:56890) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m5omw-0007T9-6Q for control@debbugs.gnu.org; Tue, 20 Jul 2021 08:23:54 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Subject:From:To:Message-Id:Date:Sender:Reply-To:Cc: MIME-Version:Content-Type:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=ybU1yrg3eCs0Yz/7CUeRI4BQ0WlZjqBcqYwrJ/0pEsM=; b=owRC0B+jIoAM7XigPoXlxKKHMC xp+J6pPeqz917LgOKRM5HtqwUMcCdSlMpWxuZudmzfzzBEKYhuzrfEY1b9OBisA5fmpxKIUJp+GDS q6PkDGdlcY+zTIk/XXJG6ZMHrNyXN4rpcxjGFRZoEW7mqE4lnLYPOmiORkYIQ+aDvexc=; Received: from cm-84.212.220.105.getinternet.no ([84.212.220.105] helo=elva) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1m5omo-00033N-CK for control@debbugs.gnu.org; Tue, 20 Jul 2021 14:23:48 +0200 Date: Tue, 20 Jul 2021 14:23:45 +0200 Message-Id: <87fsw9fa26.fsf@gnus.org> To: control@debbugs.gnu.org From: Lars Ingebrigtsen Subject: control message for bug #49066 X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: close 49066 28.1 quit Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) close 49066 28.1 quit From unknown Sat Jun 21 03:30:00 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Wed, 18 Aug 2021 11:24:10 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator