Opened 12 months ago

Last modified 6 weeks ago

#18665 reopened 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 (5)

comment:1 by korli, 12 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

comment:2 by Anarchos, 3 months ago

Can be closed as invalid.

comment:3 by waddlesplash, 3 months ago

Resolution: no change required
Status: newclosed

comment:4 by pulkomandy, 6 weeks ago

Resolution: no change required
Status: closedreopened

Wether this is really needed or not by an application, POSIX does not disallow to call execve from a thread, so we should implement it

Note: See TracTickets for help on using tickets.