How to resolve PintOS unrecognized character \x16
Asked Answered
M

2

6

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.

Marthmartha answered 13/8, 2017 at 4:7 Comment(6)
What's the question?Paynter
How can I resolve that error?Marthmartha
Don't execute code that consists of ...($ ^V .... What else do you expect from just an error message?Paynter
The error comes from the pintos script that is provided. I don't know enough about Perl to debug this problem, and I can't find any comments online of people encountering a similar issue.Marthmartha
While I did answer the question below, I still think this question should be closed and deleted because "This question was caused by a problem that can no longer be reproduced or a simple typographical error. While similar questions may be on-topic here, this one was resolved in a manner unlikely to help future readers." ... The problem was caused by the OP using an outdated version of pintOS, and not checking the project's repo to see if the issue had been fixed.Adrial
@SinanÜnür pintOS is a bit special since it's used as an instructional tool by several college courses, and faculty may be using (and compiling student code against) an older version. Your answer is still helpful since students only immediate recourse if they have a newer Perl may be to cherrypick the upstream patch.Inadmissible
K
12

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.

Knacker answered 13/8, 2017 at 11:22 Comment(2)
I am getting error in cloning. fatal: unable to connect to pintos-os.org pintos-os.org[0: 66.246.76.178]: errno=Connection refusedRenita
@Renita looks like an issue with your ISP. My institute's network was causing a similar issue. Using a mobile network solved the problem.Scottscotti
M
-1

^V is a perlvar. For reasons unknown to me, it was encoded not as ^ V, but as a single unicode character, which caused the program to fail.

Marthmartha answered 13/8, 2017 at 5:25 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.