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!

curl

curl: (35) schannel: next InitializeSecurityContext failed: Unknown error (0x80092012) - The revocation function was unable to check revocation for the certificate.

Add the --ssl-no-revoke flag to the curl command (e.g. if the command was previously curl https://www.google.com, change it to curl --ssl-no-revoke https://www.google.com).

If this is caused by download_tools, the curl command is located inside of tools/download_tools.sh.

curl: (60) SSL certificate problem: self signed certificate in certificate chain

Add the -k flag to the curl command (e.g. if the command was previously curl https://www.google.com, change it to curl -k https://www.google.com).

If this is caused by download_tools, the curl command is located inside of tools/download_tools.sh.

ssh

WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED

At the bottom of the error, it should say Host key for [something] has changed.... If something is github.com or any of the instructional machines, then continue with this guide. Otherwise, please make a private question on Ed.

To fix this error, run ssh-keygen -R [something], and replace [something] with what the error message contained. This generally means that the remote machine has changed its host keys. Please verify that the new host keys are correct if you do not trust the machine (GitHub host keys are available (here)[https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/githubs-ssh-key-fingerprints]).

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: Not possible to fast-forward, aborting

This error means that the branch you're pulling from has some commits you don't have locally, and vice versa. Add the --ff and --no-rebase flags to the command to let git know that you'd like to fast forward or merge if possible, but not rebase.

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.

To delete it on the hive machines:

Option 1: Manually delete:

  1. cd into the folder that contains the file you'd like to delete
  2. Run ls to list all of the files that are in the directory. You'll see a filename with some backslashes (\) and also probably some numbers, surrounded by single quotes
  3. Run git rm filename, where filename is the name of the file from step 2

Option 2: Delete all files with non-printable characters:

  1. cd into the folder that contains the file(s) you'd like to delete
  2. Run ls | LC_CTYPE=C grep '[^[:print:]]' | xargs -d"\n" git rm

Make sure to commit and push before resubmitting to Gradescope!

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
  • free(): double free detected
  • malloc(): invalid size (unsorted)
  • malloc(): corrupted top size
  • malloc(): memory corruption
  • corrupted size vs. prev_size
  • There are others as well, we'll add it to this list as we find them.

undefined reference to 'main'

You are probably trying to compile a file that does not have a function named main into an executable. Try using the commands we have in the spec for compilation.

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 (or vice versa)

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.

The opposite may also happen (fails with valgrind, but passes without valgrind). In this case, there are also probably valgrind errors, so try to fix those first. If there are no valgrind errors, make sure you're running the program correctly and using the correct command.

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.

Logisim-evolution quit unexpectedly

If you are using macOS and have macOS 14.0 through macOS 14.2.1, please add --no-screen-menu-bar to the Logisim command (i.e. java -jar tools/logisim-evolution.jar --no-screen-menu-bar).

If you are not using macOS or are not on one of the above versions, please post on Ed.

Assignments

Project 1

Extra characters in printed board

How does C know when to stop printing a string?

Custom Test 0 Failing

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.

Custom Tests 1-5 Failing

These tests run your custom tests against an incorrect staff implementation. If you're failing these, it probably means that your tests are saying the implementation is correct when it is not.

Custom Tests Error 2

If you see error 2, it probably means that your tests are crashing (and most likely a segmentation fault). Make sure your tests run and pass locally.

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.