Skip to content

An image that starts an image (itself) under okrun: the host executes the .oke without the loader (SIGSEGV, 139) #42

Closed

Description

@Sunrisepeak

Not a blocker; found while adding an "external program" check to a consumer (a cmd.exe interpreter, its x86_64-openkal row under okrun on Linux x86_64, mcpp 2026.11.18.1, openkal-platform 0.30.1).

What happens

A program in an image starts programs: from cmd built for x86_64-openkal, a batch file starts a process. When the program to start is an image (here, itself), an image started by its file ends by a signal. Named directly (".../bin/cmd.exe.oke" /c exit 3 from a batch file run by the same image), the start reaches the host's execve with the .oke file, a static-pie ELF (file: "ELF 64-bit LSB shared object, x86-64, static-pie linked") that expects to be entered by okrun; the started program ends with status 139 (SIGSEGV).

$ mcpp run cmd.exe --release --target x86_64-openkal -- /c oke.bat
...>"/…/bin/cmd.exe.oke" /c exit 3
...>echo child=139
child=139

Expected

That an image can start an image, itself included, as a program of another environment does (fork/execve or posix_spawn through openkal-musl, kal_process_spawn beneath): the started image entered by the loader, as okrun <image> <args> would. The same shape was just measured elsewhere: ibcs-us 4.3-2 (mcpp-community/ibcs-us#3) starts a program of the System V interface that execs another under the emulation again (/proc/self/exe --exec=<file> -- argv...) instead of handing it to Linux.

The consumer leaves its external-program check out on the *-openkal rows meanwhile, with this issue as the reason.

Activity

  1. changed the title [-]An image that starts an image (itself) under okrun: the host executes the .oke without the loader (SIGSEGV, 139), and /proc/self/exe names okrun[/-] [+]An image that starts an image (itself) under okrun: the host executes the .oke without the loader (SIGSEGV, 139)[/+] on Nov 20, 2026
  2. speak-agent commented on Nov 20, 2026

    @speak-agent
    Contributor

    Fixed in 0.7.1 (#43): an image file or an okb that an image starts is entered through the loader the runner names, held to the runner's signature requirements, with the vector its starter gave. Confirmed from the consumer's side under openkal-platform 0.31.2 (okrun 0.7.2, its probe run 44669866163). From inside the image, /bin/sh returns 3, okrun given a name that cannot be opened returns 127, and the image file itself returns 3. With COMSPEC set to the image, cmd's whole test.bat passes.

    The description no longer lists cmd's COMSPEC naming okrun: that is cmd's. cmd reads /proc/self/exe before argv[0], and /proc/self/exe names a loader started explicitly, ld.so as well as okrun (/lib64/ld-linux-x86-64.so.2 ./cmd.exe /c 'echo %COMSPEC%' prints ld.so's path on plain Linux); its remedy is in cmd.

  3. speak-agent commented on Nov 20, 2026

    @speak-agent
    Contributor

    Fixed in 0.7.1 (#43): an image file or an okb that an image starts is entered through the loader the runner names, held to the runner's signature requirements, with the vector its starter gave. Confirmed from the consumer's side under openkal-platform 0.31.2 (okrun 0.7.2, its probe run 44669866163). From inside the image, /bin/sh returns 3, okrun given a name that cannot be opened returns 127, and the image file itself returns 3. With COMSPEC set to the image, cmd's whole test.bat passes.

    The description no longer lists cmd's COMSPEC naming okrun: that is cmd's. cmd reads /proc/self/exe before argv[0], and /proc/self/exe names a loader started explicitly, ld.so as well as okrun (/lib64/ld-linux-x86-64.so.2 ./cmd.exe /c 'echo %COMSPEC%' prints ld.so's path on plain Linux); its remedy is in cmd.

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