Skip to content

Fix panic with config.json with empty process#1848

Closed
alban wants to merge 1 commit intoopencontainers:masterfrom
kinvolk:alban/fix-empty-process
Closed

Fix panic with config.json with empty process#1848
alban wants to merge 1 commit intoopencontainers:masterfrom
kinvolk:alban/fix-empty-process

Conversation

@alban
Copy link
Copy Markdown
Contributor

@alban alban commented Jul 20, 2018

When config.json does not have a "process" section at all, runc paniced
with this error:

panic: runtime error: invalid memory address or nil pointer dereference

According to the spec, "process" is optional:
https://github.com/opencontainers/runtime-spec/blob/master/config.md#process

process (object, OPTIONAL) specifies the container process. This property is REQUIRED when start is called.

So the desired behaviour is:

  • "runc create": succeed without error
  • "runc start": return a proper error without panic

This patch fixes the panic in "runc create". Further work is needed to
allow create but not start.

Signed-off-by: Alban Crequy alban@kinvolk.io

When config.json does not have a "process" section at all, runc paniced
with this error:
> panic: runtime error: invalid memory address or nil pointer dereference

According to the spec, "process" is optional:
https://github.com/opencontainers/runtime-spec/blob/master/config.md#process
> process (object, OPTIONAL) specifies the container process. This property is REQUIRED when start is called.

So the desired behaviour is:
- "runc create": succeed without error
- "runc start": return a proper error without panic

This patch fixes the panic in "runc create". Further work is needed to
allow create but not start.

Signed-off-by: Alban Crequy <alban@kinvolk.io>
@wking
Copy link
Copy Markdown
Contributor

wking commented Jul 20, 2018

I think this, like #1826, is a dup of #1726.

@AkihiroSuda
Copy link
Copy Markdown
Member

should have been covered in 16d55f1

Feel free to reopen if not.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants