Comment 3 for bug 7339

Revision history for this message
In , Jurij Smakov (jurij) wrote : Re: [whiptail] segfault on list

Greetings,

I have looked into this problem a bit. Running valgrind on whiptail with
specified options produces a following error:

==21640== Memcheck, a memory error detector for x86-linux.
==21640== Copyright (C) 2002-2004, and GNU GPL'd, by Julian Seward et al.
==21640== Using valgrind-2.1.2, a program supervision framework for x86-linux.
==21640== Copyright (C) 2000-2004, and GNU GPL'd, by Julian Seward et al.
==21640== For more details, rerun with: -v
==21640==
==21640== Invalid write of size 4
==21640== at 0x1B95E307: SLsmg_write_nwchars (slsmg.c:635)
==21640== by 0x1B95E6A0: SLsmg_write_nchars (slsmg.c:716)
==21640== by 0x1B95DEBC: SLsmg_write_string (slsmg.c:298)
==21640== by 0x1B927A1D: textboxDraw (textbox.c:353)
==21640== Address 0x1BB20C74 is 0 bytes after a block of size 348 alloc'd
==21640== at 0x1B904EDD: malloc (vg_replace_malloc.c:131)
==21640== by 0x1B955919: SLmalloc (slmisc.c:78)
==21640== by 0x1B95FD1B: init_smg (slsmg.c:1533)
==21640== by 0x1B95FE9A: SLsmg_init_smg (slsmg.c:1572)
America/Argentina/Buenos_Aires (Buenos Aires (BA; CF))==21640==
[...]

So it seems like at some point an extra wchar (4 bytes) gets written past
the allocated memory region by SLsmg_write_wchar (it comes from the
slang1a-utf8 library), which might be the culprit. I'll try to investigate
further and (hopefully) come up with a solution.

Best regards,

Jurij Smakov <email address hidden>
Key: http://www.wooyd.org/pgpkey/ KeyID: C99E03CC