{"record":{"id":"45e5ea6ea58bda5e","repo":"huggingface/open-r1","slug":"language-response-language-version-response","errorCode":null,"errorMessage":"language={response['language']}, version={response['version']}, exit code={response['run']['code']}, stderr={response['run']['stderr']}, signal={response['run']['signal']}","messagePattern":"language=(.+?), version=(.+?), exit code=(.+?), stderr=(.+?), signal=(.+?)","errorType":"exception","errorClass":"PistonError","httpStatus":null,"severity":"error","filePath":"src/open_r1/utils/competitive_programming/ioi_scoring.py","lineNumber":332,"sourceCode":"            \"stderr\"\n        ]\n\n    if \"run\" not in response:\n        raise PistonError(response)\n\n    if response[\"run\"][\"code\"] == 1 and \"MemoryError\" in response[\"run\"][\"stderr\"]:\n        return \"0\", \"Memory limit exceeded\"\n\n    # successful result\n    if response[\"run\"][\"stdout\"]:\n        return response[\"run\"][\"stdout\"], response[\"run\"][\"stderr\"]\n\n    if response[\"run\"][\"signal\"] == \"SIGKILL\":\n        return \"0\", \"Time limit exceeded\"\n\n    # other issues\n    if response[\"run\"][\"code\"] != 0:\n        raise PistonError(\n            f\"language={response['language']}, version={response['version']}, exit code={response['run']['code']}, stderr={response['run']['stderr']}, signal={response['run']['signal']}\"\n        )\n    return \"0\", \"Unknown error\"\n","sourceCodeStart":314,"sourceCodeEnd":336,"githubUrl":"https://github.com/huggingface/open-r1/blob/1416fa0cf21595d2083b399a2a0bbddd7f6e9563/src/open_r1/utils/competitive_programming/ioi_scoring.py#L314-L336","documentation":"When the submission's run finishes with a non-zero exit code that isn't a recognized timeout (SIGKILL) or memory-error pattern, execute_ioi raises PistonError embedding language, version, exit code, stderr, and signal. This means the program crashed or exited with an error status outside the handled special cases.","triggerScenarios":"response['run']['code'] != 0 while signal != 'SIGKILL' and stderr does not contain 'MemoryError' — e.g. the compiled program aborted, threw an unhandled exception at startup, or a checker/grader wrapper failed.","commonSituations":"Solution crashes on reading malformed input format; missing runtime libraries on the Piston worker so the binary fails to start; exit code conventions of a custom wrapper differing from expected; stack overflow / assertion aborts not caught by the MLE/TLE heuristics.","solutions":["Read stderr and the exit code in the message — they identify the actual runtime failure (missing .so, Python traceback, segfault signal, etc.).","Fix the submitted solution so it exits 0; IOI scoring expects the program to run to completion on each test case.","Verify the worker image includes all libraries/toolchain the solution needs (matching the IOI package spec).","If crash is input-dependent, reproduce locally with the failing test and add robustness (e.g. bounds checks, correct I/O parsing)."],"exampleFix":"// before: solution crashing on empty input\nlines = open('input.txt').readlines(); n, m = map(int, lines[0].split())\n// after: guard against malformed input\nlines = open('input.txt').read().split(); n, m = (int(lines[0]), int(lines[1])) if len(lines) >= 2 else (0, 0)","handlingStrategy":"try-catch","validationCode":"# no reliable pre-call check; validate the solution compiles and exits 0 on sample tests locally before submission\nsubprocess.run(['./compile'], cwd='workspace', check=True)","typeGuard":"def crashed_unexpectedly(run: dict) -> bool:\n    return run.get('code', 0) != 0 and run.get('signal') != 'SIGKILL' and 'MemoryError' not in (run.get('stderr') or '')","tryCatchPattern":"try:\n    score, feedback = await execute_ioi(client, data)\nexcept PistonError as e:\n    m = re.search(r'exit code=(\\d+), stderr=(.*), signal=(\\S+)', str(e))\n    logger.error('Submission crashed: exit=%s signal=%s stderr=%s', *(m.groups() if m else ('?', '?', e)))\n    score, feedback = '0', 'Runtime error'","preventionTips":["Test submissions locally with the same compiler/toolchain as the sandbox","Handle edge-case inputs (empty files, missing values) in generated solutions","Keep worker images aligned with the IOI package's library requirements"],"tags":["piston","runtime-crash","nonzero-exit"],"backgroundTag":"nonzero-exit-code","analyzedSha":"1416fa0cf21595d2083b399a2a0bbddd7f6e9563","analyzedAt":"2026-08-30T08:56:53.400Z","schemaVersion":2},"datasetVersion":"2026-08-30T13:17:10.514Z"}