Skip to content

Commit

Permalink
Add Exec Format Error status. Force Go to create main file and make i…
Browse files Browse the repository at this point in the history
…t executable.
  • Loading branch information
hermanzdosilovic committed Sep 15, 2019
1 parent a2bcdec commit 93a6011
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@ RUN RAILS_ENV=production bundle && \
CMD ["./scripts/run-server"]

LABEL maintainer="Herman Zvonimir Došilović, [email protected]"
LABEL version="1.3.0"
LABEL version="1.3.1"
3 changes: 2 additions & 1 deletion app/enumerations/status.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ class Status < Enumerations::Base
sigabrt: { id: 10, name: 'Runtime Error (SIGABRT)' },
nzec: { id: 11, name: 'Runtime Error (NZEC)' },
other: { id: 12, name: 'Runtime Error (Other)' },
boxerr: { id: 13, name: 'Internal Error' }
boxerr: { id: 13, name: 'Internal Error' },
exeerr: { id: 14, name: 'Exec Format Error' }

def self.find_runtime_error_by_status_code(status_code)
case status_code.to_i
Expand Down
4 changes: 4 additions & 0 deletions app/jobs/isolate_job.rb
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,10 @@ def verify
submission.exit_signal = parsed_meta[:exitsig].try(:to_i)
submission.message = parsed_meta[:message]
submission.status = determine_status

if submission.status == Status.boxerr && submission.message.to_s.match(/^execve\(.+\): Exec format error$/)
submission.status = Status.exeerr
end
end

def clean
Expand Down
2 changes: 1 addition & 1 deletion db/seeds.rb
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@
{
name: "Go (1.9)",
source_file: "main.go",
compile_cmd: "/usr/local/go-1.9/bin/go build main.go",
compile_cmd: "/usr/local/go-1.9/bin/go build -o main main.go && chmod +x main",
run_cmd: "./main"
},

Expand Down
2 changes: 1 addition & 1 deletion docs/api/docs.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Source code is available on [GitHub](https://github.com/judge0/api).
Dummy client is available [here](/dummy-client.html) and can be used to try and test features of Judge0 API.

# Version
This document describes Judge0 API version [`v1.3.0`](https://github.com/judge0/api/tree/v1.3.0).
This document describes Judge0 API version [`v1.3.1`](https://github.com/judge0/api/tree/v1.3.1).

# Date and time formats
[ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) standard is used.
Expand Down
6 changes: 5 additions & 1 deletion docs/api/statuses_and_languages/list_all_statuses.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,5 +53,9 @@
{
"id": 13,
"description": "Internal Error"
},
{
"id": 14,
"description": "Exec Format Error"
}
]
]
6 changes: 5 additions & 1 deletion public/docs.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ <h1 id="header-about">About <a class="permalink" href="#header-about" aria-hidde
Source code is available on <a href="https://github.com/judge0/api">GitHub</a>.</p>
<p>Dummy client is available <a href="/dummy-client.html">here</a> and can be used to try and test features of Judge0 API.</p>
<h1 id="header-version">Version <a class="permalink" href="#header-version" aria-hidden="true"></a></h1>
<p>This document describes Judge0 API version <a href="https://github.com/judge0/api/tree/v1.3.0"><code>v1.3.0</code></a>.</p>
<p>This document describes Judge0 API version <a href="https://github.com/judge0/api/tree/v1.3.1"><code>v1.3.1</code></a>.</p>
<h1 id="header-date-and-time-formats">Date and time formats <a class="permalink" href="#header-date-and-time-formats" aria-hidden="true"></a></h1>
<p><a href="https://en.wikipedia.org/wiki/ISO_8601">ISO 8601</a> standard is used.</p>
<p>Example: <code>2016-09-11T10:19:35Z</code></p>
Expand Down Expand Up @@ -738,6 +738,10 @@ <h4>Example URI</h4><div class="definition"><span class="method get">GET</span>&
{
"<span class="hljs-attribute">id</span>": <span class="hljs-value"><span class="hljs-number">13</span></span>,
"<span class="hljs-attribute">description</span>": <span class="hljs-value"><span class="hljs-string">"Internal Error"</span>
</span>},
{
"<span class="hljs-attribute">id</span>": <span class="hljs-value"><span class="hljs-number">14</span></span>,
"<span class="hljs-attribute">description</span>": <span class="hljs-value"><span class="hljs-string">"Exec Format Error"</span>
</span>}
]</code></pre><div style="height: 1px;"></div></div></div></div></div></section><section id="system-and-configuration" class="resource-group"><h2 class="group-heading">System and Configuration <a href="#system-and-configuration" class="permalink">&para;</a></h2><div id="system-and-configuration-system-info" class="resource"><h3 class="resource-heading">System Info <a href="#system-and-configuration-system-info" class="permalink">&nbsp;&para;</a></h3><div id="system-and-configuration-system-info-get" class="action get"><h4 class="action-heading"><div class="name">System Info</div><a href="#system-and-configuration-system-info-get" class="method get">GET</a><code class="uri">/system_info</code></h4><p>System information gives you detailed information about system on which Judge0 API is running.</p>
<p>This information is result of two commands on a host system:</p>
Expand Down

0 comments on commit 93a6011

Please sign in to comment.