Crashes when adding a picture

Bug #1221984 reported by Loïc Minier on 2013-09-07
32
This bug affects 6 people
Affects Status Importance Assigned to Milestone
mediascanner
Fix Released
Critical
Jussi Pakkanen
mediascanner (Ubuntu)
High
Unassigned

Bug Description

Hi,

while running automated tests on camera-app, mediaservice crashed; this is the backtrace I extracted from the .crash file:
(gdb) bt
#0 0x4003361c in gst_discoverer_discover_uri ()
   from /usr/lib/arm-linux-gnueabihf/libgstpbutils-1.0.so.0
#1 0x4021bda4 in mediascanner::FileSystemWalker::Private::ScanFile(mediascanner::Wrapper<_GFile, mediascanner::internal::CopyHelper<_GFile> >, mediascanner::FileSystemWalker::Private::ScanDetails) ()
   from /usr/lib/arm-linux-gnueabihf/libmediascanner-1.0.so.1
#2 0x4021d5b2 in boost::detail::function::void_function_obj_invoker0<boost::_bi::bind_t<void, boost::_mfi::mf2<void, mediascanner::FileSystemWalker::Private, mediascanner::Wrapper<_GFile, mediascanner::internal::CopyHelper<_GFile> >, mediascanner::FileSystemWalker::Private::ScanDetails>, boost::_bi::list3<boost::_bi::value<mediascanner::FileSystemWalker::Private*>, boost::_bi::value<mediascanner::Wrapper<_GFile, mediascanner::internal::CopyHelper<_GFile> > >, boost::_bi::value<mediascanner::FileSystemWalker::Private::ScanDetails> > >, void>::invoke(boost::detail::function::function_buffer&) ()
   from /usr/lib/arm-linux-gnueabihf/libmediascanner-1.0.so.1
#3 0x4025f9cc in mediascanner::TaskManager::Private::BackgroundThread(void*)
    () from /usr/lib/arm-linux-gnueabihf/libmediascanner-1.0.so.1
#4 0x4047d912 in ?? () from /lib/arm-linux-gnueabihf/libglib-2.0.so.0
#5 0x4047d912 in ?? () from /lib/arm-linux-gnueabihf/libglib-2.0.so.0
Backtrace stopped: previous frame identical to this frame (corrupt stack?)

Cheers,

Related branches

Loïc Minier (lool) wrote :
Loïc Minier (lool) wrote :
Download full text (3.3 KiB)

Launching with debug:
MEDIASCANNER_DEBUG=+debug gdb /usr/bin/mediascanner-service
(gdb) r
[...]
mediascanner-service[4268]: INFO info/dbus: D-Bus name lost
mediascanner-service[4268]: DEBUG debug/fs-walker: Not changed, ignoring "/home/phablet/Pictures/image20130907_0003.jpg"
mediascanner-service[4268]: DEBUG debug/fs-walker: Scanning "/home/phablet/Pictures/image20130907_0002.jpg"
mediascanner-service[4268]: DEBUG debug/fs-walker: Not changed, ignoring "/home/phablet/Pictures/image20130907_0002.jpg"
mediascanner-service[4268]: DEBUG debug/fs-walker: Scanning "/home/phablet/Pictures/image20130907_0001.jpg"
mediascanner-service[4268]: DEBUG debug/fs-walker: Not changed, ignoring "/home/phablet/Pictures/image20130907_0001.jpg"
mediascanner-service[4268]: INFO info/fs-walker: Scanning directory "/home/phablet/Videos"
mediascanner-service[4268]: INFO info/fs-walker: Finished scanning directories below "/home/phablet/Videos".
mediascanner-service[4268]: INFO info/fs-walker: Finished scanning directories below "/home/phablet/Pictures".
mediascanner-service[4268]: INFO info/fs-walker: Finished scanning directories below "/home/phablet/Music".
mediascanner-service[4268]: INFO info/fs-walker: Finished scanning directories below "/home/phablet/Downloads".
mediascanner-service[4268]: DEBUG debug/fs-scanner: Scanning "/home/phablet/Downloads" just finished.
mediascanner-service[4268]: DEBUG debug/fs-scanner: Scanning "/home/phablet/Music" just finished.
mediascanner-service[4268]: DEBUG debug/fs-scanner: Scanning "/home/phablet/Pictures" just finished.
mediascanner-service[4268]: DEBUG debug/fs-scanner: Scanning "/home/phablet/Videos" just finished.
mediascanner-service[4268]: DEBUG debug/fs-scanner: Last media root scanned, waiting for pending metadata.
mediascanner-service[4268]: DEBUG debug/tasks: Cancelling task 24 of file system scanner
mediascanner-service[4268]: DEBUG debug/tasks: Cancelling task 25 of file system scanner
mediascanner-service[4268]: DEBUG debug/fs-walker: Scanning "/home/phablet/Pictures/image20130907_0004.jpg"

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x446173e0 (LWP 4277)]
gst_discoverer_discover_uri (discoverer=0x0,
    uri=0x12814c "file:///home/phablet/Pictures/image20130907_0004.jpg",
    err=0x44616894) at gstdiscoverer.c:1789
1789 gstdiscoverer.c: No such file or directory.

(gdb) bt 5
#0 gst_discoverer_discover_uri (discoverer=0x0,
    uri=0x12814c "file:///home/phablet/Pictures/image20130907_0004.jpg",
    err=0x44616894) at gstdiscoverer.c:1789
#1 0x400bcda4 in mediascanner::FileSystemWalker::Private::ScanFile (
    this=0x106310, file=...,
    details=mediascanner::FileSystemWalker::Private::ScanAll)
    at /build/buildd/mediascanner-0.3.93+13.10.20130906.2/src/mediascanner/filesystemwalker.cpp:841
#2 0x400be5b2 in operator() (
    a2=mediascanner::FileSystemWalker::Private::ScanAll, a1=..., p=0x106310,
    this=<optimized out>) at /usr/include/boost/bind/mem_fn_template.hpp:280
#3 operator()<boost::_mfi::mf2<void, mediascanner::FileSystemWalker::Private, mediascanner::Wrapper<_GFile>, mediascanner::FileSystemWalker::Private::ScanDetails>, boost::_bi::list0...

Read more...

Loïc Minier (lool) wrote :

NB: I took a picture just after this line:
mediascanner-service[4268]: DEBUG debug/fs-scanner: Last media root scanned, waiting for pending metadata.

Loïc Minier (lool) on 2013-09-07
summary: - Crashes under automation
+ Crashes when adding a picture
Paweł Stołowski (stolowski) wrote :

Note there is a related bug https://bugs.launchpad.net/mediascanner/+bug/1222731, only the crash happens when files get removed.

Changed in mediascanner:
status: New → Confirmed
importance: Undecided → Critical
Paweł Stołowski (stolowski) wrote :

After quick analysis, it seems discoverer_ is null when passed to gst_discoverer_discover_uri, and this is because it gets destroyed after all directories are scanned in FileSystemWalker::Private::NotifyFinished.

Loïc Minier (lool) on 2013-09-12
Changed in mediascanner (Ubuntu):
status: New → Confirmed
importance: Undecided → High
Changed in mediascanner:
assignee: nobody → Pawel Stolowski (stolowski)
Julien Funk (jaboing) on 2013-09-17
tags: added: avengers
Changed in mediascanner:
assignee: Pawel Stolowski (stolowski) → Jussi Pakkanen (jpakkane)
Changed in mediascanner:
status: Confirmed → Fix Committed
Loïc Minier (lool) wrote :

Fixed in 0.3.93+13.10.20130918.1-0ubuntu1:
mediascanner (0.3.93+13.10.20130918.1-0ubuntu1) saucy; urgency=low

  [ Jussi Pakkanen ]
  * Quickfix for crasher. (LP: #1222731)
  * Replace boost::bind with std::bind. (LP: #1223906)

  [ Ubuntu daily release ]
  * Automatic snapshot from revision 383
 -- Ubuntu daily release <email address hidden> Wed, 18 Sep 2013 07:59:17 +0000

Changed in mediascanner:
status: Fix Committed → Fix Released
Changed in mediascanner (Ubuntu):
status: Confirmed → Fix Released
Changed in mediascanner:
status: Fix Released → Fix Committed
Michal Hruby (mhr3) on 2013-10-10
Changed in mediascanner:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Bug attachments