Re: kprobe/kprobe_syntax_errors.tc faild on dash due to sh I/O error

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

 



Hi Liu,

On Wed, 29 Apr 2020 15:13:20 +0800
Liu Yiding <yidingx.liu@xxxxxxxxx> wrote:

> Hi, all.
> 
> 
> I met a funny error when i run kprobe_syntax_errors
> 
> ```
> 
> root@vm-snb-35 
> /usr/src/linux-selftests-x86_64-rhel-7.6-kselftests-ae83d0b416db002fe95601e7f97f64b59514d936/tools/testing/selftests/ftrace# 
> ./ftracetest -vvv test.d/kprobe/kprobe_syntax_errors.tc [snip] + expr 13 
> + 0 + test 13 -eq 13 + echo p:kprobes/testevent _do_fork abcd=\1 sh: 
> echo: I/O error
> 
> ```
> 
> This error only happend on dash, use bash run this test is ok.
> 
> backslash ('\1') will be transferred into empty in dash.

Oops, good catch! I found that came from the built-in echo command
behavior.
Bash's echo doesn't interpret the backslash escape, but dash's
POSIX-compliant echo does.

----<dash>----
$ a='\1'
$ b=`echo $a`
$ test "$a" = "$b" && echo "same!" || echo "different"
different

----<bash>----
$ a='\1'
$ b=`echo $a`
$ test "$a" = "$b" && echo "same!" || echo "different"
same!

OK, I'll fix it.

Thank you!

-- 
Masami Hiramatsu <mhiramat@xxxxxxxxxx>



[Index of Archives]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux