Subject: utf-8 core dumped

From: "S. Anderson" <[email-masked]>
Date: Sat, 12 Jul 2003 14:21:38 -0600

Hi,
I was testing the new combining character feature with cvs fvwm
(checked out on july 12 03). I found that I can make fvwm Segfault
by doing the following:

with my locale set to en_US.UTF-8
start fvwm with the following in my .fvwm2rc

########
Mouse 1 R N Menu  TestMenu
AddtoMenu TestMenu
+ "⎧⎡⎛┌─────┐⎞⎤⎫"  Nop
+ "⎪⎢⎜│a²+b³ ⎟⎥⎪" Nop
+ "Λ̊TE SG-1, a = v̇ = r̈, a⃑ ⊥ b⃑" Nop
+ "Σὲ γνωρίζω ἀπὸ τὴν κόψη" Nop
+ "ἐξῆν τῇ πόλει καὶ τὰ αὑτῆς" Nop
+ "გთხოვთ" Nop
+ "Зарегистрируйтесь" Nop
+ "๏ แผ่นดินฮั่นเสื่อมโทรมแสนสังเวช" Nop
+ "ᚹᛖᛥᚫ" Nop
+ "⡎⠊⠗⠕⠕⠛⠑⠰⠎" Nop
+ "∀∂∈ℝ∧∪≡∞ ↑↗↨↻⇣ ┐┼╔╘░►☺♀ ﬁ�⑀₂ἠḂӥẄɐː⍎אԱა" Nop
+ "毎日 あいうえお アイウエオ" Nop
+ "▁▂▃▄▅▆▇█ ░░▒▒▓▓██ ╲╱╲╱╳╳╳"
########
#

then click mouse button 1 to pop up the menu,
then move the mouse up and down, going through the menu items a few times.

this is when I get the core dump.

If you need more info let me know,
sa

sa@m ~ % gdb /home/sa/local/bin/fvwm core
GNU gdb 5.3
...
(gdb) where
#0  0x402b7031 in _int_free () from /lib/libc.so.6
#1  0x402b5eca in free () from /lib/libc.so.6
#2  0x080d05b3 in CombineChars (
    str_visual=0x8118660 "�\216��\216��\216\234�\224\202a²+b³ �\216\237�\216��\216�", len=1077316800, comb_chars=0xbfffe88c, l_to_v=0x0)
    at CombineChars.c:2114
#3  0x080b9d27 in FlocaleEncodeString (dpy=0x80fbe10, flf=0x81133b8, 
    str=0x8114ad8 "�\216��\216��\216\234�\224\202a²+b³ �\216\237�\216��\216�", do_free=0xbfffe884, len=135366272, nl=0xbfffe888, is_rtl=0x21, 
    comb_chars=0x6c, l_to_v=0x6c) at Flocale.c:446
#4  0x080b9eb4 in FlocaleEncodeWinString (dpy=0x80fbe10, flf=0x81133b8, 
    fws=0x8118040, do_free=0x21, len=0xbfffe888, comb_chars=0x21, l_to_v=0x21)
    at Flocale.c:533
#5  0x080bc62d in FlocaleDrawString (dpy=0x80fbe10, flf=0x81133b8, 
    fws=0x8118040, flags=0) at Flocale.c:1804
#6  0x080ad80f in menuitem_paint (mi=0x8114a90, mpip=0xbfffebc0)
    at menuitem.c:680
#7  0x08052533 in select_menu_item (mr=0x8113490, mi=0x8114a90, select=1, 
    fw=0xbfffe888) at menus.c:3468
#8  0x08054eb5 in __mloop_select_item (pmp=0xbfffef20, in=0x40369720, 
    med=0xbfffed00, does_submenu_overlap=108, 
    pdoes_popdown_submenu_overlap=0x21) at menus.c:4991
#9  0x08055bd0 in __mloop_handle_action_with_mi (pmp=0xbfffef20, 
    pmret=0xbfffef10, pdkp=0xbfffee40, in=0xbfffed20, med=0xbfffed00, 
    msi=0x21, pops=0xbfffecb0, pdoes_submenu_overlap=0xbfffeca8, 
    pdoes_popdown_submenu_overlap=0xbfffecac) at menus.c:5452
#10 0x080563c1 in __menu_loop (pmp=0xbfffef20, pmret=0xbfffef10, 
    pdkp=0xbfffee40) at menus.c:5834
#11 0x08056f0f in do_menu (pmp=0xbfffef20, pmret=0xbfffef10) at menus.c:6391
#12 0x080b7043 in menu_func (cond_rc=0x21, exc=0x81182e8, action=0x0, 
    fStaysUp=1) at menucmd.c:116
#13 0x080b7187 in CMD_Menu (cond_rc=0x21, exc=0x21, 
    action=0x21 <Address 0x21 out of bounds>) at menucmd.c:145
#14 0x080a14fc in __execute_function (cond_rc=0x0, exc=0x81181f8, 
    action=0xbfffef50 "", exec_flags=0 '\0', args=0xbfffed20)
    at functions.c:630
#15 0x080a232f in execute_function (cond_rc=0x21, exc=0x21, 
    action=0x21 <Address 0x21 out of bounds>, exec_flags=0 '\0')
    at functions.c:1225
#16 0x08061b8f in __handle_bpress_on_root (exc=0x81181f8) at events.c:1356
#17 0x08061d9a in HandleButtonPress (ea=0x81181f8) at events.c:1470
#18 0x08064808 in dispatch_event (e=0x8113eb0) at events.c:3534
#19 0x080648bb in HandleEvents () at events.c:3572
#20 0x080895df in main (argc=1, argv=0xbffff6f4) at fvwm.c:2426
#21 0x402587a6 in __libc_start_main () from /lib/libc.so.6
(gdb)
--
Visit the official FVWM web page at <URL:http://www.fvwm.org/>.
To unsubscribe from the list, send "unsubscribe fvwm-workers" in the
body of a message to [email-masked].
To report problems, send mail to [email-masked]

---

From: "S. Anderson" <[email-masked]>
Date: Sat, 12 Jul 2003 14:30:43 -0600

> start fvwm with the following in my .fvwm2rc

I dont think that .fvwm2rc made it to the list properly,
you can download it here if you need to:
http://www.xmission.com/~sa/test.fvwm2rc

cya,
sa

---

From: Marcus Lundblad <[email-masked]>
Date: Sun, 13 Jul 2003 19:59:06 +0200 (CEST)

> (checked out on july 12 03). I found that I can make fvwm Segfault

I found a bug that can cause FVWM to crash in some circumtances.
I've checked in a bug-fix. So it should be OK in the next snapshot.

By the way, I was thinking about generating random UTF-8 strings for
testing. How did you generate these strings?
Did you just pick some characters? I could see there is even runic letters
in there (but the reading makes no sense...)

And thank you for finding the bug.

//Marcus

---

From: [email-masked]
Date: Sun, 13 Jul 2003 20:17:43 -0600

> in there (but the reading makes no sense...)

I couldnt understand them either :-)
I found them here: http://www.cl.cam.ac.uk/~mgk25/ucs/examples/UTF-8-demo.txt
this program might be of interest too: 
http://www.mit.edu/afs/sipb/project/gtk/src/pango-1.0.4/tests/gen-all-unicode.c

thanks,
sa