bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [t2] Re: Where are the version controlled Bash sources?


From: Juergen "George" Sawinski
Subject: Re: [t2] Re: Where are the version controlled Bash sources?
Date: Wed, 05 Jan 2005 00:02:32 +0100
User-agent: Mozilla Thunderbird 1.0RC1 (X11/20041204)

Hi all.

Chet Ramey wrote:
if (rl_completer_word_break_characters == 0 && bash_readline_initialized == 0)
     enable_hostname_completion (perform_hostname_completion);

-#if 0
+#if 1
   FREE (value_cell (var));
   p = savestring (rl_completer_word_break_characters);

If I use this code in get_comp_wordbreaks (var), the segfault is also gone.

Comments?

Unrelated, or related only coincidentally depending on how COMP_WORDBREAKS
is allocated.  This isn't actually a bug.

Hm. Really? Okay, admittedly I do not know that much about bash internals, but... on the other hand, the valgrind error log (the off by 4 free...) may hint to a different flaw. But back to my "but":

Activating the #if 0'd code at least makes sure, the two code path (one is enable_hostname_completion, the other one is the shell variable treatment) do not interfere.

With the original code (bashbug info see end of mail) valgrind reports this:

==25326== Invalid read of size 1
==25326==    at 0x4001C508: strchr (in /usr/lib/valgrind/vgskin_memcheck.so)
==25326==    by 0x808E4D5: enable_hostname_completion (bashline.c:294)
==25326==    by 0x808ECC7: initialize_readline (bashline.c:480)
==25326==    by 0x805EB52: yy_readline_get (parse.y:1196)
==25326==    Address 0x412D0094 is 4 bytes inside a block of size 20 free'd
==25326==    at 0x40023471: free (in /usr/lib/valgrind/vgskin_memcheck.so)
==25326==    by 0x8087CB0: without_interrupts (unwind_prot.c:106)
==25326==    by 0x806D4C5: execute_command (execute_cmd.c:350)
==25326==    by 0x806D6F1: execute_for_command (execute_cmd.c:1658)
==25326==
==25326== Invalid read of size 1
==25326==    at 0x4001C6FD: strlen (in /usr/lib/valgrind/vgskin_memcheck.so)
==25326==    by 0x808E57F: enable_hostname_completion (bashline.c:299)
==25326==    by 0x808ECC7: initialize_readline (bashline.c:480)
==25326==    by 0x805EB52: yy_readline_get (parse.y:1196)
==25326==    Address 0x412D0094 is 4 bytes inside a block of size 20 free'd
==25326==    at 0x40023471: free (in /usr/lib/valgrind/vgskin_memcheck.so)
==25326==    by 0x8087CB0: without_interrupts (unwind_prot.c:106)
==25326==    by 0x806D4C5: execute_command (execute_cmd.c:350)
==25326==    by 0x806D6F1: execute_for_command (execute_cmd.c:1658)
==25326==
==25326== Invalid read of size 1
==25326==    at 0x4001C720: strcpy (in /usr/lib/valgrind/vgskin_memcheck.so)
==25326==    by 0x808E5EE: enable_hostname_completion (bashline.c:316)
==25326==    by 0x808ECC7: initialize_readline (bashline.c:480)
==25326==    by 0x805EB52: yy_readline_get (parse.y:1196)
==25326==    Address 0x412D0094 is 4 bytes inside a block of size 20 free'd
==25326==    at 0x40023471: free (in /usr/lib/valgrind/vgskin_memcheck.so)
==25326==    by 0x8087CB0: without_interrupts (unwind_prot.c:106)
==25326==    by 0x806D4C5: execute_command (execute_cmd.c:350)
==25326==    by 0x806D6F1: execute_for_command (execute_cmd.c:1658)
==25326==
==25326== Invalid free() / delete / delete[]
==25326==    at 0x40023471: free (in /usr/lib/valgrind/vgskin_memcheck.so)
==25326==    by 0x808E5BF: enable_hostname_completion (bashline.c:319)
==25326==    by 0x808ECC7: initialize_readline (bashline.c:480)
==25326==    by 0x805EB52: yy_readline_get (parse.y:1196)
==25326==    Address 0x412D0094 is 4 bytes inside a block of size 20 free'd
==25326==    at 0x40023471: free (in /usr/lib/valgrind/vgskin_memcheck.so)
==25326==    by 0x8087CB0: without_interrupts (unwind_prot.c:106)
==25326==    by 0x806D4C5: execute_command (execute_cmd.c:350)
==25326==    by 0x806D6F1: execute_for_command (execute_cmd.c:1658)

No error is reported if my patch is applied.

Do you need a file to test or do you still think this is not so important?

George

P.S.: bashbug info
Machine: i686
OS: linux-gnu
Compiler: gcc
Compilation CFLAGS: -DPROGRAM='bash' -DCONF_HOSTTYPE='i686' -DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='i686-pc-linux-gnu' -DCONF_VENDOR='pc' -DLOCALEDIR='/usr/local/share/locale' -DPACKAGE='bash' -DSHELL -DHAVE_CONFIG_H -I. -I. -I./include -I./lib -g -O2 uname output: Linux volans 2.6.5-rock #2 Thu Apr 8 21:01:22 CEST 2004 i686 unknown unknown GNU/Linux
Machine Type: i686-pc-linux-gnu

Bash Version: 3.0
Patch Level: 16
Release Status: release




reply via email to

[Prev in Thread] Current Thread [Next in Thread]