From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Sven Joachim Newsgroups: gmane.emacs.devel,gmane.emacs.pretest.bugs Subject: Re: 23.0.60; Can't start emacs when filename contains national character Date: Sat, 29 Mar 2008 13:21:18 +0100 Message-ID: <87od8x67r5.fsf@gmx.de> References: <47EDA753.4030107@gmail.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1206793366 31877 80.91.229.12 (29 Mar 2008 12:22:46 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 29 Mar 2008 12:22:46 +0000 (UTC) Cc: Juanma Barranquero , lennart.borgman@gmail.com, emacs-pretest-bug@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Mar 29 13:23:16 2008 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1Jfa5U-0007JV-Sf for ged-emacs-devel@m.gmane.org; Sat, 29 Mar 2008 13:23:09 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Jfa4t-0006lR-6l for ged-emacs-devel@m.gmane.org; Sat, 29 Mar 2008 08:22:31 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Jfa4m-0006l2-9X for emacs-devel@gnu.org; Sat, 29 Mar 2008 08:22:24 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Jfa4k-0006kn-Qv for emacs-devel@gnu.org; Sat, 29 Mar 2008 08:22:24 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Jfa4k-0006kk-Gq for emacs-devel@gnu.org; Sat, 29 Mar 2008 08:22:22 -0400 Original-Received: from fencepost.gnu.org ([140.186.70.10]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Jfa4k-0008Vx-8k for emacs-devel@gnu.org; Sat, 29 Mar 2008 08:22:22 -0400 Original-Received: from mail.gnu.org ([199.232.76.166] helo=mx10.gnu.org) by fencepost.gnu.org with esmtp (Exim 4.67) (envelope-from ) id 1Jfa4k-0001Nf-0D for emacs-pretest-bug@gnu.org; Sat, 29 Mar 2008 08:22:22 -0400 Original-Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1Jfa4g-0008VO-Sx for emacs-pretest-bug@gnu.org; Sat, 29 Mar 2008 08:22:21 -0400 Original-Received: from mail.gmx.net ([213.165.64.20]) by monty-python.gnu.org with smtp (Exim 4.60) (envelope-from ) id 1Jfa4g-0008Uz-Be for emacs-pretest-bug@gnu.org; Sat, 29 Mar 2008 08:22:18 -0400 Original-Received: (qmail invoked by alias); 29 Mar 2008 12:22:16 -0000 Original-Received: from p548646A0.dip.t-dialin.net (EHLO debian) [84.134.70.160] by mail.gmx.net (mp035) with SMTP; 29 Mar 2008 13:22:16 +0100 X-Authenticated: #28250155 X-Provags-ID: V01U2FsdGVkX1+PP5ATt2CPD+rdQkixUnrlMAiSos8IjZO7z7D7Kn VlgzhDGLr0Rmzb In-Reply-To: (Eli Zaretskii's message of "Sat, 29 Mar 2008 14:23:04 +0300") User-Agent: Gnus/5.110007 (No Gnus v0.7) Emacs/22.2.50 (gnu/linux) X-Y-GMX-Trusted: 0 X-detected-kernel: by monty-python.gnu.org: Linux 2.6, seldom 2.4 (older, 4) X-detected-kernel: by monty-python.gnu.org: Linux 2.6, seldom 2.4 (older, 4) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:93780 gmane.emacs.pretest.bugs:21754 Archived-At: On 2008-03-29 12:23 +0100, Eli Zaretskii wrote: > It looks like this is happening because expand-file-name calls egetenv > to expand "~", but egetenv returns a unibyte string, while > expand-file-name is not prepared for this, because it makes up its > mind about multibyteness of the file name too early. > > Unless I'm missing something, the same should happen on Unix as well. > Could someone try this on Unix or GNU system with HOME set to a > directory with non-ASCII characters, and see if Emacs crashes there as > well? (This is important for me to know whether to prepare a > Windows-only change or a change that should fix all systems.) I've tested that. If the directory contains a non-ASCII character, Emacs crashes on GNU/Linux as well: (gdb) bt #0 abort () at emacs.c:430 #1 0x080bccb5 in multibyte_chars_in_text (ptr=0xbfe8400c "\344h", nbytes=14) at character.c:616 #2 0x0816c9c6 in make_specified_string (contents=0xbfe84000 "/home/sven/b\344h", nchars=-1, nbytes=14, multibyte=1) at alloc.c:2446 #3 0x0814651d in Fexpand_file_name (name=136391979, default_directory=148045091) at fileio.c:1723 #4 0x081823a2 in Ffuncall (nargs=2, args=0xbfe84108) at eval.c:3028 #5 0x081abe4c in Fbyte_code (bytestr=136391731, vector=136391748, maxdepth=) at bytecode.c:679 #6 0x08181d24 in funcall_lambda (fun=136391692, nargs=1, arg_vector=0xbfe84244) at eval.c:3212 #7 0x0818213f in Ffuncall (nargs=2, args=0xbfe84240) at eval.c:3082 #8 0x081abe4c in Fbyte_code (bytestr=136470267, vector=136470284, maxdepth=) at bytecode.c:679 #9 0x08181d24 in funcall_lambda (fun=136470244, nargs=0, arg_vector=0xbfe84310) at eval.c:3212 #10 0x08181f20 in apply_lambda (fun=136470244, args=137743641, eval_flag=1) at eval.c:3136 #11 0x081815d4 in Feval (form=138225021) at eval.c:2416 #12 0x0811dbf3 in top_level_2 () at keyboard.c:1379 #13 0x08180c60 in internal_condition_case (bfun=0x811dbe0 , handlers=137786737, hfun=0x8122510 ) at eval.c:1494 #14 0x08121930 in top_level_1 () at keyboard.c:1387 #15 0x08180d3a in internal_catch (tag=137782737, func=0x8121900 , arg=137743641) at eval.c:1230 #16 0x08122359 in command_loop () at keyboard.c:1342 #17 0x081226db in recursive_edit_1 () at keyboard.c:958 #18 0x08122811 in Frecursive_edit () at keyboard.c:1020 #19 0x081171ec in main (argc=1, argv=0xbfe849c4) at emacs.c:1784 Lisp Backtrace: "expand-file-name" (0xbfe8410c) "abbreviate-file-name" (0xbfe84244) "normal-top-level" (0xbfe84310) (gdb) The crash does not happen with a UTF-8 encoded non-ASCII character. Sven