SourceForge has been redesigned. Learn more.
Close

#56 segmentation fault by setting Japanese window title

closed-fixed
nobody
None
5
2011-05-15
2011-04-08
No

mlterm crashes within ml_term_set_window_name() when I try to change the window title containing Japanese characters (encoding is utf8) by using vt100 escape sequence.

echo -n "\e]2;日本語\007" (using zsh)

Here is a backtrace:
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 8044041c0 (LWP 100519/initial thread)]
0x0000000802d13417 in strlen () from /lib/libc.so.7
(gdb) where
#0 0x0000000802d13417 in strlen () from /lib/libc.so.7
#1 0x0000000802c9554d in strdup () from /lib/libc.so.7
#2 0x0000000000449fb6 in ml_term_set_window_name (term=0x80445b080, name=0x0)
at ml_term.c:1234
#3 0x000000000041d889 in xterm_set_window_name (p=0x8044d6200, name=0x0)
at x_screen.c:6514
#4 0x000000000044b095 in set_window_name (vt100_parser=0x804431000, name=0x0)
at ml_vt100_parser.c:671
#5 0x000000000044d5ba in parse_vt100_escape_sequence (
vt100_parser=0x804431000) at ml_vt100_parser.c:2525
#6 0x000000000044bfcb in parse_vt100_sequence (vt100_parser=0x804431000)
at ml_vt100_parser.c:3133
#7 0x000000000044e541 in ml_parse_vt100_sequence (vt100_parser=0x804431000)
at ml_vt100_parser.c:3329
#8 0x0000000000448f79 in ml_term_parse_vt100_sequence (term=0x80445b080)
at ml_term.c:285
#9 0x000000000040b30c in receive_next_event () at x_term_manager.c:1667
#10 0x000000000040bec0 in x_term_manager_event_loop () at x_term_manager.c:2192
#11 0x000000000042d121 in main (argc=1, argv=0x7fffffffdd70) at main.c:72

It seems that the contents of term->parser is already broken, but I don't know why.

(gdb) p term->parser->seq
$5 = "\033]2;\227\234\236\a\033[1m\033[7m%\033[27m\033[1m\033[0m", ' ' <repeats 79 times>, "\r \r.jp\000\031\000@\004\031\000@\004\031\000@\004\031\000@\004\031\000@\004\031\000@\004\031\000@\004\031\000@\004\031\000@\004\031\000@\004\031\000@\004\031\000@\004\031\000@\004\031\000@\004\211\000@\004\211\000@\004\211\000@\004\211\000@\004\211\000@\004\211\000@\004\211\000@\004\211\000@\004\211\000@\004\211\000@\004\211\000@\004\211\000@\004\211\000@\004\211\000@\004\211\000@\004\211\000@\004\211\000@\004\211\000@\004\211\000@\004\211\000@\004\211\000@\004\211\000@\004\211\000@"...
(gdb) p term->parser->len
$6 = 118

I'm running mlterm on FreeBSD-8.2R (amd64), installed via ports collection.
configure options:
$ ./configure --with-imagelib=gdk-pixbuf2 --enable-utmp --mandir=/usr/local/man --enable-optimize-redrawing --with-tools=mlclient,mlconfig,mlterm-menu,mlcc,w3mmlconfig --with-type-engines=xcore,xft --disable-fribidi --enable-uim --disable-m17nlib --disable-iiimf --disable-scim --disable-ibus --x-libraries=/usr/local/lib --x-includes=/usr/local/include --prefix=/usr/local --mandir=/usr/local/man --infodir=/usr/local/info/ --build=amd64-portbld-freebsd8.2

Discussion

  • Araki Ken

    Araki Ken - 2011-04-22

    Thanks for your report.
    I think an attached patch fixes this problem.

     
  • Araki Ken

    Araki Ken - 2011-04-22
    • status: open --> open-fixed
     
  • Araki Ken

    Araki Ken - 2011-05-15
    • status: open-fixed --> closed-fixed
     

Log in to post a comment.