Package: geeqie
Version: 1:1.2-3+b1
Followup-For: Bug #771123

Hi,

I can provide the reproduce steps as follows:

1. Browse a directory with at least 3 photos, for example:

$ ls /tmp/photo
1.jpg 2.jpg 3.jpg

2. As we know that there are three parts of geeqie's layout: 'Tools', 'Images'
and 'Files'. Single click on 1.jpg in the 'Files' and then press 'f' key in the
keyboard at least 8 times, so that you will see the 1.jpg file switch from full
screen window and the geeqie window 4 times.

3. Then quickly use mouse to single click on the 2.jpg in the 'Files', and then
press 'f' key twice quickly. When you see the 2.jpg switch back from fullscreen
to geeqie window, geeqie will crash.

I enabled the core capture options so that I could get the core dump files of
the segmentation fault. I'll upload the sample core dump files for further
investigation.

A brief call trace is here:

$ gdb /usr/bin/geeqie
GNU gdb (Debian 7.7.1+dfsg-5) 7.7.1
Copyright (C) 2014 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from /usr/bin/geeqie...Reading symbols from /usr/lib/debug
/.build-id/76/8fc28af374b76a3e17901ee881bb904753c50b.debug...done.
done.
(gdb) core-file core-9829-1436620292-11-1000-geeqie
[New LWP 9829]
[New LWP 9830]
[New LWP 9831]
[New LWP 9877]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Core was generated by `geeqie'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  0x000000000045cb41 in image_read_ahead_done_cb (il=<optimized out>,
data=0xb52840) at image.c:480
480     image.c: No such file or directory.
(gdb) bt
#0  0x000000000045cb41 in image_read_ahead_done_cb (il=<optimized out>,
data=0xb52840) at image.c:480
#1  0x00007fde080ee474 in _g_closure_invoke_va (closure=0xf1fea0,
closure@entry=0xe13bc0, return_value=0xb52840, return_value@entry=0x0,
instance=0xb52840,
    instance@entry=0xf1fea0, args=0x40000002, args@entry=0x7ffd0d942f60,
n_params=4573904, param_types=0x0) at
/tmp/buildd/glib2.0-2.42.1/./gobject/gclosure.c:831
#2  0x00007fde08108087 in g_signal_emit_valist (instance=0xf1fea0,
signal_id=<optimized out>, detail=0, var_args=var_args@entry=0x7ffd0d942f60)
    at /tmp/buildd/glib2.0-2.42.1/./gobject/gsignal.c:3218
#3  0x00007fde081089df in g_signal_emit (instance=<optimized out>,
signal_id=<optimized out>, detail=detail@entry=0)
    at /tmp/buildd/glib2.0-2.42.1/./gobject/gsignal.c:3365
#4  0x0000000000460023 in image_loader_emit_done_cb (data=<optimized out>) at
image-load.c:273
#5  0x00007fde07e18b6d in g_main_dispatch (context=0x902c00) at
/tmp/buildd/glib2.0-2.42.1/./glib/gmain.c:3111
#6  g_main_context_dispatch (context=context@entry=0x902c00) at
/tmp/buildd/glib2.0-2.42.1/./glib/gmain.c:3710
#7  0x00007fde07e18f48 in g_main_context_iterate (context=0x902c00,
block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>)
    at /tmp/buildd/glib2.0-2.42.1/./glib/gmain.c:3781
#8  0x00007fde07e19272 in g_main_loop_run (loop=0xb943e0) at
/tmp/buildd/glib2.0-2.42.1/./glib/gmain.c:3975
#9  0x00007fde0985e597 in IA__gtk_main () at
/build/gtk+2.0-czQfyJ/gtk+2.0-2.24.25/gtk/gtkmain.c:1257
#10 0x000000000041a60a in main (argc=1, argv=0x7ffd0d9433e8) at main.c:921
(gdb) info threads
  Id   Target Id         Frame
  4    Thread 0x7fddfe034700 (LWP 9877) syscall () at
.../sysdeps/unix/sysv/linux/x86_64/syscall.S:38
  3    Thread 0x7fddff036700 (LWP 9831) 0x00007fde059c550d in poll () at
.../sysdeps/unix/syscall-template.S:81
  2    Thread 0x7fde0010b700 (LWP 9830) 0x00007fde059c550d in poll () at
.../sysdeps/unix/syscall-template.S:81
* 1    Thread 0x7fde09f60980 (LWP 9829) 0x000000000045cb41 in
image_read_ahead_done_cb (il=<optimized out>, data=0xb52840) at image.c:480
(gdb)

It appears that the imd->read_ahead_fd is not set, so does the imd->il, while
the il is NOT NULL - this can be confirmed from the recompiled geeqie with
debug flag enabled by myself.

(gdb) set directories /home/shine/fakeroot/geeqie-1.2.orig/src/
(gdb) show directories
Source directories searched:
/home/shine/fakeroot/geeqie-1.2.orig/src:$cdir:$cwd
(gdb) f 0
#0  0x000000000045cb41 in image_read_ahead_done_cb (il=<optimized out>,
data=0xb52840) at image.c:480
480             if (!imd->read_ahead_fd->pixbuf)
(gdb) l
475     {
476             ImageWindow *imd = data;
477
478             DEBUG_1("%s read ahead done for :%s", get_exec_time(),
imd->read_ahead_fd->path);
479
480             if (!imd->read_ahead_fd->pixbuf)
481                     {
482                     imd->read_ahead_fd->pixbuf =
image_loader_get_pixbuf(imd->read_ahead_il);
483                     if (imd->read_ahead_fd->pixbuf)
484                             {
(gdb) p imd->read_ahead_fd
$1 = (FileData *) 0x0
(gdb) p imd->il
$2 = (ImageLoader *) 0x0
(gdb) p il->fd
value has been optimized out

geeqie is a bit complicated and I could not understand why this call back is
called at the moment. I could only propose a ugly hack for this issue, and I'm
sure that the patch is NOT the right fix unless I could know the logic why the
imd->read_ahead_fd is 0x0.

The ugly patch is in the attachment.

Let me know if anything I can help with.

Thanks,
Flos



-- System Information:
Debian Release: 8.1
  APT prefers stable-updates
  APT policy: (500, 'stable-updates'), (500, 'stable')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 3.16.0-4-amd64 (SMP w/2 CPU cores)
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages geeqie depends on:
ii  geeqie-common        1:1.2-3
ii  libatk1.0-0          2.14.0-1
ii  libc6                2.19-18
ii  libcairo2            1.14.0-2.1
ii  libexiv2-13          0.24-4.1
ii  libfontconfig1       2.11.0-6.3
ii  libfreetype6         2.5.2-3
ii  libgcc1              1:4.9.2-10
ii  libgdk-pixbuf2.0-0   2.31.1-2+b1
ii  libglib2.0-0         2.42.1-1
ii  libgtk2.0-0          2.24.25-3
ii  libjpeg62-turbo      1:1.3.1-12
ii  liblcms2-2           2.6-3+b3
ii  liblircclient0       0.9.0~pre1-1.2
ii  liblua5.1-0          5.1.5-7.1
ii  libpango-1.0-0       1.36.8-3
ii  libpangocairo-1.0-0  1.36.8-3
ii  libpangoft2-1.0-0    1.36.8-3
ii  libstdc++6           4.9.2-10
ii  libtiff5             4.0.3-12.3

Versions of packages geeqie recommends:
ii  cups-bsd [lpr]   1.7.5-11+deb8u1
ii  exiftran         2.09-1+b1
ii  exiv2            0.24-4.1
ii  imagemagick      8:6.8.9.9-5
ii  librsvg2-common  2.40.5-1
ii  ufraw-batch      0.20-2
ii  zenity           3.14.0-1

Versions of packages geeqie suggests:
ii  geeqie-dbg     1:1.2-3+b1
ii  gimp           2.8.14-1+b1
pn  libjpeg-progs  <none>
pn  ufraw          <none>
pn  xpaint         <none>

-- no debconf information
diff -uNr geeqie-1.2.orig/src/image.c geeqie-1.2/src/image.c
--- geeqie-1.2.orig/src/image.c	2014-07-20 21:16:02.000000000 +0800
+++ geeqie-1.2/src/image.c	2015-07-11 20:30:56.685925284 +0800
@@ -475,6 +475,11 @@
 {
 	ImageWindow *imd = data;
 
+	if (!imd->il) {
+		DEBUG_1("DBG: **OOPS** imd->il is 0x%x, must return now.", imd->il);
+		return;
+	}
+
 	DEBUG_1("%s read ahead done for :%s", get_exec_time(), imd->read_ahead_fd->path);
 
 	if (!imd->read_ahead_fd->pixbuf)

Reply via email to