bug-bash
[Top][All Lists]
Advanced

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

Re: [Parameter Expansion] bug in ${variable% *}


From: Chet Ramey
Subject: Re: [Parameter Expansion] bug in ${variable% *}
Date: Tue, 12 Feb 2013 11:52:36 -0500
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:17.0) Gecko/20130107 Thunderbird/17.0.2

On 2/12/13 11:37 AM, Andreas Schwab wrote:
> Greg Wooledge <address@hidden> writes:
> 
>> Then you are still doing something wrong.
> 
> No matter how badly the script is written, bash should execute it
> properly, which it doesn't.  Try running it under valgrind in a
> multibyte locale and you will see the error immediately:

There is an error in xdupmbstowcs, but beyond that the output from
valgrind is fairly useless, all the more so because you didn't post
the version (most likely the 4.2 patch level) you're using.  If
you're using patch 42, the line number corresponds to a return of a
value that's always initialized.

In any event, the problem is in a different place, and I've fixed it
for the next version.

Chet


> 
> ==18677== Conditional jump or move depends on uninitialised value(s)
> ==18677==    at 0x4504B6: xdupmbstowcs (xmbsrtowcs.c:240)
> ==18677==    by 0x42A43F: remove_pattern (subst.c:3964)
> ==18677==    by 0x42F3B7: parameter_brace_expand (subst.c:4543)
> ==18677==    by 0x466E48: param_expand (subst.c:7651)
> ==18677==    by 0x467C91: expand_word_internal (subst.c:8139)
> ==18677==    by 0x467F24: expand_word_internal (subst.c:8285)
> ==18677==    by 0x42F981: call_expand_word_internal.constprop.15 
> (subst.c:3197)
> ==18677==    by 0x42FD94: expand_string_assignment (subst.c:3283)
> ==18677==    by 0x466BB3: expand_string_if_necessary (subst.c:3046)
> ==18677==    by 0x47632F: do_assignment_internal (subst.c:2772)
> ==18677==    by 0x469726: expand_word_list_internal (subst.c:2866)
> ==18677==    by 0x45CCB3: execute_simple_command (execute_cmd.c:3776)
> ==18677== 
> 
> Andreas.
> 


-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, ITS, CWRU    address@hidden    http://cnswww.cns.cwru.edu/~chet/



reply via email to

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