RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 2031645 - tuned profile timeout due to UnicodeDecodeError
Summary: tuned profile timeout due to UnicodeDecodeError
Keywords:
Status: CLOSED DUPLICATE of bug 2031717
Alias: None
Product: Red Hat Enterprise Linux 9
Classification: Red Hat
Component: python-linux-procfs
Version: 9.0
Hardware: x86_64
OS: Linux
unspecified
high
Target Milestone: rc
: ---
Assignee: John Kacur
QA Contact: Kernel Realtime QE
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-12-13 07:08 UTC by mhou
Modified: 2021-12-13 10:25 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-12-13 10:24:56 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker RHELPLAN-105461 0 None None None 2021-12-13 07:12:00 UTC

Description mhou 2021-12-13 07:08:48 UTC
Description of problem:
when doing realtime-virtual-host profile, tuned-adm timeout and got error.

Version-Release number of selected component (if applicable):
# uname -r
5.14.0-20.rt21.20.el9.x86_64
# rpm -qa | grep python3-linux
python3-linux-procfs-0.6.3-4.el9.noarch


How reproducible:100%


Steps to Reproduce:
1. cat test.sh
cat > /etc/tuned/realtime-virtual-host-variables.conf <<-EOF
isolated_cores=1-23,25-47
isolate_managed_irq=Y
EOF
tuned-adm profile realtime-virtual-host
2. check the tuned log file


Actual results:
tuned-adm profile realtime-virtual-host hung more than 10 mins, and find some errors as below:
UnicodeDecodeError: 'unicodeescape' codec can't decode bytes in position 22-23: truncated \uXXXX escape


Expected results:
profile can affect on host and no error on tuned log file 

Additional info:
2021-12-12 22:17:45,013 INFO     tuned.daemon.daemon: starting tuning
2021-12-12 22:17:45,020 INFO     tuned.plugins.base: instance cpu: assigning devices cpu32, cpu22, cpu9, cpu40, cpu14, cpu33, cpu38, cpu5, cpu42, cpu41, cpu27, cpu31, cpu2, cpu24, cpu3, cpu43, cpu8, cpu28, cpu18, cpu19, cpu30, cpu6, cpu12, cpu46, cpu20, cpu25, cpu36, cpu34, cpu44, cpu21, cpu39, cpu11, cpu15, cpu0, cpu17, cpu16, cpu7, cpu10, cpu37, cpu4, cpu26, cpu35, cpu13, cpu23, cpu29, cpu1, cpu45, cpu47
2021-12-12 22:17:45,035 INFO     tuned.plugins.plugin_cpu: We are running on an x86 GenuineIntel platform
2021-12-12 22:17:45,042 INFO     tuned.plugins.base: instance net: assigning devices eno4, enp59s0f1, enp59s0f0, eno3, eno2, eno1
2021-12-12 22:17:45,043 INFO     tuned.plugins.plugin_scheduler: recovering scheduling settings from previous run
2021-12-12 22:17:59,694 INFO     tuned.profiles.loader: loading profile: cpu-partitioning
2021-12-12 22:17:59,755 INFO     tuned.daemon.daemon: starting tuning
2021-12-12 22:17:59,769 INFO     tuned.plugins.base: instance cpu: assigning devices cpu32, cpu22, cpu9, cpu40, cpu14, cpu33, cpu38, cpu5, cpu42, cpu41, cpu27, cpu31, cpu2, cpu24, cpu3, cpu43, cpu8, cpu28, cpu18, cpu19, cpu30, cpu6, cpu12, cpu46, cpu20, cpu25, cpu36, cpu34, cpu44, cpu21, cpu39, cpu11, cpu15, cpu0, cpu17, cpu16, cpu7, cpu10, cpu37, cpu4, cpu26, cpu35, cpu13, cpu23, cpu29, cpu1, cpu45, cpu47
2021-12-12 22:17:59,789 INFO     tuned.plugins.plugin_cpu: We are running on an x86 GenuineIntel platform
2021-12-12 22:17:59,796 INFO     tuned.plugins.plugin_scheduler: recovering scheduling settings from previous run
2021-12-12 22:25:35,003 INFO     tuned.profiles.loader: loading profile: cpu-partitioning
2021-12-12 22:25:35,011 INFO     tuned.daemon.daemon: starting tuning
2021-12-12 22:25:35,015 INFO     tuned.plugins.base: instance cpu: assigning devices cpu32, cpu22, cpu9, cpu40, cpu14, cpu33, cpu38, cpu5, cpu42, cpu41, cpu27, cpu31, cpu2, cpu24, cpu3, cpu43, cpu8, cpu28, cpu18, cpu19, cpu30, cpu6, cpu12, cpu46, cpu20, cpu25, cpu36, cpu34, cpu44, cpu21, cpu39, cpu11, cpu15, cpu0, cpu17, cpu16, cpu7, cpu10, cpu37, cpu4, cpu26, cpu35, cpu13, cpu23, cpu29, cpu1, cpu45, cpu47
2021-12-12 22:25:35,035 INFO     tuned.plugins.plugin_cpu: We are running on an x86 GenuineIntel platform
2021-12-12 22:25:35,042 INFO     tuned.plugins.plugin_scheduler: recovering scheduling settings from previous run
2021-12-12 22:26:00,077 INFO     tuned.daemon.controller: terminating controller
2021-12-12 22:29:15,607 INFO     tuned.daemon.application: dynamic tuning is globally disabled
2021-12-12 22:29:15,641 INFO     tuned.daemon.daemon: using sleep interval of 1 second(s)
2021-12-12 22:29:15,647 INFO     tuned.profiles.loader: loading profile: realtime-virtual-host
2021-12-12 22:29:15,696 INFO     tuned.daemon.controller: starting controller
2021-12-12 22:29:15,696 INFO     tuned.daemon.daemon: starting tuning
2021-12-12 22:29:15,730 INFO     tuned.plugins.base: instance cpu: assigning devices cpu24, cpu13, cpu4, cpu19, cpu28, cpu22, cpu26, cpu1, cpu7, cpu8, cpu34, cpu18, cpu38, cpu39, cpu45, cpu42, cpu37, cpu23, cpu30, cpu31, cpu10, cpu6, cpu44, cpu0, cpu3, cpu5, cpu46, cpu21, cpu25, cpu16, cpu43, cpu12, cpu27, cpu36, cpu29, cpu33, cpu15, cpu41, cpu17, cpu47, cpu2, cpu32, cpu40, cpu14, cpu20, cpu11, cpu35, cpu9
2021-12-12 22:29:15,748 INFO     tuned.plugins.plugin_cpu: We are running on an x86 GenuineIntel platform
2021-12-12 22:29:15,768 INFO     tuned.plugins.base: instance net: assigning devices eno4, eno1, enp59s0f1, eno2, eno3, enp59s0f0
2021-12-12 22:29:15,950 INFO     tuned.plugins.plugin_rtentsk: opened SOF_TIMESTAMPING_OPT_TX_SWHW socket
2021-12-12 22:29:15,988 INFO     tuned.plugins.plugin_cpu: energy_perf_bias successfully set to 'performance' on cpu 'cpu24'
2021-12-12 22:29:15,996 INFO     tuned.plugins.plugin_cpu: energy_perf_bias successfully set to 'performance' on cpu 'cpu13'
2021-12-12 22:29:16,004 INFO     tuned.plugins.plugin_cpu: energy_perf_bias successfully set to 'performance' on cpu 'cpu4'
2021-12-12 22:29:16,010 INFO     tuned.plugins.plugin_cpu: energy_perf_bias successfully set to 'performance' on cpu 'cpu19'
2021-12-12 22:29:16,023 INFO     tuned.plugins.plugin_cpu: energy_perf_bias successfully set to 'performance' on cpu 'cpu28'
2021-12-12 22:29:16,036 INFO     tuned.plugins.plugin_cpu: energy_perf_bias successfully set to 'performance' on cpu 'cpu22'
2021-12-12 22:29:16,045 INFO     tuned.plugins.plugin_cpu: energy_perf_bias successfully set to 'performance' on cpu 'cpu26'
2021-12-12 22:29:16,053 INFO     tuned.plugins.plugin_cpu: energy_perf_bias successfully set to 'performance' on cpu 'cpu1'
2021-12-12 22:29:16,059 INFO     tuned.plugins.plugin_cpu: energy_perf_bias successfully set to 'performance' on cpu 'cpu7'
2021-12-12 22:29:16,064 INFO     tuned.plugins.plugin_cpu: energy_perf_bias successfully set to 'performance' on cpu 'cpu8'
2021-12-12 22:29:16,069 INFO     tuned.plugins.plugin_cpu: energy_perf_bias successfully set to 'performance' on cpu 'cpu34'
2021-12-12 22:29:16,079 INFO     tuned.plugins.plugin_cpu: energy_perf_bias successfully set to 'performance' on cpu 'cpu18'
2021-12-12 22:29:16,086 INFO     tuned.plugins.plugin_cpu: energy_perf_bias successfully set to 'performance' on cpu 'cpu38'
2021-12-12 22:29:16,093 INFO     tuned.plugins.plugin_cpu: energy_perf_bias successfully set to 'performance' on cpu 'cpu39'
2021-12-12 22:29:16,099 INFO     tuned.plugins.plugin_cpu: energy_perf_bias successfully set to 'performance' on cpu 'cpu45'
2021-12-12 22:29:16,105 INFO     tuned.plugins.plugin_cpu: energy_perf_bias successfully set to 'performance' on cpu 'cpu42'
2021-12-12 22:29:16,110 INFO     tuned.plugins.plugin_cpu: energy_perf_bias successfully set to 'performance' on cpu 'cpu37'
2021-12-12 22:29:16,117 INFO     tuned.plugins.plugin_cpu: energy_perf_bias successfully set to 'performance' on cpu 'cpu23'
2021-12-12 22:29:16,126 INFO     tuned.plugins.plugin_cpu: energy_perf_bias successfully set to 'performance' on cpu 'cpu30'
2021-12-12 22:29:16,133 INFO     tuned.plugins.plugin_cpu: energy_perf_bias successfully set to 'performance' on cpu 'cpu31'
2021-12-12 22:29:16,140 INFO     tuned.plugins.plugin_cpu: energy_perf_bias successfully set to 'performance' on cpu 'cpu10'
2021-12-12 22:29:16,149 INFO     tuned.plugins.plugin_cpu: energy_perf_bias successfully set to 'performance' on cpu 'cpu6'
2021-12-12 22:29:16,157 INFO     tuned.plugins.plugin_cpu: energy_perf_bias successfully set to 'performance' on cpu 'cpu44'
2021-12-12 22:29:16,165 INFO     tuned.plugins.plugin_cpu: energy_perf_bias successfully set to 'performance' on cpu 'cpu0'
2021-12-12 22:29:16,173 INFO     tuned.plugins.plugin_cpu: energy_perf_bias successfully set to 'performance' on cpu 'cpu3'
2021-12-12 22:29:16,181 INFO     tuned.plugins.plugin_cpu: energy_perf_bias successfully set to 'performance' on cpu 'cpu5'
2021-12-12 22:29:16,188 INFO     tuned.plugins.plugin_cpu: energy_perf_bias successfully set to 'performance' on cpu 'cpu46'
2021-12-12 22:29:16,194 INFO     tuned.plugins.plugin_cpu: energy_perf_bias successfully set to 'performance' on cpu 'cpu21'
2021-12-12 22:29:16,201 INFO     tuned.plugins.plugin_cpu: energy_perf_bias successfully set to 'performance' on cpu 'cpu25'
2021-12-12 22:29:16,209 INFO     tuned.plugins.plugin_cpu: energy_perf_bias successfully set to 'performance' on cpu 'cpu16'
2021-12-12 22:29:16,215 INFO     tuned.plugins.plugin_cpu: energy_perf_bias successfully set to 'performance' on cpu 'cpu43'
2021-12-12 22:29:16,222 INFO     tuned.plugins.plugin_cpu: energy_perf_bias successfully set to 'performance' on cpu 'cpu12'
2021-12-12 22:29:16,232 INFO     tuned.plugins.plugin_cpu: energy_perf_bias successfully set to 'performance' on cpu 'cpu27'
2021-12-12 22:29:16,240 INFO     tuned.plugins.plugin_cpu: energy_perf_bias successfully set to 'performance' on cpu 'cpu36'
2021-12-12 22:29:16,251 INFO     tuned.plugins.plugin_cpu: energy_perf_bias successfully set to 'performance' on cpu 'cpu29'
2021-12-12 22:29:16,261 INFO     tuned.plugins.plugin_cpu: energy_perf_bias successfully set to 'performance' on cpu 'cpu33'
2021-12-12 22:29:16,271 INFO     tuned.plugins.plugin_cpu: energy_perf_bias successfully set to 'performance' on cpu 'cpu15'
2021-12-12 22:29:16,281 INFO     tuned.plugins.plugin_cpu: energy_perf_bias successfully set to 'performance' on cpu 'cpu41'
2021-12-12 22:29:16,289 INFO     tuned.plugins.plugin_cpu: energy_perf_bias successfully set to 'performance' on cpu 'cpu17'
2021-12-12 22:29:16,298 INFO     tuned.plugins.plugin_cpu: energy_perf_bias successfully set to 'performance' on cpu 'cpu47'
2021-12-12 22:29:16,306 INFO     tuned.plugins.plugin_cpu: energy_perf_bias successfully set to 'performance' on cpu 'cpu2'
2021-12-12 22:29:16,312 INFO     tuned.plugins.plugin_cpu: energy_perf_bias successfully set to 'performance' on cpu 'cpu32'
2021-12-12 22:29:16,321 INFO     tuned.plugins.plugin_cpu: energy_perf_bias successfully set to 'performance' on cpu 'cpu40'
2021-12-12 22:29:16,331 INFO     tuned.plugins.plugin_cpu: energy_perf_bias successfully set to 'performance' on cpu 'cpu14'
2021-12-12 22:29:16,342 INFO     tuned.plugins.plugin_cpu: energy_perf_bias successfully set to 'performance' on cpu 'cpu20'
2021-12-12 22:29:16,350 INFO     tuned.plugins.plugin_cpu: energy_perf_bias successfully set to 'performance' on cpu 'cpu11'
2021-12-12 22:29:16,359 INFO     tuned.plugins.plugin_cpu: energy_perf_bias successfully set to 'performance' on cpu 'cpu35'
2021-12-12 22:29:16,369 INFO     tuned.plugins.plugin_cpu: energy_perf_bias successfully set to 'performance' on cpu 'cpu9'
2021-12-12 22:29:16,369 INFO     tuned.plugins.plugin_cpu: setting new cpu latency 2
2021-12-12 22:29:16,370 ERROR    tuned.plugins.plugin_sysctl: Failed to read sysctl parameter 'net.core.busy_read', the parameter does not exist
2021-12-12 22:29:16,370 ERROR    tuned.plugins.plugin_sysctl: sysctl option net.core.busy_read will not be set, failed to read the original value.
2021-12-12 22:29:16,370 ERROR    tuned.plugins.plugin_sysctl: Failed to read sysctl parameter 'net.core.busy_poll', the parameter does not exist
2021-12-12 22:29:16,370 ERROR    tuned.plugins.plugin_sysctl: sysctl option net.core.busy_poll will not be set, failed to read the original value.
2021-12-12 22:29:16,375 INFO     tuned.plugins.plugin_sysctl: reapplying system sysctl
2021-12-12 22:29:16,376 WARNING  tuned.plugins.plugin_vm: Option 'transparent_hugepages' is not supported on current hardware.
2021-12-12 22:29:16,377 INFO     tuned.plugins.plugin_bootloader: installing additional boot command line parameters to grub2
2021-12-12 22:29:16,490 WARNING  tuned.profiles.functions.function_check_net_queue_count: net-dev queue count is not correctly specified, setting it to HK CPUs 48

2021-12-12 22:29:16,509 ERROR    tuned.utils.commands: Executing ethtool error: netlink error: requested channel count exceeds maximum (offset 36)
netlink error: Invalid argument
2021-12-12 22:29:16,526 ERROR    tuned.utils.commands: Executing ethtool error: netlink error: requested channel count exceeds maximum (offset 36)
netlink error: Invalid argument
2021-12-12 22:29:16,534 ERROR    tuned.utils.commands: Executing ethtool error: netlink error: requested channel count exceeds maximum (offset 36)
netlink error: Invalid argument
2021-12-12 22:29:16,542 ERROR    tuned.utils.commands: Executing ethtool error: netlink error: requested channel count exceeds maximum (offset 36)
netlink error: Invalid argument
2021-12-12 22:29:16,621 INFO     tuned.plugins.plugin_script: calling script '/usr/lib/tuned/realtime/script.sh' with arguments '['start']'
2021-12-12 22:29:16,661 INFO     tuned.plugins.plugin_script: calling script '/usr/lib/tuned/realtime-virtual-host/script.sh' with arguments '['start']'
2021-12-12 22:29:17,117 INFO     tuned.daemon.daemon: static tuning from profile 'realtime-virtual-host' applied
2021-12-13 01:49:46,502 INFO     tuned.daemon.daemon: stopping tuning
2021-12-13 01:49:46,516 INFO     tuned.daemon.daemon: terminating TuneD, rolling back all changes
2021-12-13 01:49:46,645 ERROR    tuned.units.manager: BUG: Unhandled exception in stop_tuning: 'unicodeescape' codec can't decode bytes in position 22-23: truncated \uXXXX escape
2021-12-13 01:49:46,645 ERROR    tuned.units.manager: Traceback (most recent call last):
  File "/usr/lib/python3.9/site-packages/tuned/units/manager.py", line 119, in _try_call
    return f(*args, **kwargs)
  File "/usr/lib/python3.9/site-packages/tuned/plugins/instance/instance.py", line 87, in unapply_tuning
    self._plugin.instance_unapply_tuning(self, full_rollback)
  File "/usr/lib/python3.9/site-packages/tuned/plugins/base.py", line 312, in instance_unapply_tuning
    self._instance_unapply_static(instance, full_rollback)
  File "/usr/lib/python3.9/site-packages/tuned/plugins/plugin_scheduler.py", line 722, in _instance_unapply_static
    self._restore_ps_affinity()
  File "/usr/lib/python3.9/site-packages/tuned/plugins/plugin_scheduler.py", line 678, in _restore_ps_affinity
    ps = self.get_processes()
  File "/usr/lib/python3.9/site-packages/tuned/plugins/plugin_scheduler.py", line 293, in get_processes
    cmd = self._get_cmdline(proc)
  File "/usr/lib/python3.9/site-packages/tuned/plugins/plugin_scheduler.py", line 281, in _get_cmdline
    cmdline = procfs.process_cmdline(process)
  File "/usr/lib/python3.9/site-packages/procfs/procfs.py", line 43, in process_cmdline
    if pid_info["cmdline"]:
  File "/usr/lib/python3.9/site-packages/procfs/procfs.py", line 356, in __getitem__
    self.load_cmdline()
  File "/usr/lib/python3.9/site-packages/procfs/procfs.py", line 374, in load_cmdline
    cmdline = f.readline().decode(encoding='unicode_escape')
UnicodeDecodeError: 'unicodeescape' codec can't decode bytes in position 22-23: truncated \uXXXX escape

Comment 1 Jaroslav Škarvada 2021-12-13 10:24:56 UTC
It's python-linux-procfs bug, unfortunately we cannot do much about it in the TuneD. Maybe as a workaround we could catch and ignore the exception, but I would add such workarounds to TuneD as a last resort.

*** This bug has been marked as a duplicate of bug 2031717 ***


Note You need to log in before you can comment on or make changes to this bug.