Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: segfault on 'echo $(< /dev/kmsg )' in zsh-5.0.2 and git



Marien Zwart <marien.zwart@xxxxxxxxx> writes:

> So if it's not too hard it'd be nice for zsh to
> survive fdopen failing, although there's something to be said for
> fdopen (glibc) or the fd (linux kernel) being broken for this specific
> crash (on /dev/kmsg).

Interestingly, GNU head fails too:

% head -c1 </dev/kmsg   
head: error reading 'standard input': Invalid argument

strace shows:
read(0, 0x7fffe2ee6d70, 1)              = -1 EINVAL (Invalid argument)

It seems /dev/kmsg only allows to read for at least one line in thefile:

% head -n1 /dev/kmsg | wc -c          
42
% head -c41 </dev/kmsg       
head: error reading 'standard input': Invalid argument
% head -c42 </dev/kmsg 
6,0,0,-;Initializing cgroup subsys cpuset

-- 
Christian Neukirchen  <chneukirchen@xxxxxxxxx>  http://chneukirchen.org



Messages sorted by: Reverse Date, Date, Thread, Author