i3 / i3lock

improved screen locker
https://i3wm.org/i3lock
BSD 3-Clause "New" or "Revised" License
921 stars 404 forks source link

segfault with jpg #186

Closed mihandrei closed 6 years ago

mihandrei commented 6 years ago

jpg seems not to be supported but you should avoid segfaulting.

i3lock: version 2.9.1

$ i3lock -i lala.jpg
segmentation fault (core dumped)

(gdb) backtrace
 in png_get_IHDR () at /lib64/libpng16.so.16
 in read_png () at /lib64/libcairo.so.2
 in cairo_image_surface_create_from_png ()
    at /lib64/libcairo.so.2
 in main ()

$ ldd /usr/bin/i3lock
  libcairo.so.2 => /lib64/libcairo.so.2

$ ldconfig -v | grep cairo
libcairo.so.2 -> libcairo.so.2.11510.0

Installed on fedora 27 via dnf

mihandrei commented 6 years ago

It seems to be cairo's fault. This hangs:

from ctypes import *

def main(pth):
    pth = pth.encode()                                                   
    lib = cdll.LoadLibrary('/lib64/libcairo.so.2')
    cpth = c_char_p(pth)
    ret = lib.cairo_image_surface_create_from_png(cpth)    
Airblader commented 6 years ago

Thanks for investigating. I think this is problably resolved by #171 already, but the next version hasn't yet been released. Could you please confirm that the current git HEAD doesn't behave this way?

stapelberg commented 6 years ago

This is very likely solved with #171, which is included in i3lock 2.11. Closing.