bug-bash
[Top][All Lists]
Advanced

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

segfault w/bash-4.4-beta2 and assigning empty $*


From: Mike Frysinger
Subject: segfault w/bash-4.4-beta2 and assigning empty $*
Date: Thu, 11 Aug 2016 20:29:14 +0800

simple code to reproduce:
        bash -c 'v=$*'

gdb backtrace:
Program received signal SIGSEGV, Segmentation fault.
quote_string (string=0x0) at subst.c:3940
3940      if (*string == 0)
#0  quote_string (string=0x0) at subst.c:3940
#1  0x000000000045c052 in param_expand (string=string@entry=0x7237c0 "$*", 
sindex=sindex@entry=0x7fffffffc43c, quoted=quoted@entry=0x0, 
expanded_something=expanded_something@entry=0x0, 
contains_dollar_at=contains_dollar_at@entry=0x7fffffffc448, 
quoted_dollar_at_p=quoted_dollar_at_p@entry=0x7fffffffc440, 
had_quoted_null_p=0x7fffffffc444, pflags=0x8) at subst.c:8570
#2  0x000000000045ca34 in expand_word_internal (word=word@entry=0x7fffffffc4e0, 
quoted=quoted@entry=0x0, isexp=isexp@entry=0x0, 
contains_dollar_at=contains_dollar_at@entry=0x0, 
expanded_something=expanded_something@entry=0x0) at subst.c:9194
#3  0x000000000045e3ac in call_expand_word_internal (w=w@entry=0x7fffffffc4e0, 
q=q@entry=0x0, i=i@entry=0x0, c=c@entry=0x0, e=0x0) at subst.c:3555
#4  0x000000000045e50a in expand_string_assignment 
(string=string@entry=0x7237a2 "$*", quoted=quoted@entry=0x0) at subst.c:3643
#5  0x00000000004577de in expand_string_if_necessary 
(string=string@entry=0x7237a2 "$*", quoted=quoted@entry=0x0, 
func=func@entry=0x45e4a0 <expand_string_assignment>) at subst.c:3345
#6  0x0000000000457c8f in do_assignment_internal (word=0x723740, 
expand=expand@entry=0x1) at subst.c:3073
#7  0x0000000000460265 in do_word_assignment (flags=0x0, word=<optimized out>) 
at subst.c:3162
#8  expand_word_list_internal (list=<optimized out>, eflags=eflags@entry=0x1f) 
at subst.c:10543
#9  0x000000000046056a in expand_words (list=<optimized out>) at subst.c:10098
#10 0x00000000004381cf in execute_simple_command (simple_command=<optimized 
out>, pipe_in=<optimized out>, pipe_in@entry=0xffffffff, 
pipe_out=pipe_out@entry=0xffffffff, async=async@entry=0x0, 
fds_to_close=fds_to_close@entry=0x7235f0) at execute_cmd.c:4132
#11 0x000000000043a24a in execute_command_internal (command=0x723580, 
asynchronous=asynchronous@entry=0x0, pipe_in=pipe_in@entry=0xffffffff, 
pipe_out=pipe_out@entry=0xffffffff, fds_to_close=fds_to_close@entry=0x7235f0) 
at execute_cmd.c:802
#12 0x000000000048190f in parse_and_execute (string=<optimized out>, 
from_file=from_file@entry=0x4c1d69 "-c", flags=flags@entry=0x4) at 
evalstring.c:424
#13 0x000000000041f60e in run_one_command (command=<optimized out>) at 
shell.c:1399
#14 0x000000000042111f in main (argc=0x3, argv=0x7fffffffcbc8, 
env=0x7fffffffcbe8) at shell.c:724
-mike

Attachment: signature.asc
Description: Digital signature


reply via email to

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