# New Ticket Created by  Nicholas Clark 
# Please include the string:  [perl #128831]
# in the subject line of all future correspondence about this issue. 
# <URL: https://rt.perl.org/Ticket/Display.html?id=128831 >


$ ./perl6-m -Ilib t/spec/S16-io/eof.t  
1..2
ok 1 - Regular file EOF was reached
Use of Nil in string context  in block  at t/spec/S16-io/eof.t line 26
Failed to open "/proc/1/comm": 
  in block  at t/spec/S16-io/eof.t line 26
  in block <unit> at t/spec/S16-io/eof.t line 24

# Looks like you planned 2 tests, but ran 1


It's assuming both that process 1 exists, and that /proc/1 for it contains a 
file comm.

(I *think* that the assumption about process 1 is bad. Certainly on Solaris 
with Zones, the init process may not have pid 1. Perl 5 had a failing 
regression test until we removed the assumption that process 1 exists. I don't 
know if every Linux virtualisation system ensures that PID 1 exists. It would 
be safer to test the /proc entry for the current process ID)

On this CentOS system there is a process 1, and its directory in /proc but it 
doesn't have a comm:

$ ls /proc/1/                                      
ls: cannot read symbolic link /proc/1/cwd: Permission denied
ls: cannot read symbolic link /proc/1/root: Permission denied
ls: cannot read symbolic link /proc/1/exe: Permission denied
attr             cpuset   limits      net            root       statm
autogroup        cwd      loginuid    numa_maps      sched      status
auxv             environ  maps        oom_adj        schedstat  syscall
cgroup           exe      mem         oom_score      sessionid  task
clear_refs       fd       mountinfo   oom_score_adj  smaps      wchan
cmdline          fdinfo   mounts      pagemap        stack
coredump_filter  io       mountstats  personality    stat


I don't know what file would be safer. Maybe mem?

Nicholas Clark

Reply via email to