Common Errors

This page contains a compiled list of common errors we've seen in past semesters along with possible explanations and solutions. We understand this page is long, but please use it throughout the course before asking on Ed!

git and Starter Code

fatal: Need to specify how to reconcile divergent branches

This error means that the branch you're pulling from has some commits you don't have locally, and vice versa. Add the --ff flag to the command to let git know how you would like git to merge these branches.

fatal: 'starter' does not appear to be a git repository

Make sure you've completed the setup section for the assignment you're completing and added the starter repo as a remote. For labs, refer to lab 0.

Restoring starter code

Run git checkout starter/main path_to_file, where path_to_file, is the file you'd like to reset to the original starter code.

error: pathspec 'starter/main' did not match any file(s) known to git

You probably haven't pulled from the starter repo before, so git doesn't know about it. Run git fetch starter to fetch information about starter files.

Gradescope

Stuck on Your repository is being downloaded from Github...

There are probably files with unprintable filenames in your repo, which Gradescope doesn't like. Try deleting it using either your command line or on GitHub. If you're unable to delete these files, please make a private question on Ed.

C

Memory errors

If you see any of the following errors, it probably means that you have an error related to accessing memory. We recommend running valgrind to pinpoint where the error is.

  • Segmentation fault (core dumped)
  • double free or corruption
  • malloc(): memory corruption
  • corrupted size vs. prev_size
  • There are others as well, we'll add it to this list as we find them.

cgdb

[some file name].c: No such file or directory

You're most likely stepping into a C library function (such as strlen, strcpy, strcat, printf, fopen, etc). We don't have the source code for these files, so cgdb complains that it can't find the source code. Instead, you should step over calls to library functions instead of stepping into them.

valgrind

Fails without valgrind, but passes with valgrind

When you run a program with valgrind, it adds protection for memory accesses to prevent and catch invalid memory reads and writes. Because of the extra protection, your program may pass the test cases when running with valgrind. However, this doesn't mean your program doesn't have any invalid memory accesses. Try to fix any errors that valgrind itself throws.

Venus

Unable to access jarfile tools/venus.jar

Sometimes, the Venus (and Logisim) jar files get corrupted. Run the following commands:

rm -f tools/*.jar
bash tools/download_tools.sh

mount: IllegalStateException: Failed to send the request! Is the mount server still running?

Make sure your local Venus server is running (the java -jar tools/venus.jar . -dm command). When copying the command for mounting from your terminal, try using right click instead of Ctrl + C, since the latter might quit your local server.

Exited with error code 0

Error code 0 means your program exited without any errors, so this is normal.

label exit used but not defined

The exit label is defined in utils.s, and it is imported only in the test files. Make sure you're running the test files through Venus/VDB, not the files you're editing. Please don't recompile after starting VDB from the "Files" tab, this will overwrite the file you just loaded into the debugger.

java.lang.RuntimeException: Port already in use.

Venus sometimes doesn't close/exit correctly, causing it to still use port 6161. Try adding --port=6162 to your existing command. If this still doesn't work, try incrementing 6162 by 1 a couple of times.

Object with the same name exists in this folder

You're probably running into this error while running mount [something]. Try unmounting the directory first with umount [name of the directory you're mounting to]. For example, if you wanted to run mount local my_project, you would run umount my_project.

Logisim

Circuit is not fully connected in harness

There are two potential reasons for this:

  1. You've added pins to the circuit. If this is a circuit we've provided in the starter code, please do not add, remove, or move any pins.
  2. Try setting "Use fixed box-size" to "Yes". You can change this setting by clicking on the name of the circuit in the left sidebar, then it should be an option under the properties tab.

Assignments

Project 1

Extra characters in printed board

How does C know when to stop printing a string?

Custom Test 0

This test runs your custom tests against a correct staff implementation. The most common error for this test case is that your test cases are testing undefined behavior. Refer to the spec to see which inputs may cause undefined behavior.

Project 2

test-src doesn't exist

This folder is created by any of the bash test.sh test commands (such as bash test.sh test_abs). Try running one of these commands for the task you're on and this folder should be created.