Skip to content

Kotlin runtime crashes with TLE when executing trivial code #743

Description

@therepanic

Even when executing the simplest code this happens. Moreover, sometimes it works normally, but then it dies anyway.

My request

{
  "language": "kotlin",
  "version": "1.8.20",
  "files": [
    {
      "content": "fun main() {\n    println(\"OK\")\n}"
    }
  ]
}

Output

{
    "compile": {
        "signal": "SIGKILL",
        "stdout": "",
        "stderr": "",
        "code": null,
        "output": "",
        "memory": 428112000,
        "message": "Time limit exceeded",
        "status": "TO",
        "cpu_time": 10104,
        "wall_time": 4019.9999999999995
    },
    "run": {
        "signal": "SIGKILL",
        "stdout": "",
        "stderr": "",
        "code": null,
        "output": "",
        "memory": 428112000,
        "message": "Time limit exceeded",
        "status": "TO",
        "cpu_time": 10104,
        "wall_time": 4019.9999999999995
    },
    "language": "kotlin",
    "version": "1.8.20"
}

My piston docker-compose file

services:
  piston:
    image: ghcr.io/engineer-man/piston:latest
    container_name: piston
    privileged: true
    entrypoint: ["/bin/sh", "-lc"]
    command:
      - |
        sed -i "s/app.use(body_parser.json());/app.use(body_parser.json({ limit: '50mb' }));/" /piston_api/src/index.js
        exec /piston_api/src/docker-entrypoint.sh
    environment:
      - NODE_OPTIONS=--max-old-space-size=4096
      - PISTON_RUN_TIMEOUT=50000
      - PISTON_RUN_CPU_TIME=50000
      - PISTON_MAX_FILE_SIZE=50000000
      - PISTON_OUTPUT_MAX_SIZE=10485760
      - PISTON_MAX_CONCURRENT_JOBS=200
    ports:
      - "2000:2000"
    volumes:
      - piston_packages:/piston/packages

  piston-installer:
    image: node:20-bullseye
    container_name: piston-installer
    depends_on:
      - piston
    volumes:
      - piston_packages:/piston/packages
    entrypoint: ["/bin/bash", "-lc"]
    command:
      - |
        apt-get update -y >/dev/null
        apt-get install -y --no-install-recommends git ca-certificates curl >/dev/null
        rm -rf /tmp/piston
        git clone --depth 1 https://github.com/engineer-man/piston /tmp/piston >/dev/null
        cd /tmp/piston/cli
        npm ci --silent
        for i in $(seq 1 120); do curl -fsS http://piston:2000/api/v2/runtimes >/dev/null 2>&1 && break; sleep 1; done
        node index.js -u http://piston:2000 ppman install python=3.12.0 java node typescript gcc mono go kotlin swift rust ruby php dart scala elixir erlang racket || true

volumes:
  piston_packages:

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions