~kennylevinsen/greetd#37: 
Greetd + Tuigreet dumped core

Hello, I'm using greetd + tuigreet to login. The problem is that it randomly segfaults after login.

When it happens, tuigreet keeps saying Please Wait... and freezes, forcing me to restart the service to be able to try again.

It may be related to pam login using ecryptfs to mount my home folder, but I can't be sure because:

  • it only happens sometimes
  • it may happen even if I already have my home mounted and decrypted

Version information:

local/greetd 0.7.0-1
    Generic greeter daemon
local/greetd-tuigreet 0.8.0-0
    A console UI greeter for greetd

Coredump read with sudo coredumpctl debug greetd:

           PID: 750 (greetd)
           UID: 0 (root)
           GID: 0 (root)
        Signal: 11 (SEGV)
     Timestamp: Tue 2022-10-11 10:39:23 -03 (14min ago)
  Command Line: /usr/bin/greetd --session-worker 15
    Executable: /usr/bin/greetd
 Control Group: /system.slice/greetd.service
          Unit: greetd.service
         Slice: system.slice
       Boot ID: 56f09dceaa7a4997bbcde4c40b072ec3
    Machine ID: a3ef4cdf3b704c73ac611e60325fb5ea
      Hostname: paulodiovani-thinkpad
       Storage: /var/lib/systemd/coredump/core.greetd.0.56f09dceaa7a4997bbcde4c40b072ec3.750.1665495563000000.zst (present)
     Disk Size: 180.6K
       Message: Process 750 (greetd) of user 0 dumped core.
                
                Module linux-vdso.so.1 with build-id 67833441db018a149e7d23dfead684f2edcb2d3d
                Module libnss_systemd.so.2 with build-id 7742b911aa659b14561dade58e27806632303093
                Module pam_warn.so with build-id 5b73faf8abe96fd6b460ef6c703cb127fe8e312b
                Module pam_deny.so with build-id 023269774049f20683b13e4304d7e254a1c7a0b2
                Module pam_systemd.so with build-id 3e5628e90ede9cbb845cd94c13dcf2feee8eb7cd
                Module pam_mail.so with build-id 2e76a4a0eb21f3217a766329838b850a7085b16b
                Module pam_motd.so with build-id f3ed720bd88c652152737c440039dd0b9589174c
                Module pam_limits.so with build-id 904f399db1e3e4b168ab6fcd9152c52a52d41d3f
                Module pam_keyinit.so with build-id 6bd2a336d004dc8458f1c4cdf8fcd941d1c4925f
                Module pam_loginuid.so with build-id 45bcbb167aef0cae946704ce218c4a8f442393ad
                Module pam_time.so with build-id 27045c468605f64203a35fa2d83d7c423220c298
                Module pam_access.so with build-id 9e188fc5620336bf5919f51c25952325ff4de10e
                Module pam_env.so with build-id e28d502d7e4820f936437d20d459e51036d1a243
                Module pam_permit.so with build-id 59f4a785cc0a8400f0438321eac923ff96c34bdd
                Module libnspr4.so with build-id 7810f60fbe92aa8395979eb46f16f4dac61e6a93
                Module libplc4.so with build-id ae18d68f01288868c93380064a1517522f3a844f
                Module libplds4.so with build-id 26c6c93ab7e9b7022734be96a91d0959b4c84fe5
                Module libnssutil3.so with build-id c8cd9a21ff69a279996b72edb84ecce486d69115
                Module libnss3.so with build-id da49468b4b8a69c37de11aba959d1f9088ce8ffc
                Module libsmime3.so with build-id 728e791498d969203036d9e8b8885412e6f26bcd
                Module libssl3.so with build-id 2d43ea7722be0a6a7e8d25c1a756a37421214d8d
                Module libecryptfs.so.1 with build-id b7d5a4e635fea6d633ee2787627beb85f61cc756
                Module pam_ecryptfs.so with build-id 2b24c825d7aa270839da4c1383a0e104972f05f3
                Module pam_succeed_if.so with build-id 7e77b47f30b05ee697676df775656b89aabece99
                Module libresolv.so.2 with build-id 2e70cfe9f2972fb13487eeefcb10e4afafed6157
                Module libkeyutils.so.1 with build-id ac405ddd17be10ce538da3211415ee50c8f8df79
                Module libkrb5support.so.0 with build-id 9a22a372b2157fb05da1bad94b92d9617513af81
                Module libcom_err.so.2 with build-id 3360a28740ffbbd5a5c0c21d09072445908707e5
                Module libk5crypto.so.3 with build-id 47d53a3ea2b172eb3db1be0ae0272c7c045267e8
                Module libkrb5.so.3 with build-id 1fc969c1f54103d87e400237751b4804569a2730
                Module libgssapi_krb5.so.2 with build-id a10eaeef6e9969e80048d247666a3af155716afc
                Module libtirpc.so.3 with build-id 8f5e329f75d897df033d761ca1f742f90619c1b6
                Module libcrypt.so.2 with build-id a0a45f81771945f0559d04e93726d245159930da
                Module pam_unix.so with build-id 608e03b3693ba42760a2b836763d41d1c079a2bf
                Module libm.so.6 with build-id 2c8ff1d29b255da5b7371efd5caf57444d622838
                Module libcap.so.2 with build-id 9b38b08de708f439a9d0a4f8b9914151bc8d4b50
                Module pam_systemd_home.so with build-id 17f782ccef93f588aa7b8cdd49fbdc9b4d241d6f
                Module pam_faillock.so with build-id 7e42bd70303fbc079e452d777b6907bb5614df5d
                Module pam_shells.so with build-id 827b2de32a5ec108462699009e6e441b42792b26
                Module pam_nologin.so with build-id 9f749b8e7bd55bfb75e294bc32aaa56ac353d6c0
                Module pam_securetty.so with build-id f50f4594f4bc962c6e9b8d75b3219dfb610f27d1
                Module libcap-ng.so.0 with build-id 707f9d3134a43306625e3dab8662899ea368ac91
                Module ld-linux-x86-64.so.2 with build-id 075a6ad9f1c3f9cbb5f3301186bbe68c6a477808
                Module libaudit.so.1 with build-id 53c797475ffeed05918d78f49f85dbf4127fb174
                Module libc.so.6 with build-id 90b9e4f641f8752292698389f241cbf0ff49d687
                Module libpthread.so.0 with build-id 3954d7fd57fa4db438d0ccdd8e2c6f7cc97c2e46
                Module libgcc_s.so.1 with build-id 85db482c4585a328d95ec41124337a967bb24d8f
                Module libdl.so.2 with build-id 414d1d630bc04818a150b9c73e4493f3395e8869
                Module libpam_misc.so.0 with build-id 74aaf2951cb6eb6cf89a69339285a6015876bee4
                Module libpam.so.0 with build-id bb11b2685fe89555938ffd330ea44d82b0f8701c
                Module greetd with build-id 71ec96721db89afaf1f076b3981ad5412671a0d1
                Stack trace of thread 750:
                #0  0x00007fdad9e5768b n/a (libc.so.6 + 0x5968b)
                <a href="/~kennylevinsen/greetd/1" title="~kennylevinsen/greetd#1: Kill remaining session children when session terminates">#1</a>  0x00007fdad9e7952d n/a (libc.so.6 + 0x7b52d)
                <a href="/~kennylevinsen/greetd/2" title="~kennylevinsen/greetd#2: Consider implementing lockscreen functionality">#2</a>  0x00007fdad9f15213 __asprintf_chk (libc.so.6 + 0x117213)
                <a href="/~kennylevinsen/greetd/3" title="~kennylevinsen/greetd#3: Greeter → session handover without glitching to text mode">#3</a>  0x00007fdad9a6b129 n/a (pam_ecryptfs.so + 0x2129)
                <a href="/~kennylevinsen/greetd/4" title="~kennylevinsen/greetd#4: Enabling LTO causes optimization failures">#4</a>  0x00007fdad9a6b83a pam_sm_authenticate (pam_ecryptfs.so + 0x283a)
                <a href="/~kennylevinsen/greetd/5" title="~kennylevinsen/greetd#5: Figure out how to handle arbitrary PAM questions">#5</a>  0x00007fdada01691a n/a (libpam.so.0 + 0x391a)
                <a href="/~kennylevinsen/greetd/6" title="~kennylevinsen/greetd#6: Move some documentation into manpages">#6</a>  0x00007fdada016181 pam_authenticate (libpam.so.0 + 0x3181)
                <a href="/~kennylevinsen/greetd/7" title="~kennylevinsen/greetd#7: Requested feature: Auto-login">#7</a>  0x0000557616c58105 n/a (greetd + 0x1e105)
                <a href="/~kennylevinsen/greetd/8" title="~kennylevinsen/greetd#8: Support conv after open_session">#8</a>  0x0000557616c67c17 n/a (greetd + 0x2dc17)
                <a href="/~kennylevinsen/greetd/9" title="~kennylevinsen/greetd#9: Crash upon startup with ENOMEM">#9</a>  0x0000557616c48281 n/a (greetd + 0xe281)
                <a href="/~kennylevinsen/greetd/10" title="~kennylevinsen/greetd#10: initial_session starts again if greeter terminates">#10</a> 0x0000557616c688e3 n/a (greetd + 0x2e8e3)
                <a href="/~kennylevinsen/greetd/11" title="~kennylevinsen/greetd#11: Login via greetd infra doesn&#39;t get recognized by w and who commands">#11</a> 0x00007fdad9e21290 n/a (libc.so.6 + 0x23290)
                <a href="/~kennylevinsen/greetd/12" title="~kennylevinsen/greetd#12: greetd is stuck in crashloop if the user configured for initial session is locked">#12</a> 0x00007fdad9e2134a __libc_start_main (libc.so.6 + 0x2334a)
                <a href="/~kennylevinsen/greetd/13" title="~kennylevinsen/greetd#13: Default config is read even when --config is used">#13</a> 0x0000557616c4407e n/a (greetd + 0xa07e)
                ELF object binary architecture: AMD x86-64

Status
REPORTED
Submitter
~paulodiovani
Assigned to
No-one
Submitted
1 year, 9 months ago
Updated
2 months ago
Labels
No labels applied.

~paulodiovani 1 year, 9 months ago

Update: just now I notice there is a v0.8.0 available. I'm updating and will post a new comment once I know if the issues was solved or not.

Thanks in advance.

~kennylevinsen 1 year, 9 months ago

The segfault is triggered from with pam_ecryptfs.so, somewhere in this function: https://bazaar.launchpad.net/~ecryptfs/ecryptfs/trunk/view/head:/src/pam_ecryptfs/pam_ecryptfs.c#L125.

Get debug symbols for pam_ecryptfs.so (ecryptfs-utils) to get a more useful stacktrace.

~paulodiovani 1 year, 9 months ago

Update: issue still happens on version 0.8.0. I'm checking ecryptfs-utils.

~paulodiovani 1 year, 9 months ago

How can I get debug symbols for pam_ecryptfs.so?

~kennylevinsen 1 year, 9 months ago

Rebuild the ecryptfs-utils package with debug symbols. Refer to your distro documentation for more details.

Note that a crash in pam_ecryptfs.so is not a greetd bug.

~paulodiovani 1 year, 9 months ago

Rebuild the ecryptfs-utils package with debug symbols. Refer to your distro documentation for more details.

I'll do that.

Note that a crash in pam_ecryptfs.so is not a greetd bug.

Generally, that is true, but this only happens with greetd. I've tried gdm, sddm, lightdm and ly and none of them presented this issue. Login through linux terminal (no login manager) also never fails.

So, I think it may be something "between" these two packages.

I've also noticed that greetd works slightly differently from other login managers. For example, if I have an error in my ~/.profile the login fails with greetd (back to login screen) while it still works with others.

On a hard guess, it almost looks like a race condition, as if greetd was trying to start a session before pam login finishes. 🤔

~kennylevinsen 1 year, 9 months ago

greetd does not use threads, and all PAM processing is done in a single process, so there are no races. The crash is happening in pam_ecryptfs while PAM is asking it for it's opinion on allowing you to authenticate, much before the session is started.

It may be that greetd is triggering the pam_ecryptfs bug (e.g. by not providing an environment variable it thought would always be there), but a crash in pam_ecyptfs is a bug in pam_ecryptfs.

~kennylevinsen 1 year, 9 months ago

(Note that I am open to adding whatever it expects as a feature request, just pointing the debugging effort in the right direction.)

~paulodiovani 1 year, 9 months ago

Sure, I understand.

I'll get the debug symbols as soon as I have the time and post them here.

Thanks.

~kiwikurt 2 months ago

@paulodiovani, where you able to resolve the segfaults? I also experience them often with greetd+tuigreet on 2 debian machines

Register here or Log in to comment, or comment via email.