Bug 32255 - polkit fails to start
Summary: polkit fails to start
Status: RESOLVED FIXED
Alias: None
Product: Mageia
Classification: Unclassified
Component: RPM Packages (show other bugs)
Version: Cauldron
Hardware: All Linux
Priority: Normal critical
Target Milestone: ---
Assignee: Mageia Bug Squad
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-09-06 21:35 CEST by GG HH
Modified: 2023-09-09 19:03 CEST (History)
1 user (show)

See Also:
Source RPM: polkit-123-1.mga10.src.rpm
CVE:
Status comment:


Attachments

Description GG HH 2023-09-06 21:35:20 CEST
Cauldron uptodate, the issue started yesterday.
The user side impacts are lags when starting some applications and _X11 session not starting after a reboot_ (i am not using wayland)
I managed to get a session back starting on multi-user level and then manually starting the X11 session with icewm (no success with gnome)

It looks like the root cause might be related to the recent polkit update and maybe firefox (see libmozjs involved in the logs)
polkit was running fine before yesterday update.

Please pay attention at the question at the end.

# systemctl --state=failed --no-legend
● polkit.service  loaded failed failed Authorization Manager

# # systemctl status polkit.service 
× polkit.service - Authorization Manager
     Loaded: loaded (/usr/lib/systemd/system/polkit.service; static)
     Active: failed (Result: core-dump) since Wed 2023-09-06 21:16:57 CEST; 58s ago
       Docs: man:polkit(8)
    Process: 192551 ExecStart=/usr/lib/polkit-1/polkitd (code=dumped, signal=SEGV)
   Main PID: 192551 (code=dumped, signal=SEGV)
        CPU: 35ms

sept. 06 21:16:57 uranus systemd[1]: Starting polkit.service...
sept. 06 21:16:57 uranus polkitd[192551]: Started polkitd version 123
sept. 06 21:16:57 uranus systemd[1]: polkit.service: Main process exited, code=dumped, status=11/SEGV
sept. 06 21:16:57 uranus systemd[1]: polkit.service: Failed with result 'core-dump'.
sept. 06 21:16:57 uranus systemd[1]: Failed to start polkit.service.

# systemctl start polkit
Job for polkit.service failed because a fatal signal was delivered causing the control process to dump core.
See "systemctl status polkit.service" and "journalctl -xeu polkit.service" for details.

# more /var/log/messages
Sep  6 21:18:53 uranus kernel: [ 8052.589469] polkitd[192698]: segfault at 0 ip 00007fa0d94114ce sp 00007ffec61184a0 error 6 in libmozjs-102.so.0.0.0[7fa0d8ce0000+9e2000] likely on CPU 6 (core 6, socket 0)
Sep  6 21:18:53 uranus kernel: [ 8052.589475] Code: 31 db 48 8b bc 24 c8 09 00 00 48 83 ff 08 0f 85 25 ff ff ff e9 25 ff ff ff 48 8d 05 85 32 2c 00 48 8b 0d 0d 59 50 00 48 89 01 <c7> 04 25 00 00 00 00 3f 00 00 00 e8 22 d9 1b 00 e8 1d ef 8c ff 66


I am not sure that it matters but for the sake of completeness :
I have experienced issues with a running firefox session and upgrading firefox (i have scheduled a daily urpmi update)
So, i do firefox updates manually. 
polkit upgrade was installed yesterday. I encoutered the here before issues starting yesterday and updated firefox today after seeing libmozjs message. It didn't help.

# cat /etc/urpmi/skip.list 
# Here you can specify the packages that won't be upgraded automatically
# for example, to exclude all apache packages :
# /^apache/
firefox

# rpm -q  firefox lib64mozjs102 
firefox-115.2.0-1.mga10
lib64mozjs102-102.6.0-2.mga9

I noticed that mozjs was last compiled on january on a mga9 version. wouold it worth to rebuild it ?
Comment 1 GG HH 2023-09-06 21:57:16 CEST
looking at http://pkgsubmit.mageia.org/ wally is actually trying to rebuild it
(failure 5 hours ago)
Comment 2 GG HH 2023-09-07 08:27:16 CEST
I have just installed the rebuilt package and is looks like it solves the issue
At least polkit starts.
I will reboot later and hopefully close accordingly.

thanks

$ rpm -q  lib64mozjs102_0 
lib64mozjs102_0-102.13.0-1.mga10

# systemctl status polkit
● polkit.service - Authorization Manager
     Loaded: loaded (/usr/lib/systemd/system/polkit.service; static)
     Active: active (running) since Thu 2023-09-07 08:23:40 CEST; 31s ago
       Docs: man:polkit(8)
   Main PID: 188245 (polkitd)
      Tasks: 13 (limit: 18860)
     Memory: 9.5M
        CPU: 49ms
     CGroup: /system.slice/polkit.service
             └─188245 /usr/lib/polkit-1/polkitd --no-debug

sept. 07 08:23:40 uranus systemd[1]: Starting polkit.service...
sept. 07 08:23:40 uranus polkitd[188245]: Started polkitd version 123
sept. 07 08:23:40 uranus polkitd[188245]: Loading rules from directory /etc/pol>
sept. 07 08:23:40 uranus polkitd[188245]: Loading rules from directory /usr/sha>
sept. 07 08:23:40 uranus polkitd[188245]: Finished loading, compiling and execu>
sept. 07 08:23:40 uranus systemd[1]: Started polkit.service.
sept. 07 08:23:40 uranus polkitd[188245]: Acquired the name org.freedesktop.Pol
Comment 3 GG HH 2023-09-07 12:50:52 CEST
fixed by new lib64mozjs102_0

Status: NEW => RESOLVED
Resolution: (none) => FIXED

Comment 4 GG HH 2023-09-07 21:15:49 CEST
[reopening for a query. The issue by itself is fixed]

btw, it does not look very robust for something like polkit to depend on lin64mozjs. specially if it can bring down the whole system when upgrading a browser.

Does it make sense to study if this dependency can be removed ?

Resolution: FIXED => (none)
Status: RESOLVED => REOPENED

Comment 5 Jani Välimaa 2023-09-08 21:02:05 CEST
(In reply to GG HH from comment #3)
> fixed by new lib64mozjs102_0

No, new mozjs102 didn't fix the issue, but polkit-123-2.mga10.

https://svnweb.mageia.org/packages?view=revision&revision=1984810
Comment 6 Dave Hodgins 2023-09-08 22:37:39 CEST
After some quick skimming, it appears polkit has a javascript interface, and
it is being used. For example in
/usr/share/cinnamon/applets/network@cinnamon.org/applet.js, it appears to
be being used to determine if authorization is needed
network@cinnamon.org/applet.js:        case NM.DeviceState.NEED_AUTH:
network@cinnamon.org/applet.js:            return _("authentication required");

I don't know javascript, but that's what I think it's doing.

CC: (none) => davidwhodgins

Comment 7 GG HH 2023-09-09 19:03:07 CEST
thanks for investigating

i found this link which confirms what you wrote.
https://www.freedesktop.org/software/polkit/docs/latest/polkit.8.html

i also learnt that there is an alternative option namely duktape and one post state that several major distribs have switched to it.
https://unix.stackexchange.com/questions/526159/what-javascript-interpreter-does-polkit-use-to-interpret-rules-d-files

Closing again anyway

Resolution: (none) => FIXED
Status: REOPENED => RESOLVED


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