prikhi / lightdm-mini-greeter

A Minimal, Configurable, Single-User GTK3 LightDM Greeter
GNU General Public License v3.0
532 stars 48 forks source link

The new version is resulting in a core dump for me: #70

Closed simdimdim closed 3 years ago

simdimdim commented 3 years ago

Hey there, tried out 0.5.0-1 from the AUR (on arch) and the result was

Process 32728 (lightdm-mini-gr) of user 620 dumped core. Stack trace of thread 32728:

0 0x00007ffabc0f8ef5 raise (libc.so.6 + 0x3cef5)

  #1  0x00007ffabc0e2862 abort (libc.so.6 + 0x26862)
  #2  0x00007ffabc13af38 __libc_message (libc.so.6 + 0x7ef38)
  #3  0x00007ffabc142bea malloc_printerr (libc.so.6 + 0x86bea)
  #4  0x00007ffabc144470 _int_free (libc.so.6 + 0x88470)
  #5  0x00007ffabc147ca8 __libc_free (libc.so.6 + 0x8bca8)
  #6  0x00005556819239fc n/a (lightdm-mini-greeter + 0x39fc)
  #7  0x000055568192325c n/a (lightdm-mini-greeter + 0x325c)
  #8  0x0000555681923065 n/a (lightdm-mini-greeter + 0x3065)
  #9  0x00007ffabc0e3b25 __libc_start_main (libc.so.6 + 0x27b25)
  #10 0x000055568192313e n/a (lightdm-mini-greeter + 0x313e)

pacman -F libc.so.6
core/glibc 2.30-3 [installed: 2.33-4] usr/lib/libc.so.6 core/lib32-glibc 2.30-3 [installed: 2.33-4] usr/lib32/libc.so.6 community/aarch64-linux-gnu-glibc 2.30-1 usr/aarch64-linux-gnu/lib/libc.so.6 community/riscv64-linux-gnu-glibc 2.30-1 (risc-v) usr/riscv64-linux-gnu/lib/libc.so.6

-- Compiler and Linker Flags 0.5.0 was compiled with

CPPFLAGS="-D_FORTIFY_SOURCE=2" CFLAGS="-march=native -O3 -pipe -fno-plt" CXXFLAGS="${CFLAGS}" LDFLAGS="-Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now"

-- Make Flags: change this for DistCC/SMP systems

MAKEFLAGS="-j6"

hope it's a simple thing to fix, (and thanks for the nice greeter :))

hartzan commented 3 years ago

Same thing here, installed from AUR.

Lapdogpdx commented 3 years ago

Was running into the same problem here as well using lightdm-mini-greeter 0.5.0-1 installed via AUR. There's a new config file that needs to be used with around 30 additional lines of code in the newest update. I didn't realize this until I uninstalled lightdm-mini-greeter and installed lightdm-mini-greeter-git 0.3.4.r0.4244751-1, thereby removing any old config file and replacing it with the new one. The new config file MUST be used and it looks like this has to be copied over to your /etc/lightdm directory manually.

Not entirely sure which lines in the new config seem to be causing the problem, but that is what fixed it (a workaround, to be sure) for me. The new lines pertain to new password customization, for what it's worth. It's a bit of a sketchy bug as there were times where it to get stuck in a sort of prolonged loop trying to load up the greeter, preventing me from getting into a tty.

A minor downside is to this 'fix' is that you have to reconfig the file. Shouldn't take long, though, as it's still a short text file.

What the old config file looked like, for anyone curious: https://pastebin.com/ihQaJnW4

And what the new one looks like: https://github.com/prikhi/lightdm-mini-greeter/blob/master/data/lightdm-mini-greeter.conf

hartzan commented 3 years ago

Thanks, new config fixed it !!

Lapdogpdx commented 3 years ago

Thanks, new config fixed it !!

Happy it helped:)

simdimdim commented 3 years ago

Thanks ~

prikhi commented 3 years ago

Hmm, I wonder what caused this, I usually test new options without putting them in my config file first. Maybe it doesn't like me trying to call free on the default strings when an option is missing? My old config is working fine after an upgrade & it's missing the password-input-width, show-image-on-all-monitors, password-character, & password-border-radius options.

I'll try repro'ing w/ the config @Lapdogpdx provided, been trying to avoid this issue & making sure old configs are compatible with new releases.

Also, check out pacdiff in the pacman-contrib package. It'll let you view, merge, remove, & overwrite the pacnew files that get installed when you upgrade a package.

Lapdogpdx commented 3 years ago

Thank you @prikhi for re-opening and taking a look at this.

I'll admit I didn't really do any hard testing when comparing the files, but when I get a a chance today I'll try and do some real test and comparisons with the files. Like I said above, at a glance I also didn't see anything, but today is a new day;)

Lapdogpdx commented 3 years ago

My old config is working fine after an upgrade & it's missing the password-input-width, show-image-on-all-monitors, password-character, & password-border-radius options.

@prikhi It looks like it fails when password-alignment is left out of the config. The other lines, when removed/commented out do not seem to adversely affect startup of the login screen. Even if the password-alignment value is left empty the login screen will still launch normally. From what I can tell the password-alignment line must be included in the config. None of the other newly added lines seem to have an adverse affect on login screen startup when they are left out of the config file.

Printout of lightdm --test-mode --debug normal startup: https://pastebin.com/Ykb6Rf8z

Printout of lightdm --test-mode --debug during failed startup: https://pastebin.com/NL8UBNVf

Log from ~/.cache/lightdm/log/seat0-greeter.log normal startup: https://pastebin.com/3qnuQUa2 Not sure what Fatal IO error 11 means in my case, but the login screen starts up correctly regardless.

Log from ~/.cache/lightdm/log/seat0-greeter.log failed startup: https://pastebin.com/SCMbPnfN --notice: free(): invalid pointer

I hope this information is useful to you @prikhi .

prikhi commented 3 years ago

That's great thanks. Think I figured out what's causing this, I'll push a fix & new version out in the next day or two.

Lapdogpdx commented 3 years ago

Good to hear. Look forward to seeing what it might have been. Thanks for your continued efforts on the project. Been using lightdm mini for several years now:)

prikhi commented 3 years ago

Fixed by 791721e

prikhi commented 3 years ago

@Lapdogpdx

Look forward to seeing what it might have been.

I guess it's because I was calling free() on the string parsed from the config after converting it to the float that GTK expects. Works fine if present because the string is malloc()'d, but fails when we use the fallback string - probably because it's a static, compile-time string that lives in a different memory region than malloc()'d memory.

Been using lightdm mini for several years now

Thank you! That really means a lot & I'm glad you got plenty of use out of my first attempt at writing a useful C program lol :heart:

Lapdogpdx commented 3 years ago

Works fine if present because the string is malloc()'d, but fails when we use the fallback string - probably because it's a static, compile-time string that lives in a different memory region than malloc()'d memory.

Not gonna pretend I know what most of that means, lol. But I am certainly glad that you found a fix!

I figured it had something to do with the free(): invalid pointer error I saw above, and with something "float" because that is what I saw when I was looking through some of the source code associating with password-alignment. Had no idea how to pin down the why they were causing the crash, though, as I'm pretty low level when it comes to my coding skills.

And lightdm-mini-greeter is definitely useful! I've tried others thinking maybe a change would be nice, but never last more than a couple hours before I just switch back. It's perfectly minimal. With just enough room to tweak things. I'll definitely have to check out some of the extra customizable features you added to this last iteration. Thanks again:)