Ubuntu 20.04 Login Loop After Logout

Asked by Marcu

Hi,

I chose "Log Out" from the "Power/Off Log Out" menu. Afterwards I was unable to log back in to my account. I was not doing anything out of the ordinary at the time.

The login loop problem seems to be reasonably common in Ubuntu and I have tried various fixes online with no luck. I have a Radeon GPU so it won't be the Nvidia auto-login bug. I don't use auto-login anyway. I have tried changing my UI but I still have the same login loop problem in LightDM. The only detail that I can find is that I have an error in dmesg for a segfault in "gnome-session-b" in "libpcre.so".

I have upgrade my distribution to the latest version but the issue remains. I'm able to login to the terminal with the account in question but not the GUI.
I was able to create another user from the terminal and this user is able to login to the normal desktop environment without the login loop.
 The closest similar problem discussion I was able to find online was this post https://askubuntu.com/a/1256736 but unfortunately the solution didn't work for me.

Any help or advice will be really appreciated. I'd prefer to resolve this problem rather than reinstalling and I'd especially like to understand what caused the problem to avoid this situation in future.

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Solved by:
Marcu
Solved:
Last query:
Last reply:
Revision history for this message
actionparsnip (andrew-woodhead666) said :
#1

Does the system have free space and is your user the owner of its entire home directory?

Revision history for this message
Marcu (marcu-knoesen) said :
#2

Thanks for the reply. I can confirm that there was enough free space and that it was not an ownership issue.

For any future travelers who find this thread with the same issue here is what I did to fix it. The link I posted originally mentioned a long `LS_COLORS` variable in their environment variables. I couldn't find a similar variable in my ENV but this morning I thought to check the ~./profile file under my account.

There was a line in the file: `echo "eval \$($(brew --prefix)/bin/brew shellenv)" >>~/.profile`
This command would add the line: `eval $(/home/linuxbrew/.linuxbrew/bin/brew shellenv)` upon every restart. When I opened the file there were thousands of entries of the same line. This coupled with the existing issue of "gnome-session-b[16553]: segfault at ... error 6 in libpcre.so.3.13.3 ..." when there a large environment variable led to the login loop. The timing just happened to coincide with me logging out of my account and that must have crossed the threshold size of the environment variables being too large.

I simply cleared the duplicate entries from my ~./profile file and commented out the line that creates the entries and I'm back in business.

TL DR: If you have the same issue make sure that there are no super long or multiples of any environment variables being generated. These break your ability to login to your account.

Revision history for this message
Nikolay (rbz) said :
#3

Thanks for the nice description and clear explanation. Both the problem and solution were mirrored on my side.
I am back in the game too. Appreciated.

----

For the sake of completion, this how one can verify the existence of the segfault error in their system:

cat /var/log/syslog | grep segfault

It showed a list of error messages along the lines of "gnome-session-b[6402]: segfault [...] error 6 in libpcre.so.3.13.3".