Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

:) #1

Merged
merged 1 commit into from

2 participants

@jtolds
  • now matches versions for ubuntu 11.10
  • upgraded support for nodejs, racket, and java (now on the jvm)
  • adding support for go
@jtolds jtolds updating instructions, language support
 * now matches versions for ubuntu 11.10
 * upgraded support for nodejs, racket, and java (now on the jvm)
 * adding support for go
52ce035
@ccutrer
Owner

Have you signed a CLA yet?

@ccutrer ccutrer merged commit b5e3e8a into from
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Mar 21, 2012
  1. @jtolds

    updating instructions, language support

    jtolds authored
     * now matches versions for ubuntu 11.10
     * upgraded support for nodejs, racket, and java (now on the jvm)
     * adding support for go
This page is out of date. Refresh to see the latest.
View
10 README.md
@@ -48,10 +48,14 @@ Dependencies
-----
You will need to install all of the appropriate files for each language you want
-to run. On Ubuntu 11.04, suggested packages include but are not limited to:
+to run. On Ubuntu 11.10, suggested packages include but are not limited to:
-gcc, mono-gmcs, g++, guile-1.8, ghc, gcj, nodejs, lua5.1, ocaml, php5, python,
-ruby, ruby1.9.1, scala, plt-scheme
+gcc, mono-gmcs, g++, guile-1.8, ghc, lua5.1, ocaml, php5, python, ruby,
+ruby1.9, scala, racket, golang, openjdk-6-jdk
+
+You'll probably want to get nodejs and DMD from elsewhere.
+http://dlang.org/download.html
+https://github.com/joyent/node/wiki/Installing-Node.js-via-package-manager
Dependencies include:
View
58 config/lang-go.conf
@@ -0,0 +1,58 @@
+[general]
+name = Go
+execution_profile = CompilerProfile
+binary = golang-g
+version_switch = -V
+compilation_command = lambda source_file, output_file: ["bash", "-c",
+ "golang-g -o %%(output_file)s.o %%(source_file)s && "
+ "golang-l -o %%(output_file)s %%(output_file)s.o" %% {
+ "output_file": output_file, "source_file": source_file}]
+filename = source.go
+apparmor_profile = straitjacket/compiler/go
+
+[test-simple]
+source = package main
+ import fmt "fmt"
+ func main() {
+ fmt.Printf("Hello from Go\n")
+ }
+stdout = \AHello from Go\n\Z
+stderr = \A\Z
+exitstatus = 0
+error =
+
+[test-rlimit]
+source = package main
+ func main() {
+ data := new([107374182]int)
+ data[1] = 2
+ }
+stdout = \A\Z
+stderr = out of memory
+exitstatus = 3
+error = runtime_error
+
+[test-apparmor]
+source = package main
+ import (
+ "os"
+ "fmt"
+ )
+ func main() {
+ file, err := os.Open("/etc/hosts")
+ if err != nil {
+ fmt.Printf("error: %%s", err)
+ return
+ }
+ bytes := make([]byte, 4096)
+ size, err := file.Read(bytes)
+ if err != nil {
+ fmt.Printf("error: %%s", err)
+ }
+ fmt.Printf("read: %%s", bytes[:size])
+ file.Close()
+ }
+stdout = \Aerror: open /etc/hosts: permission denied\Z
+stderr = \A\Z
+exitstatus = 0
+error =
View
25 config/lang-java.conf
@@ -1,11 +1,15 @@
[general]
name = Java
-execution_profile = CompilerProfile
-apparmor_profile = straitjacket/compiler/gcj
-binary = gcj
-compilation_command = lambda source, object: ["gcj", "--main=Main", "-o",
- object, source]
+version_switch = -version
+execution_profile = VMProfile
+binary = javac
+compilation_command = lambda source: ["env",
+ "JAVA_TOOL_OPTIONS=-Xmx128m -Xms128m -Xss128k", "javac", "Main.java"]
+vm_command = lambda source: ["java", "-Xmx128m", "-Xms128m", "-Xss128k",
+ "Main"]
filename = Main.java
+compiler_apparmor_profile = straitjacket/compiler/java
+vm_apparmor_profile = straitjacket/compiled/java
[test-simple]
source = public class Main {
@@ -42,17 +46,12 @@ exitstatus = 0
error =
[test-rlimit]
-source = import java.lang.*;
- public class Main extends Thread {
- public void run() {
- System.out.println("hello from the thread");
- }
+source = public class Main {
public static void main(String[] args) {
- Main thread = new Main();
- thread.start();
+ int[] data = new int[1073741824];
}
}
stdout = \A\Z
-stderr = \AException in thread "main" java.lang.OutOfMemoryError: Cannot create additional threads
+stderr = \AException in thread "main" java.lang.OutOfMemoryError
exitstatus = 1
error = runtime_error
View
6 config/lang-javascript.conf
@@ -20,7 +20,7 @@ source = var fs = require('fs');
console.log(data.toString());
});
stdout = \A\Z
-stderr = Error: EACCES, Permission denied '/etc/hosts'
+stderr = Error: EACCES, open '/etc/hosts'
exitstatus = 1
error = runtime_error
@@ -30,6 +30,6 @@ source = var buffer1 = new Buffer(536870912);
var buffer3 = new Buffer(536870912);
console.log(buffer1.length + buffer2.length + buffer3.length);
stdout = \A\Z
-stderr = \A\Z
-exitstatus = -11
+stderr = terminate called after throwing an instance of 'std::bad_alloc'
+exitstatus = -6
error = runtime_error
View
12 config/lang-scheme.conf
@@ -1,10 +1,10 @@
[general]
-name = Scheme
+name = Scheme-R5RS
execution_profile = InterpreterProfile
-binary = mzscheme
-interpretation_command = lambda source: ["mzscheme", "-N", "plt-r5rs", "-l-",
- "r5rs/run.ss", source]
+binary = racket
+interpretation_command = lambda source: ["plt-r5rs", source]
filename = source.scm
+apparmor_profile = straitjacket/interpreter/racket
[test-simple]
source = (display "hi from scheme")
@@ -28,6 +28,6 @@ error = runtime_error
[test-rlimit]
source = (begin (display (make-string 1073741824)) (newline))
stdout = \A\Z
-stderr = \APLT Scheme virtual machine has run out of memory; aborting\n\Z
-exitstatus = -6
+stderr = out of memory
+exitstatus = 1
error = runtime_error
View
3  files/etc/apparmor.d/abstractions/straitjacket-jvm
@@ -1,9 +1,10 @@
set rlimit fsize <= 32M,
set rlimit nproc <= 500,
- set rlimit as <= 1G,
+ set rlimit as <= 768M,
# 1 greater than max
set rlimit nofile <= 501,
/usr/lib/jvm/*/jre/bin/* rix,
+ /usr/share/java*/**/*.jar r,
/usr/share/java*/*.jar r,
View
9 files/etc/apparmor.d/straitjacket.compiled.java
@@ -0,0 +1,9 @@
+#include <tunables/global>
+
+profile straitjacket/compiled/java {
+ #include <abstractions/base>
+ #include <abstractions/straitjacket-base>
+ #include <abstractions/straitjacket-jvm>
+
+ /var/local/straitjacket/tmp/source/?*/?* r,
+}
View
19 files/etc/apparmor.d/straitjacket.compiler.gcj
@@ -1,19 +0,0 @@
-#include <tunables/global>
-
-profile straitjacket/compiler/gcj {
- #include <abstractions/base>
- #include <abstractions/straitjacket-base>
- #include <abstractions/straitjacket-gcc>
-
-# larger for DLLs
- set rlimit as <= 1G,
-
- /usr/share/java/** r,
- /usr/lib**/gcc/**/ecj1 rix,
- /usr/lib**/gcc/**/jc1 rix,
- /usr/lib**/gcc/**/jvgenmain rix,
-
- /var/local/straitjacket/tmp/source/?*/Main.java r,
- /var/local/straitjacket/tmp/compiler/** rw,
-
-}
View
15 files/etc/apparmor.d/straitjacket.compiler.go
@@ -0,0 +1,15 @@
+#include <tunables/global>
+
+profile straitjacket/compiler/go {
+ #include <abstractions/base>
+ #include <abstractions/straitjacket-base>
+ #include <abstractions/straitjacket-gcc>
+
+ /var/local/straitjacket/tmp/source/?*/?* r,
+ /var/local/straitjacket/tmp/compiler/?* rw,
+
+ /usr/bin/golang-g rix,
+ /usr/bin/golang-l rix,
+ /usr/bin/6g rix,
+ /usr/bin/6l rix,
+}
View
11 files/etc/apparmor.d/straitjacket.compiler.java
@@ -0,0 +1,11 @@
+#include <tunables/global>
+
+profile straitjacket/compiler/java {
+ #include <abstractions/base>
+ #include <abstractions/straitjacket-base>
+ #include <abstractions/straitjacket-jvm>
+
+ /etc/java-6-openjdk/jvm.cfg r,
+ /usr/lib/jvm/*/bin/javac rix,
+ /var/local/straitjacket/tmp/source/?*/?* rw,
+}
View
13 files/etc/apparmor.d/straitjacket.interpreter.racket
@@ -0,0 +1,13 @@
+#include <tunables/global>
+
+profile straitjacket/interpreter/racket {
+ #include <abstractions/base>
+ #include <abstractions/straitjacket-base>
+
+ set rlimit nproc <= 6,
+
+ /usr/bin/plt-r5rs r,
+ /usr/bin/racket rix,
+ /usr/share/racket/** r,
+ /var/local/straitjacket/tmp/source/?*/?* r,
+}
View
3  files/etc/apparmor.d/straitjacket.interpreter.ruby1.9
@@ -5,7 +5,8 @@ profile straitjacket/interpreter/ruby1.9 {
#include <abstractions/ruby>
#include <abstractions/straitjacket-base>
- set rlimit nproc <= 300, # what the heck ruby
+# what the heck ruby
+ set rlimit nproc <= 300,
/var/local/straitjacket/tmp/source/?*/?* r,
}
Something went wrong with that request. Please try again.