Bug 604725 - zsh crashes when command line argument contains Japanese characters in emacs shell mode,
Summary: zsh crashes when command line argument contains Japanese characters in emacs...
Alias: None
Product: Fedora
Classification: Fedora
Component: zsh
Version: 13
Hardware: x86_64
OS: Linux
Target Milestone: ---
Assignee: James Antill
QA Contact: Fedora Extras Quality Assurance
Depends On:
TreeView+ depends on / blocked
Reported: 2010-06-16 15:18 UTC by Masami Ichikawa
Modified: 2011-06-09 00:00 UTC (History)
4 users (show)

Fixed In Version: zsh-4.3.10-6.fc14
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2011-06-08 23:57:38 UTC
Type: ---

Attachments (Terms of Use)
evidence of the bug. (2.27 KB, text/plain)
2010-06-16 15:18 UTC, Masami Ichikawa
no flags Details
backtrace (1.60 KB, text/plain)
2010-07-30 09:19 UTC, Daiki Ueno
no flags Details

Description Masami Ichikawa 2010-06-16 15:18:51 UTC
Created attachment 424502 [details]
evidence of the bug.

Description of problem: 
When I execute a command that argument is written in Japanese in emacs shell mode, I got following message.
[masami@moon]~% ls ダウンロード
ls *** glibc detected *** /bin/zsh: double free or corruption (!prev): 0x00000000025e2c10 ***
*** glibc detected *** /bin/zsh: malloc(): memory corruption: 0x00000000025e2cc0 ***

I tested "ls", "cat", "cp" and "touch" commands and they got an error.

My default login shell is /bin/zsh, if I start emacs following command line, I didn't see the bug.
[masami@moon]~% SHELL=/bin/bash emacs

Only if I use zsh, I got the error. also, if I use LANG=C when start emacs, I didn't get it. actually, emacs shell mode can't handle Japanese character, anyway.

However, if I gave one Japanese character, zsh didn't crash but if I gave five Japanese character zsh crashed.
[masami@moon]~% touch あ
touch あ
[masami@moon]~% touch あいうえお
touch あ*** glibc detected *** /bin/zsh: free(): invalid next size (normal): 0x0000000001d2baa0 ***
*** glibc detected *** /bin/zsh: malloc(): memory corruption: 0x0000000001d2bb70 ***

Please let me know, if I can help debugging the problem.

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1.Set default LANG as ja_JP.utf8

2.Set default SHELL as /bin/zsh

3.Create a file which name is written by Japanese.

4.Rename your ~/.emacs to ~/dot_emacs or something else to emacs doesn't read your config.

5.Run emacs without any options.

6.Start emacs shell mode(M-x shell)

7.Excute "ls" command with file name which was created at step3.

Actual results:
Got that message:
*** glibc detected *** /bin/zsh: double free or corruption (!prev): 0x00000000025e2c10 ***
*** glibc detected *** /bin/zsh: malloc(): memory corruption: 0x00000000025e2cc0 ***

Expected results:
Any command should be success.

Additional info:

Comment 1 Daiki Ueno 2010-07-30 09:18:56 UTC
Here is another steps to reproduce:

On gnome-terminal, do:

 LANG=ja_JP.utf8 TERM=dumb zsh -f

Enable a Japanese input method (e.g. ibus & ibus-anthy)

Type 'あ' (= 'a') and commit (= Return).

I'm attaching a backtrace.

Comment 2 Daiki Ueno 2010-07-30 09:19:41 UTC
Created attachment 435506 [details]

Comment 3 Daiki Ueno 2010-08-02 04:34:01 UTC
I posted a patch for this:

Comment 4 Daiki Ueno 2010-12-20 17:25:05 UTC
FYI, zsh 4.3.11 including the fix has just been released.

Comment 5 Akira TAGOH 2011-05-24 12:54:13 UTC
Thanks for tracking. is there any chance to push updates for f13 and f14?

Comment 6 James Antill 2011-05-24 17:51:53 UTC
Akira, if you want to co-maintain zsh ... I'm happy to let you backport this.

Comment 7 Akira TAGOH 2011-05-26 03:07:03 UTC
Okay, I'll work on it then. thanks for offering!

Comment 8 Fedora Update System 2011-05-30 08:49:02 UTC
zsh-4.3.10-6.fc13 has been submitted as an update for Fedora 13.

Comment 9 Fedora Update System 2011-05-30 08:49:51 UTC
zsh-4.3.10-6.fc14 has been submitted as an update for Fedora 14.

Comment 10 Fedora Update System 2011-05-30 22:30:47 UTC
Package zsh-4.3.10-6.fc13:
* should fix your issue,
* was pushed to the Fedora 13 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing zsh-4.3.10-6.fc13'
as soon as you are able to.
Please go to the following url:
then log in and leave karma (feedback).

Comment 11 Bug Zapper 2011-06-02 10:36:40 UTC
This message is a reminder that Fedora 13 is nearing its end of life.
Approximately 30 (thirty) days from now Fedora will stop maintaining
and issuing updates for Fedora 13.  It is Fedora's policy to close all
bug reports from releases that are no longer maintained.  At that time
this bug will be closed as WONTFIX if it remains open with a Fedora 
'version' of '13'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version prior to Fedora 13's end of life.

Bug Reporter: Thank you for reporting this issue and we are sorry that 
we may not be able to fix it before Fedora 13 is end of life.  If you 
would still like to see this bug fixed and are able to reproduce it 
against a later version of Fedora please change the 'version' of this 
bug to the applicable version.  If you are unable to change the version, 
please add a comment here and someone will do it for you.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events.  Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

The process we are following is described here: 

Comment 12 Fedora Update System 2011-06-08 23:57:32 UTC
zsh-4.3.10-6.fc13 has been pushed to the Fedora 13 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 13 Fedora Update System 2011-06-09 00:00:37 UTC
zsh-4.3.10-6.fc14 has been pushed to the Fedora 14 stable repository.  If problems still persist, please make note of it in this bug report.

Note You need to log in before you can comment on or make changes to this bug.