Expect unicode segmentation fault

85 views
Skip to first unread message

Freddy Vulto

unread,
Oct 23, 2010, 4:07:51 AM10/23/10
to
We're using Expect (DejaGnu) for the bash-completion test suite, but
having
problems with unicode now. The following script is giving me a
Segmentation
fault:

$ cat unicode.exp
spawn bash
send "aaébb"
expect -ex "aaébb" {send_user "PASS"}
$ expect -f unicode.exp
spawn bash
aaébbSegmentation fault

Environment (Ubuntu-10.04):
- expect-5.44.1.14
- tcl-8.4.19
- bash-4.1.5
- locale is set to "en_US.UTF-8"

More information:

$ strace expect -f unicode.exp
...
read(6, "aa\303\251bb", 4096) = 6
brk(0x9f76000) = 0x9f76000
write(1, "aa\303\251bb", 6aaébb) = 6
--- SIGSEGV (Segmentation fault) @ 0 (0) ---
+++ killed by SIGSEGV +++

With `é' changed to `e', everything's all right:

$ cat unicode2.exp
spawn bash
send "aaebb"
expect -ex "aaebb" {send_user "PASS"}
$ strace expect -f unicode2.exp
...
write(1, "aaebb", 5aaebb) = 5
write(1, "PASS", 4PASS) = 4
...

Is this a bug in Expect, or bash, or am I doing something wrong?

Freddy Vulto
http://fvue.nl

Freddy Vulto

unread,
Oct 23, 2010, 2:38:07 PM10/23/10
to
The problem does not occur when using I'm using expect-5.43.0 ...

Jeff Hobbs

unread,
Oct 26, 2010, 9:17:41 PM10/26/10
to

This was just identified and fixed on the Expect cvs head:

https://sourceforge.net/tracker/index.php?func=detail&aid=3095935&group_id=13179&atid=313179

Jeff

Reply all
Reply to author
Forward
0 new messages