Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 261967 - media-libs/libgphoto2-2.4.4 randomly segfaults
Summary: media-libs/libgphoto2-2.4.4 randomly segfaults
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: x86 Linux
: High minor (vote)
Assignee: Gentoo Linux Gnome Desktop Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-03-10 12:04 UTC by Alexander Soloviëv
Modified: 2009-05-16 08:56 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
gphoto2-filesys.patch (gphoto2-filesys.patch,68.51 KB, patch)
2009-03-17 20:56 UTC, f5d8fd51ed1e804c9e8d0357e8614e0493b06e96
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Alexander Soloviëv 2009-03-10 12:04:28 UTC
Segfaults always arises as pointed below. 

Reproducible: Always

Steps to Reproduce:
1. Connecting camera to USB
2. Fetching all photos: gphoto2 -P

Actual Results:  
$ gphoto2 -P
Downloading 'curve.ntc' from folder '/special'...
File curve.ntc exists. Overwrite? [y|n] y
Saving file as curve.ntc
Segmentation fault



Portage 2.1.6.7 (default/linux/x86/2008.0, gcc-4.3.3, glibc-2.9_p20081201-r2, 2.6.28-hardened-r1 i686)
=================================================================
System uname: Linux-2.6.28-hardened-r1-i686-Intel-R-_Pentium-R-_Dual_CPU_E2160_@_1.80GHz-with-glibc2.0
Timestamp of tree: Mon, 09 Mar 2009 18:00:01 +0000
ccache version 2.4 [enabled]
app-shells/bash:     3.2_p48-r1
dev-java/java-config: 1.3.7, 2.1.2-r1
dev-lang/python:     2.5.4-r2
dev-python/pycrypto: 2.0.1-r6
dev-util/ccache:     2.4-r7
dev-util/cmake:      2.4.7-r1
sys-apps/baselayout: 2.0.0
sys-apps/openrc:     0.4.3-r1
sys-apps/sandbox:    1.4
sys-devel/autoconf:  2.13, 2.63
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10.2
sys-devel/binutils:  2.19.1
sys-devel/gcc-config: 1.4.1
sys-devel/libtool:   1.5.26
virtual/os-headers:  2.6.28-r1
ACCEPT_KEYWORDS="x86 ~x86"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-march=core2 -O2 -pipe"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/3.3/env /usr/kde/3.3/share/config /usr/kde/3.3/shutdown /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/share/config"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/eselect/postgresql /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/web2c /etc/udev/rules.d"
CXXFLAGS="-march=core2 -O2 -pipe"
DISTDIR="/var/db/portage/distfiles"
FEATURES="ccache distlocks fixpackages parallel-fetch protect-owned sandbox sfperms strict unmerge-orphans userfetch"
GENTOO_MIRRORS="ftp://c.aliki.ru/pub/mirror/gentoo"
LANG="ru_RU.UTF-8"
LDFLAGS="-Wl,-O1"
LINGUAS="en"
MAKEOPTS="-j3"
PKGDIR="/var/db/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/var/db/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="X acl acpi alsa avi bash-completion berkdb bzip2 cairo chroot cli consolekit cracklib crypt cups dba dbus divx4linux dri exif fbcon fontconfig fortran gdbm gif gnutls gtk2 hal iconv ipv6 isdnlog jbig jpeg jpeg2k lcms matroska memlimit midi mmx mpeg mudflap ncurses nptl nptlonly nvidia openexr opengl openmp pam pch pcre pic png pppd python qt qt4 readline reflection rtc sasl session spl sse sse2 ssl ssse3 svg sysfs tcpd threads tiff unicode usb x86 xorg xv xvid xvmc zlib" ALSA_CARDS="emu10k1" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="authz_groupfile authz_user authz_owner authn_file auth_basic authz_svn_module filter unique_id access authz_host auth auth_dbm auth_anon auth_digest alias file_cache echo charset_lite cache disk_cache mem_cache ext_filter case_filter case_filter_in deflate mime_magic cern_meta expires headers usertrack proxy proxy_connect proxy_ftp proxy_http info include cgi cgid dav dav_fs dav_lock vhost_alias speling rewrite log_config logio env setenvif mime status autoindex asis negotiation dir actions so" APACHE2_MPMS="worker" ELIBC="glibc" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="en" USERLAND="GNU" VIDEO_CARDS="v4l fbcon vesa nvidia"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, FFLAGS, INSTALL_MASK, LC_ALL, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 1 Gilles Dartiguelongue (RETIRED) gentoo-dev 2009-03-10 13:00:14 UTC
no backtrace, no chocolate :)

please read [1] and provide us with some data. upstream will require it anyway.

[1]: http://www.gentoo.org/proj/en/qa/backtraces.xml
Comment 2 Alexander Soloviëv 2009-03-10 21:21:33 UTC
Core was generated by `gphoto2 -P'.
Program terminated with signal 11, Segmentation fault.
[New process 23936]
#0  fixup_lru_chain (fs=0x80645a8, old=0x0, new=0x8064600, prevcount=0)
    at gphoto2-filesys.c:509
509     gphoto2-filesys.c: No such file or directory.
        in gphoto2-filesys.c
(gdb) bt
#0  fixup_lru_chain (fs=0x80645a8, old=0x0, new=0x8064600, prevcount=0)
    at gphoto2-filesys.c:509
#1  0xb7f34be0 in gp_filesystem_append (fs=0x80645a8,
    folder=0x806db10 "/store_00010001/DCIM/100ND70S",
    filename=0x815c51c "DSC_4253.NEF", context=0x80663e0)
    at gphoto2-filesys.c:745
#2  0xb7f34e7b in gp_filesystem_list_files (fs=0x80645a8,
    folder=0x806db10 "/store_00010001/DCIM/100ND70S", list=0x815c518,
    context=0x80663e0) at gphoto2-filesys.c:962
#3  0xb7f2df2b in gp_camera_folder_list_files (camera=0x8063348,
    folder=0x806db10 "/store_00010001/DCIM/100ND70S", list=0x815c518,
    context=0x80663e0) at gphoto2-camera.c:1071
#4  0x08050bb5 in for_each_file (p=0x8062a00,
    action=0x804fc80 <save_file_action>) at foreach.c:135
#5  0x08050d7b in for_each_file (p=0x8062a00,
    action=0x804fc80 <save_file_action>) at foreach.c:174
#6  0x08050d7b in for_each_file (p=0x8062a00,
    action=0x804fc80 <save_file_action>) at foreach.c:174
#7  0x08050d7b in for_each_file (p=0x8062a00,
    action=0x804fc80 <save_file_action>) at foreach.c:174
#8  0x08056cd4 in cb_arg (ctx=0x8066428, reason=POPT_CALLBACK_REASON_OPTION,
    opt=0xbffaf1b4, arg=0x0, data=0xbffafb58) at main.c:1281
#9  0xb7ea90c3 in poptGetNextOpt (con=0xbffafb58) at popt.c:769
#10 0xb7ea9102 in poptGetNextOpt (con=0xbffafb58) at popt.c:765
#11 0xb7ea9f37 in poptFreeContext (con=0x8066428) at poptint.h:21
#12 0x080551a7 in main (argc=2, argv=0xbffafc34, envp=0x63) at main.c:2025
Comment 3 Alexander Soloviëv 2009-03-10 21:53:20 UTC
I've found similar bug in SF gphoto page:

http://sourceforge.net/tracker/?func=detail&atid=108874&aid=2632453&group_id=8874
Comment 4 f5d8fd51ed1e804c9e8d0357e8614e0493b06e96 2009-03-17 20:56:18 UTC
Created attachment 185347 [details, diff]
gphoto2-filesys.patch

This patch is taken from upstream SVN rev 11858 and cleans up many thing in gphoto2-filesys.c. (The place the segfault occours in).
The commit comment was:
make filesystem handling dynamic, removed static limits etc.

For me everything works just fine after applying this patch.
(I weren't experiencing any segfaults, but valgrind told me about many conditional jump depending on uninitialised values.
Not those reports are gone and retrieving images still works just fine.)
Comment 5 Alexander Soloviëv 2009-03-17 22:48:40 UTC
I think this version of libgphoto2 should be masked.
Comment 6 Gilles Dartiguelongue (RETIRED) gentoo-dev 2009-03-17 23:59:12 UTC
I would be nice if this patch only changed what is strictly necessary. As it is, it is difficult to analyse pertinence of the changes that makes the bug go away.
Comment 7 f5d8fd51ed1e804c9e8d0357e8614e0493b06e96 2009-03-18 07:21:11 UTC
I think upstream made those changes for a reason - they considered fixup_lru_chain a hack to fix the mess caused by another hack.

So i think we have basically three options:
 - mask this version (after checking previous versions don't sufer from this issue)
 - apply the huge patch that upstream provided (maybe in a pmasked version) and let people test it
 - try to get in contact with upstream and ask them if they are able to provide a "minimal fix" for the issue - or ask them if the current patch is to be considered their minimal fix. (leaving it to us to come up with a patch that doesn't change houndreds of lines of code)
Comment 8 Hanno Böck gentoo-dev 2009-05-16 08:56:08 UTC
2.4.5 is in tree, so the upstream patch is in.