Unverified Commit 0cf8b8d7 by Enkelmann Committed by GitHub

Repair cross compiling Docker image for acceptance tests (#132)

parent f2048c23
......@@ -16,7 +16,7 @@ jobs:
run: |
cd test/artificial_samples
docker build -t cross_compiling .
docker run --rm -v $(pwd)/build:/home/cwe/artificial_samples/build cross_compiling sudo /home/cwe/.local/bin/scons
docker run --rm -v $(pwd)/build:/home/cwe/artificial_samples/build cross_compiling sudo python3 -m SCons
- uses: actions/setup-java@v1
with:
java-version: "11.0.x"
......
FROM ubuntu:xenial
FROM ubuntu:bionic
RUN apt-get -y update \
&& apt-get install -y sudo \
......@@ -9,11 +9,11 @@ RUN apt-get -y update \
USER cwe
RUN sudo apt-get install python-pip apt-utils -y
RUN sudo apt-get install python3-pip apt-utils -y
RUN pip install --upgrade pip
RUN pip3 install --upgrade pip
RUN pip install scons
RUN sudo pip3 install scons
ENV PATH="/home/cwe/.local/bin/:${PATH}"
......@@ -21,6 +21,4 @@ COPY . /home/cwe/artificial_samples/
WORKDIR /home/cwe/artificial_samples/
RUN ./install_cross_compilers.sh
# RUN sudo /home/cwe/.local/bin/scons
\ No newline at end of file
RUN ./install_cross_compilers.sh
\ No newline at end of file
......@@ -13,6 +13,6 @@ The provided dockerfile should be used for the build process.
Inside this directory run the following commands:
```shell
docker build -t cross_compiling .
docker run --rm -v $(pwd)/build:/home/cwe/artificial_samples/build cross_compiling sudo /home/cwe/.local/bin/scons
docker run --rm -v $(pwd)/build:/home/cwe/artificial_samples/build cross_compiling sudo python3 -m SCons
```
#include <stdio.h>
#include <stdbool.h>
void integer_underflow_subtraction(){
int i;
i = -2147483648;
i = i - 1;
printf("[integer_overflow_subtraction] %d\n", i);
}
int main (void)
{
integer_underflow_subtraction();
}
#include <iostream>
using namespace std;
void throw_exception(int i) {
cout<< " Throwing exception "<< i << endl;
throw i;
}
void do_catch(int i) {
try {
throw i;
}
catch(int error) {
cout<<"Exception " << i << "successfully catched."<<endl;
}
}
void maybe_catch(int i) {
if(i<42) {
try {
throw_exception(i);
}
catch(int errror) {
// Yay, catched.
cout<<"Exception " << i << " successfully catched."<<endl;
}
}
else {
// We don't catch anything here.
throw_exception(i);
}
}
int main() {
cout<<"Enter a number." <<endl;
int i;
cin >> i;
maybe_catch(i);
do_catch(i);
// For good measure, just throw an exception here.
throw (i+20);
}
......@@ -391,6 +391,7 @@ mod tests {
// Only one instance is found.
// Other instance cannot be found, since the constant is not defined in the basic block of the call instruction.
mark_skipped(&mut tests, "aarch64", "clang");
mark_skipped(&mut tests, "arm", "clang");
mark_skipped(&mut tests, "mips", "clang");
mark_skipped(&mut tests, "mipsel", "clang");
......@@ -430,10 +431,10 @@ mod tests {
let mut tests = all_test_cases("cwe_476", "CWE476");
// TODO: Check reason for failure!
mark_skipped(&mut tests, "mips64", "gcc");
mark_skipped(&mut tests, "mips64el", "gcc");
mark_skipped(&mut tests, "mips", "gcc");
mark_skipped(&mut tests, "mipsel", "gcc");
mark_architecture_skipped(&mut tests, "mips64");
mark_architecture_skipped(&mut tests, "mips64el");
mark_architecture_skipped(&mut tests, "mips");
mark_architecture_skipped(&mut tests, "mipsel");
mark_architecture_skipped(&mut tests, "ppc64"); // Ghidra generates mangled function names here for some reason.
mark_architecture_skipped(&mut tests, "ppc64le"); // Ghidra generates mangled function names here for some reason.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment