crun icon indicating copy to clipboard operation
crun copied to clipboard

Improper parsing or tokenization of command string with krun handler

Open jonner opened this issue 5 months ago • 2 comments

When using the krun runtime handler with podman, commands with special characters often fail due to an apparent bug in parsing. For example, the following command works fine:

$ podman run --rm alpine /bin/sh -c 'ls && sleep 30'
bin
dev
...

But the following command fails:

$ podman run --rm --annotation run.oci.handler=krun alpine /bin/sh -c 'ls && sleep 30'
[2025-07-24T20:13:40Z ERROR devices::virtio::console::device] Couldn't get terminal dimensions: ENOTTY: Not a typewriter
[2025-07-24T20:13:40Z ERROR devices::virtio::console::device] Couldn't get terminal dimensions: ENOTTY: Not a typewriter
ls: 66: No such file or directory
ls: sleep: No such file or directory
ls: 30: No such file or directory

jonner avatar Jul 24 '25 20:07 jonner

@slp @tylerfanelli @jakecorrenti PTAL

Should it be moved to libkrun?

giuseppe avatar Jul 25 '25 10:07 giuseppe

The problem is that init is not translating unicode characters to ascii. Easy to fix. I've created https://github.com/containers/libkrun/issues/382 to track it.

slp avatar Jul 31 '25 11:07 slp

I see that libkrun issue 382 has now been closed

  • https://github.com/containers/libkrun/issues/382

and marked as fixed by

  • https://github.com/containers/libkrun/pull/397

eriksjolund avatar Dec 12 '25 07:12 eriksjolund

@slp fine to close the issue here?

giuseppe avatar Dec 12 '25 09:12 giuseppe

@giuseppe Yes, it should be fixed now.

slp avatar Dec 12 '25 12:12 slp