Opened 6 months ago

Last modified 6 months ago

#18665 new enhancement

execve called from non main thread result in error.

Reported by: Anarchos Owned by: nobody
Priority: low Milestone: Unscheduled
Component: System/Kernel Version: R1/Development
Keywords: team execve exec_team Cc:
Blocked By: Blocking:
Platform: All

Description

I encounter this one while using the ocaml package manager to install some package:

strace -a ~/.opam/4.14.2+trunk/bin/dune exec -p lwt src/unix/config/discover.exe -- --save --use-libev true

==> [ 82079] exec = 0x8000000f Operation not allowed (22 us) Error: execve(./_build/default/src/unix/config/discover.exe): Operation not allowed

It seems exec_team() is called from non main thread.

I tried to submit a patch to that effect https://review.haiku-os.org/c/haiku/+/7105, but after discussion with waddlesplash, the best solution would be to change the main thread , and not steal its id. This is way before my head.

Change History (1)

comment:1 by korli, 6 months ago

Linux does the following: the main (leader) thread is terminated, and the non-main thread assumes its identity: https://elixir.bootlin.com/linux/v6.6/source/fs/exec.c#L1081

Note: See TracTickets for help on using tickets.