Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 904502 - Setting PORTAGE_SCHEDULING_POLICY to "idle" in make.conf breaks emerge on musl (posix_spawnattr_setschedpolicy etc are not implemented)
Summary: Setting PORTAGE_SCHEDULING_POLICY to "idle" in make.conf breaks emerge on mus...
Status: UNCONFIRMED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Core - Interface (emerge) (show other bugs)
Hardware: All Linux
: Normal major (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords:
: 904501 (view as bug list)
Depends on:
Blocks:
 
Reported: 2023-04-18 06:45 UTC by Franco Gutiérrez
Modified: 2023-06-11 23:07 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Franco Gutiérrez 2023-04-18 06:45:24 UTC
When setting the PORTAGE_SCHEDULING_POLICY="idle" variable in make.conf, attempting to run emerge --info (or any other emerge command) results in an error. Specifically, the following traceback is thrown:

```
# emerge --info
Traceback (most recent call last):
  File "/usr/lib/python-exec/python3.10/emerge", line 58, in <module>
    retval = emerge_main()
  File "/usr/lib/python3.10/site-packages/_emerge/main.py", line 1294, in emerge_main
    return run_action(emerge_config)
  File "/usr/lib/python3.10/site-packages/_emerge/actions.py", line 3527, in run_action
    apply_priorities(emerge_config.target_config.settings)
  File "/usr/lib/python3.10/site-packages/_emerge/actions.py", line 3073, in apply_priorities
    set_scheduling_policy(settings)
  File "/usr/lib/python3.10/site-packages/_emerge/actions.py", line 3154, in set_scheduling_policy
    os.sched_setscheduler(portage.getpid(), policy, os.sched_param(scheduling_priority))
  File "/usr/lib/python3.10/site-packages/portage/__init__.py", line 281, in __call__
    rval = self._func(*wrapped_args, **wrapped_kwargs)
OSError: [Errno 38] Function not implemented
```


This error appears to indicate that the sched_setscheduler function is not implemented, likely due to some issue with the PORTAGE_SCHEDULING_POLICY setting.

# TECHNICAL INFORMATION
# Steps to reproduce:
Set PORTAGE_SCHEDULING_POLICY="idle" in make.conf.
Run emerge --info command.

# Expected behavior:
emerge --info should run successfully with the PORTAGE_SCHEDULING_POLICY="idle" setting in make.conf.

# Actual behavior:
The command fails with an OSError: [Errno 38] Function not implemented.

# Workaround:
Unset the PORTAGE_SCHEDULING_POLICY="idle" setting in make.conf.

# Additional information:
Gentoo Hardened Musl

Thank you for your attention to this issue.
Comment 1 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-04-18 06:47:14 UTC
*** Bug 904501 has been marked as a duplicate of this bug. ***
Comment 2 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-04-18 06:47:47 UTC
Unfortunately, it looks like musl genuinely doesn't support this (see https://patchwork.ozlabs.org/project/buildroot/patch/c9b7162513ee169da4b9e7e73d66288c083e4a7a.camel@gmail.com/), so we just need to give a nicer error message (or silently ignore it, not sure) in Portage.