power bug due to syslogd in initramfs
Describe your issue
What's the expected behaviour?
The syslogd -K
process from the initramfs does not get stuck in an infinite loop. Phone is cold when idle.
What's the current behaviour?
Phone is warm when idle, not on behalf of the user. One core is pegged at 100%, due to the syslogd -K
process.
How to reproduce your issue?
Boot. Maybe keep the phone on for 2 hours to reproduce the heating.
What device are you using?
google-sargo
On what postmarketOS version did you encounter the issue?
-
edge ( master
branch) -
v24.06
-
I confirm that the issue still is present after running sudo apk upgrade -a
On what environment did you encounter the issue?
Environments
-
GNOME Shell on Mobile -
Phosh -
Plasma Mobile -
Sxmo (Wayland/Sway) Please post the output of sxmo_version.sh
-
Other: Please fill out
How did you get postmarketOS image?
-
from https://images.postmarketos.org -
I built it using pmbootstrap -
It was preinstalled on my device
What's the build date of the image? (in yyyy-mm-dd format)
can be left empty if unsure
Additional information
The syslog
OpenRC service is stopped and disabled because a process persists beyond the initramfs.
google-sargo:~$ rc-service syslog status
* status: stopped
The process can be found stuck on a read
command most of the time:
google-sargo:~$ doas gdb busybox 149
GNU gdb (GDB) 15.2
Copyright (C) 2024 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "aarch64-alpine-linux-musl".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from busybox...
(No debugging symbols found in busybox)
Attaching to program: /bin/busybox, process 149
Reading symbols from /lib/ld-musl-aarch64.so.1...
Reading symbols from /usr/lib/debug//lib/ld-musl-aarch64.so.1.debug...
__cp_end () at src/thread/aarch64/syscall_cp.s:30
warning: 30 src/thread/aarch64/syscall_cp.s: No such file or directory
(gdb) bt
#0 __cp_end () at src/thread/aarch64/syscall_cp.s:30
#1 0x0000ffffb7079494 in __syscall_cp_c (nr=63, u=<optimized out>, v=<optimized out>,
w=<optimized out>, x=<optimized out>, y=<optimized out>, z=<optimized out>)
at src/thread/pthread_cancel.c:33
#2 0x0000ffffb70810e8 in read (fd=<optimized out>, buf=<optimized out>,
count=<optimized out>) at src/unistd/read.c:6
#3 0x0000aaaad96a72e4 in ?? ()
#4 0x0000ffffd974def0 in ?? ()
Backtrace stopped: previous frame inner to this frame (corrupt stack?)
The program seems to read from stdin until there is data (sysklog/syslogd.c:1117), or if a read fails.
stdin is /dev/null, meaning the read
call immediately returns no bytes every time:
google-sargo:~$ doas readlink /proc/149/fd/0
doas (user@google-sargo) password:
/dev/null
SIGTERM (the default signal emitted by killall) sets bb_got_signal
(sysklog/syslogd.c:1072; libbb/signals.c:18), while only interrupting/failing read()
if it is being called. This makes it unlikely that SIGTERM will terminate the program unless stdin reads are blocking.