15-213/18-213: Introduction to Computer Systems

    General Programming Issues

  • When I try to run an executable file included in a lab handout, I get a "Permission denied" error. What should I do?

    • The executable bit is not set. You have two options:
      • Reextract the files from the tarball (preferred).
      • Run “chmod +x <filename>” to set the executable bit (risky—the file itself may be corrupted).
    • This problem may occur if you extract the handout tarball on a Windows machine. Always extract the handout on a Linux machine.

  • How do I extract a tarball on a Linux machine?

    • Run “tar -xvf <filename>” to extract it.

  • How do I avoid mixing tabs and spaces in my code?

    • If using vim, add the following to your ~/.vimrc:
      set expandtab
      set tabstop=4
      set shiftwidth=4
      

  • How do I make sure I don't have any non-ASCII characters in my code?

    • Look at your code on autolab -- it will complain if you have non-ASCII characters.
    • Run “file mycode.c” You should expect to see: “ASCII C program text”.

  • My code has non-ASCII characters, how do I find where they are?

    • Try grepping for UTF-8 (common) characters in your code as follows:
      grep --color='auto' -P -n "[\x80-\xFF]" mycode.c
      

  • General Course Issues

  • Why can't I access Autolab?

    • Did you recently join the course? It is possible you do not yet have an account.
    • Otherwise, or if the issue persists, post on Piazza.

  • Why can't I access the shark machines?

    • You should be able to access the shark machines with your Andrew credentials. Post on Piazza if you have trouble.

  • Must I work on the shark machines?

    • Your work will be graded on the shark machines, so it is in your best interest to work there.
    • For most labs, you may alternatively work on the Andrew Unix machines, which are nearly identical.
    • You must complete bomblab and buflab on a shark machine.

  • I have trouble working on the shark machines because I'm uncomfortable using the shell or available editors.

    • Consider attending the Linux Boot Camp at the beginning of the semester.
    • Consult the quick-reference sheets posted on the Resources page.

  • Should I read the lab writeup before seeking help?

    • Yes.
    • Did we say, "Yes"?
    • Yes, we did.
    • Please read the lab writeups.
    • :-)

  • How can I get help?

    • Post questions on Piazza (for assignments and exams).
    • Stop by during office hours.
    • Email the instructors directly (for logistical issues such as personal emergencies).
    • Schedule a 1:1 meeting with your instructors or TAs.

  • Must I attend a particular recitation?

    • You may attend any recitation you wish as long as the instructor leading the recitation allows it.
    • Please make sure the recitation you normally attend is the one specified on your Autolab account; if this is not the case, email the staff list.

  • I am working from a Windows machine. How do I connect to the Shark machines?

    • Use the Cisco VPN client if you are off-campus: Cisco VPN client. There is a known issue with connection stability if you do not use the VPN client: your connection will randomly freeze or drop.
    • Use the CMU recommended Windows SSH/SFTP client: Tectia SSH/SFTP . If you need a lightweight SSH client you can use PuTTY instead: PuTTY
    • Avoid X-Windows (X-Term, XEmacs etc.) and the WIndows AFS client if you do not have experience with them. Instead open multiple Tectia SSH/SCP windows and use text-based editors on the Shark machine (emacs, vim or nano).
    • There are other nice tools like a Windows AFS client (OpenAFS), X-Windows support (X-Win 32) and the Linux-on-Windows port (cygwin. They are powerful tools in the hands of experts but often very painful to set up and can be the source of a lot of frustration and painful data loss when not used well. If you have no experience with them, leave the finger from them.

  • I have some command line output that I'd like to send to the staff. Should I send it as a screenshot?

    • No. Text (copy and paste) is fine.

  • My editor shows me that my C code looks fine, but when my TA prints it out it looks different!

    • Your editor is configured to use tabs as a certain width. Please use spaces instead of tabs.
    • To see what we'll see when we grade your submissions: run
      a2ps -s2  --pretty-print --landscape --columns=2 --rows=1 --tabsize=4 --chars-per-line=80 somefile.c -o someotherfile.ps
    • To replace all tabs with spaces, run
      expand -t4 file > otherfile 

  • I get an error message of ‘Disk quota exceeded’. What does this mean and how can I fix it?

    • Each student has 2 GB of space in their AFS volume. This volume is shared between the Shark machines, the Andrew Unix machines, and the Andrew Mac machines. The "disk quota exceeded" error message occurs when you are at capacity. It may cause errors when trying to log in from a cluster computer.
    • To resolve this, you need to delete some files. However, be careful: it is not possible to recover deleted files.
    • Things that can be safely deleted:
      • The ~/.cache and ~/.ccache directories should always be safe to delete.
      • The ~/.mozilla and ~/.config/chromium directories can be deleted if you don't care about any data stored in Firefox or Chromium (e.g. cookies) when you log in on cluster machines. The same aplies to other directories in ~/.config.
      • The ~/Library and ~/Applications directories can be deleted if you don't care about any data stored on Andrew Mac machines.
    • However, you should also look at additional files that may be taking up that space, most likely in ~/Downloads or ~/private. Some commands that could help:
      • ls -sSAph shows how much space each file in the current directory is using, but doesn't account for files in subdirectories.
      • du -hd 1 lists how much space the files in each subdirectory are taking (recursively).
      • du -hd 1 | sort -rh | head -n 20 shows the top 20 subdirectories, but takes a while.
      • To remove a directory, use rm -rf (carefully!) For example, rm -rf ~/.cache.

  • I accidentally deleted my data! What do I do?

    • First of all, it is not possible to guarantee that the data can be restored. You should always make sure that you are regularly committing your code and pushing it to Git to ensure that it is saved in an external location.
    • However, your AFS volume should be backed up on a daily basis, so you may be able to recover files from the previous day.
      • If you have a ~/OldFiles directory, this is where your backed-up files should be stored.
      • Otherwise, run fs mkm ~/OldFiles user.$USER.backup to create it.