ucrcsedept / galah

An automated grading system geared towards processing computer programming assignments.
Apache License 2.0
42 stars 8 forks source link

Unittest module segfaults when asked to run main. #410

Open itsjohncs opened 10 years ago

itsjohncs commented 10 years ago
#include <iostream>

using namespace std;

// main.cpp
int main() {
    return 0;
}
import interact.unittest
interact.unittest.load_files(["main.cpp"])["main"]["main"]

This will cause a segfault in the Python process. Obviously not alright.

Since running the main function like this really shouldn't be done (just run the program after all), I think a large warning in the docs will be sufficient here, though I would like to fix this anyways.