From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: handa@gnu.org (K. Handa) Newsgroups: gmane.emacs.bugs Subject: bug#15984: 24.3; Problem with combining characters in attachment filename Date: Fri, 17 Jan 2014 22:30:05 +0900 Message-ID: <874n52pwgy.fsf@gnu.org> References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1389965468 26759 80.91.229.3 (17 Jan 2014 13:31:08 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 17 Jan 2014 13:31:08 +0000 (UTC) Cc: 15984@debbugs.gnu.org, nisse@lysator.liu.se To: handa@gnu.org (K. Handa) Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Jan 17 14:31:12 2014 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1W49Vv-0006jw-3A for geb-bug-gnu-emacs@m.gmane.org; Fri, 17 Jan 2014 14:31:11 +0100 Original-Received: from localhost ([::1]:38184 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W49Vu-0002lO-Mx for geb-bug-gnu-emacs@m.gmane.org; Fri, 17 Jan 2014 08:31:10 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:46162) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W49Vq-0002lI-JQ for bug-gnu-emacs@gnu.org; Fri, 17 Jan 2014 08:31:08 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W49Vm-0008FO-HF for bug-gnu-emacs@gnu.org; Fri, 17 Jan 2014 08:31:06 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:40557) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W49Vm-0008Ef-CI for bug-gnu-emacs@gnu.org; Fri, 17 Jan 2014 08:31:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1W49Vm-0006Jj-3L for bug-gnu-emacs@gnu.org; Fri, 17 Jan 2014 08:31:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: handa@gnu.org (K. Handa) Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 17 Jan 2014 13:31:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 15984 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 15984-submit@debbugs.gnu.org id=B15984.138996542324214 (code B ref 15984); Fri, 17 Jan 2014 13:31:02 +0000 Original-Received: (at 15984) by debbugs.gnu.org; 17 Jan 2014 13:30:23 +0000 Original-Received: from localhost ([127.0.0.1]:54576 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1W49V8-0006IT-9z for submit@debbugs.gnu.org; Fri, 17 Jan 2014 08:30:23 -0500 Original-Received: from fencepost.gnu.org ([208.118.235.10]:51026) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1W49V4-0006IH-3x for 15984@debbugs.gnu.org; Fri, 17 Jan 2014 08:30:19 -0500 Original-Received: from fl1-119-240-87-91.iba.mesh.ad.jp ([119.240.87.91]:32778 helo=wanchai) by fencepost.gnu.org with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1W49V2-0000LX-KJ; Fri, 17 Jan 2014 08:30:17 -0500 Original-Received: from handa by wanchai with local (Exim 4.80) (envelope-from ) id 1W49Us-0000y5-Em; Fri, 17 Jan 2014 22:30:06 +0900 In-Reply-To: <87eh574qmm.fsf@gnu.org> (handa@gnu.org) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:83645 Archived-At: In article <87eh574qmm.fsf@gnu.org>, handa@gnu.org (K. Handa) writes: > I'll keep trying to find why the trunk doesn't crash with > you recipe, and once I find the whole story, I'll install a > proper patch (which may be the same as what I sent) to the > trunk. I couldn't reproduce that bug with the trunk code. I rewinded back to the day 2013-03-11 which is the day 24.3 was released and I can reproduce the bug with 24.3. So, I am now very puzzled. Anyway, I installed that fix to the trunk because the previous code was apparently wrong. --- Kenichi Handa handa@gnu.org PS. I've just noticed that recent mails exchanged on this matter were not CC:ed to 15984@debbugs.gnu.org. So, to provide the context, I attach some key mails here. -1-------------------------------------------------------------------- From: nisse@lysator.liu.se (Niels M=F6ller) To: handa@gnu.org (K. Handa) Subject: Re: bug#15984: 24.3; Problem with combining characters in attachme= nt filename handa@gnu.org (K. Handa) writes: > In article <83siue58mq.fsf@gnu.org>, Eli Zaretskii writes: > >> I hope Handa-san will be able to find the problem. The crash is 100% >> reproducible with the steps described above and a mail message that >> Niels can send you off-list. > > Could you please send me that mail message? I'll delete it > as soon as I can find a fix. I believe the smaller bounce message I posted in the bugtracker exhibits the the problem. That's the same file Eli was using when reproducing the problem. Described at http://debbugs.gnu.org/cgi/bugreport.cgi?msg=3D14;bug=3D15984 actual messge (gzipped): http://debbugs.gnu.org/cgi/bugreport.cgi?msg=3D14;filename=3Dbounce.gz;at= t=3D1;bug=3D15984 Steps to reproduce the problem (this info spread out in the bug thread): 1. Create a new directory, say mail-tmp. Copy the message (uncompressed) into that directory, with filename "1". 2. Start emacs in tty mode, with a latin-1 locale, like HOME=3D$HOME/tmp LC_CTYPE=3Dsv_SE.ISO8859-1 src/emacs -Q -l bug.el with bug.el containing (setq gnus-init-file nil) (setq gnus-nntp-server nil) (gnus-no-server) 3. Then, in Gnus' *Group* buffer, create the group with G d, pointing out the mail-tmp directory, enter the group (RET), view the message (RET), try to write out the attachment ("o" on the attachment button). Still crashes for me. Let me know if you need anything further info. Regards, /Niels --=20 Niels M=F6ller. PGP-encrypted email is preferred. Keyid C0B98E26. Internet email is subject to wholesale government surveillance. -2-------------------------------------------------------------------- From: Eli Zaretskii Subject: Re: bug#15984: 24.3; Problem with combining characters in attachme= nt filename To: handa@gnu.org (K. Handa) Cc: nisse@lysator.liu.se, handa@gnu.org > From: handa@gnu.org (K. Handa) > Cc: eliz@gnu.org, handa@gnu.org > Date: Fri, 13 Dec 2013 23:15:00 +0900 >=20 > In article , nisse@lysator.liu.se (N= iels M=F6ller) writes: >=20 > > And tty mode, no X frame (I used an xterm, started in a latin-1 locale). >=20 > Yes. I surely add "-nw" argument, and I tried the recipe > with xterm and lxterminal. I cannot reproduce this either, with today's trunk. Perhaps you could try with the trunk as it was on Nov 30, or with Emacs 24.3? > By the way, I noticed that buffer-file-coding-system of > Gnus's message buffer (the buffer showing that bounce mail) > is raw-text-unix. Is it the same with you? Yes. This might be part of the problem, or it could be the trigger for the crash. -3--------------------------------------------------------------------- From: handa@gnu.org (K. Handa) To: nisse@lysator.liu.se (Niels M=F6ller) Cc: eliz@gnu.org, handa@gnu.org Subject: Re: bug#15984: 24.3; Problem with combining characters in attachme= nt filename In article , nisse@lysator.liu.se (Nie= ls M=F6ller) writes: > And tty mode, no X frame (I used an xterm, started in a latin-1 locale). Yes. I surely add "-nw" argument, and I tried the recipe with xterm and lxterminal. By the way, I noticed that buffer-file-coding-system of Gnus's message buffer (the buffer showing that bounce mail) is raw-text-unix. Is it the same with you? --- Kenichi Handa handa@gnu.org -4-------------------------------------------------------------------- From: nisse@lysator.liu.se (Niels M=F6ller) To: handa@gnu.org (K. Handa) Cc: eliz@gnu.org Subject: Re: bug#15984: 24.3; Problem with combining characters in attachme= nt filename handa@gnu.org (K. Handa) writes: > By the way, I noticed that buffer-file-coding-system of > Gnus's message buffer (the buffer showing that bounce mail) > is raw-text-unix. Is it the same with you? Yes. Probably wasn't in the original mail (if you like, I can look into that further, but I don't want to crash the emacs I'm writing this in right now). Regards, /Niels --=20 Niels M=F6ller. PGP-encrypted email is preferred. Keyid C0B98E26. Internet email is subject to wholesale government surveillance. -5-------------------------------------------------------------------- From: handa@gnu.org (K. Handa) To: Eli Zaretskii Cc: nisse@lysator.liu.se, handa@gnu.org Subject: Re: bug#15984: 24.3; Problem with combining characters in attachme= nt filename In article <838uvo6cjx.fsf@gnu.org>, Eli Zaretskii writes: > I cannot reproduce this either, with today's trunk. Perhaps you > could try with the trunk as it was on Nov 30, or with Emacs 24.3? With Emacs 24.3, I could reproduce the bug and the patch attached at the tail seems to fix it. Could you please try it? It is applicable to the latest code too. But, with the trunk, I have not yet succeeded in reproducing the bug. I tried from the revision of Nov 30 and went back to April one month by one. > > By the way, I noticed that buffer-file-coding-system of > > Gnus's message buffer (the buffer showing that bounce mail) > > is raw-text-unix. Is it the same with you? > Yes. This might be part of the problem, or it could be the trigger > for the crash. With Emacs 24.3, the bug can be reproduced with a multibyte buffer. --- Kenichi Handa handa@gnu.org =3D=3D=3D modified file 'src/composite.c' --- src/composite.c 2013-01-01 09:11:05 +0000 +++ src/composite.c 2013-12-19 13:49:53 +0000 @@ -1426,7 +1426,7 @@ cmp_it->width =3D 0; for (i =3D cmp_it->nchars - 1; i >=3D 0; i--) { - c =3D XINT (LGSTRING_CHAR (gstring, i)); + c =3D XINT (LGSTRING_CHAR (gstring, cmp_it->from + i)); cmp_it->nbytes +=3D CHAR_BYTES (c); cmp_it->width +=3D CHAR_WIDTH (c); } -6-------------------------------------------------------------------- From: nisse@lysator.liu.se (Niels M=F6ller) To: handa@gnu.org (K. Handa) Cc: Eli Zaretskii Subject: Re: bug#15984: 24.3; Problem with combining characters in attachme= nt filename handa@gnu.org (K. Handa) writes: > With Emacs 24.3, I could reproduce the bug and the patch > attached at the tail seems to fix it. Could you please try > it? It is applicable to the latest code too. I compiled 24.3.1 with the patch applied. It no longer crashes. Great! Behavior is that on saving the attachment, the default filename is displayed as "Brev aktiea?gar 131127.pdf", where the question mark really is a COMBINING DIAERESIS (according to C-u C-x =3D). When I press enter, the file is saved under the file name "Brev aktiea gar 131127.pdf", with the combining diaeresis replaced by a SPC character (checked with GNU ls -N | od -tx1c). Regards, /Niels --=20 Niels M=F6ller. PGP-encrypted email is preferred. Keyid C0B98E26. Internet email is subject to wholesale government surveillance. -7--------------------------------------------------------------------- From: handa@gnu.org (K. Handa) To: nisse@lysator.liu.se (Niels M=F6ller) Cc: eliz@gnu.org, handa@gnu.org Subject: Re: bug#15984: 24.3; Problem with combining characters in attachme= nt filename In article , nisse@lysator.liu.se (Nie= ls M=F6ller) writes: > handa@gnu.org (K. Handa) writes: > > With Emacs 24.3, I could reproduce the bug and the patch > > attached at the tail seems to fix it. Could you please try > > it? It is applicable to the latest code too. > I compiled 24.3.1 with the patch applied. It no longer crashes. Great! Thank you for testing that. > Behavior is that on saving the attachment, the default filename is > displayed as "Brev aktiea?gar 131127.pdf", where the question mark > really is a COMBINING DIAERESIS (according to C-u C-x =3D). When I press > enter, the file is saved under the file name "Brev aktiea gar > 131127.pdf", with the combining diaeresis replaced by a SPC character > (checked with GNU ls -N | od -tx1c). This just my guess, but, as far as you are in ISO-8859-1 locale, there's no way to encode that combining diaeresis, so gnus uses SPC as a replacement character. Perhaps, gnus should warn you about that and ask you how to encode the file name. Anyway that is completely different matter than bug#15984. I'll keep trying to find why the trunk doesn't crash with you recipe, and once I find the whole story, I'll install a proper patch (which may be the same as what I sent) to the trunk. --- Kenichi Handa handa@gnu.org