Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to resolve PintOS unrecognized character \x16

Tags:

perl

pintos

I downloaded and set up PintOS and the dependencies on my home computer, but when I try to run pintos run alarm-multiple, I get the error:

Unrecognized character \x16; marked by <-- HERE after if ($<-- HERE near column 7 at ~/code/pintos/src/utils/pintos line 911.

That line has ^V on it, the synchronous idle control character. I haven't been able to find any information on this problem; it seems like I'm the only one experiencing it.

I have Perl v5.26.0 installed.

like image 438
Brandon Olivier Avatar asked Aug 13 '17 04:08

Brandon Olivier


1 Answers

Use of literal control characters in variable names was deprecated in Perl 5.20:

Literal control characters in variable names

This deprecation affects things like $\cT, where \cT is a literal control (such as a NAK or NEGATIVE ACKNOWLEDGE character) in the source code. Surprisingly, it appears that originally this was intended as the canonical way of accessing variables like $^T, with the caret form only being added as an alternative.

The literal control form is being deprecated for two main reasons. It has what are likely unfixable bugs, such as $\cI not working as an alias for $^I, and their usage not being portable to non-ASCII platforms: While $^T will work everywhere, \cT is whitespace in EBCDIC. [perl #119123]

The code causing this problem was fixed in PintOS with this commit in 2016:

committer Ben Pfaff <[email protected]> 
Tue, 9 Feb 2016 04:47:10 +0000 (20:47 -0800)

Modern versions of Perl prefer a caret in variable names over literal
control characters and issue a warning if the control character is used.
This fixes the warning.

diff --git a/src/utils/pintos b/src/utils/pintos
index 1564216..2ebe642 100755 (executable)
--- a/src/utils/pintos
+++ b/src/utils/pintos
@@ -912,7 +912,7 @@ sub get_load_average {
 # Calls setitimer to set a timeout, then execs what was passed to us.
 sub exec_setitimer {
     if (defined $timeout) {
-       if ($\16 ge 5.8.0) {
+       if ($^V ge 5.8.0) {
            eval "
               use Time::HiRes qw(setitimer ITIMER_VIRTUAL);
               setitimer (ITIMER_VIRTUAL, $timeout, 0);

Perl 5.26 made it a fatal error to use literal control characters in variable names.

The way you fix it is by ensuring that you are using the most recent version of pintOS. The command git clone git://pintos-os.org/pintos-anon ought to do it.

like image 151
Sinan Ünür Avatar answered Sep 20 '22 12:09

Sinan Ünür