Ran into unknown state (hex char: 0) at ./test.pl line 8.
When I run the below program as user_t on a SE Linux system (or as an
unprivileged user on any other access contro system that denies access to
some directories under /proc but doesn't hide them) I get errors like the
above.
#!/usr/bin/perl
use strict;
use Proc::ProcessTable;
my $process_table = new Proc::ProcessTable('cache_ttys' => 0 );
foreach my $process ( @{$process_table->table} )
{
print $process->fname . "\n";
}
Here is the relevant part of strace output:
newfstatat(AT_FDCWD, "/proc/2", 0x7fff19533c10, 0) = -1 EACCES (Permission denied)
openat(AT_FDCWD, "/proc/2/stat", O_RDONLY) = -1 EACCES (Permission denied)
access("/proc/2", F_OK) = 0
write(2, "Ran into unknown state (hex char: 0) at /tmp/test.pl line 8.\n", 61) = 61
The expected operation is that it would put suitable data in the $process
variable so that Perl code can handle the situation in whatever way the
programmer thinks is appropriate.