[Digikam-devel] [Bug 269720] Digikam SIGSEGV during face scanning

Richard Mortimer richm+kde at oldelvet.org.uk
Sun May 15 13:48:31 BST 2011


https://bugs.kde.org/show_bug.cgi?id=269720





--- Comment #19 from Richard Mortimer <richm+kde oldelvet org uk>  2011-05-15 14:48:28 ---
I added the --track-origins=yes option to valgrind and ran some face detection
again. This shows that the bulk of the uninitialised memory was allocated in
one place. There are a few more reported after I started recognition but these
only occured once or twice.

Mindful that the full valgrind output is long I have included a couple of
examples below and will attach the full log to the bug. Note that when reading
the full log you will see some notes from myself describing what actions I had
just taken and what was showing on the screen. These are mixed in with the
valgrind output in places as I was just typing direct into the console session.

Just in case it is useful in my setup I am using MySQL on a remote server with
image storage being served from a CIFS mounted server. Running the
2.0.0~beta5-maverick~ppa2 packages on Ubuntu 10.10 with a gnome desktop
environment.

Examples of the valgrind output

1 - The main source of unallocated memory comes from libkface via
KFaceIface::Database::updateFaces  - 81 instances in the log

e.g.

==20826== Thread 17:

==20826== Conditional jump or move depends on uninitialised value(s)

==20826==    at 0x7E63802: ??? (in /usr/lib/libopencv_legacy.so.2.2.0)

==20826==    by 0x7E63CA3: cvEigenProjection (in
/usr/lib/libopencv_legacy.so.2.2.0)

==20826==    by 0x1DF: ???

==20826==  Uninitialised value was created by a heap allocation

==20826==    at 0x4025BD3: malloc (vg_replace_malloc.c:236)

==20826==    by 0x4BBC60E: ??? (in /usr/lib/libkface.so.1.0.0)

==20826==    by 0x4BBCD89: ??? (in /usr/lib/libkface.so.1.0.0)

==20826==    by 0x4BC04CD: ??? (in /usr/lib/libkface.so.1.0.0)

==20826==    by 0x4BAB91B:
KFaceIface::Database::updateFaces(QList<KFaceIface::Face>&) (in
/usr/lib/libkface.so.1.0.0)

==20826==    by 0x4BB303B:
KFaceIface::RecognitionDatabase::updateFaces(QList<KFaceIface::Face>&) (in
/usr/lib/libkface.so.1.0.0)

==20826==    by 0x8318E34:
Digikam::Trainer::process(QExplicitlySharedDataPointer<Digikam::FacePipelineExtendedPackage>)
(facepipeline.cpp:827)

==20826==    by 0x8319249: Digikam::Trainer::qt_metacall(QMetaObject::Call,
int, void**) (facepipeline_p.moc:590)

==20826==    by 0x6F4F8C9: QMetaObject::metacall(QObject*, QMetaObject::Call,
int, void**) (qmetaobject.cpp:237)

==20826==    by 0x6F5ADF5: QMetaCallEvent::placeMetaCall(QObject*)
(qobject.cpp:534)

==20826==    by 0x6F5C6A1: QObject::event(QEvent*) (qobject.cpp:1219)

==20826==    by 0x5157B10: Digikam::WorkerObject::event(QEvent*)
(workerobject.cpp:160)

==20826== 



2 - CEncoder setup. Not sure if this is core KDE or digikam specific (2
instances)

==20826== Conditional jump or move depends on uninitialised value(s)

==20826==    at 0x514A58B: CEncoder::RLESigsAndSigns(unsigned int*, unsigned
int, unsigned int*, unsigned int) (Encoder.cpp:628)

==20826==    by 0x514AF04: CEncoder::BitplaneEncode(unsigned int)
(Encoder.cpp:380)

==20826==    by 0x514B2DE: CEncoder::EncodeBuffer(ROIBlockHeader)
(Encoder.cpp:274)

==20826==    by 0x514B446: CEncoder::WriteValue(CSubband*, int)
(Encoder.cpp:253)

==20826==    by 0x514B532: CEncoder::Partition(CSubband*, int, int, int, int)
(Encoder.cpp:152)

==20826==    by 0x5152AFC: CSubband::ExtractTile(CEncoder&, int, bool, unsigned
int, unsigned int) (Subband.cpp:188)

==20826==    by 0x5151C6E: CPGFImage::Write(CPGFStream*, int, bool (*)(double,
bool, void*), unsigned int*, void*) (PGFimage.cpp:933)

==20826==    by 0x5154CDE: Digikam::writePGFImageData(QImage const&,
QByteArray&, int) (pgfutils.cpp:139)

==20826==    by 0x5133FD3:
Digikam::ThumbnailCreator::storeInDatabase(Digikam::ThumbnailInfo const&,
Digikam::ThumbnailImage const&) const (thumbnailcreator.cpp:695)

==20826==    by 0x5135955: Digikam::ThumbnailCreator::store(QString const&,
QImage const&, QRect const&, bool) const (thumbnailcreator.cpp:391)

==20826==    by 0x5135A29:
Digikam::ThumbnailCreator::storeDetailThumbnail(QString const&, QRect const&,
QImage const&, bool) const (thumbnailcreator.cpp:367)

==20826==    by 0x513846F:
Digikam::ThumbnailLoadThread::storeDetailThumbnail(QString const&, QRect
const&, QImage const&, bool) (thumbnailloadthread.cpp:907)

==20826==  Uninitialised value was created by a stack allocation

==20826==    at 0x514A9C5: CEncoder::BitplaneEncode(unsigned int)
(Encoder.cpp:338)


3 - mysql exec (1 instance)

==20826== Syscall param write(buf) points to uninitialised byte(s)

==20826==    at 0x73DDF7B: ??? (syscall-template.S:82)

==20826==    by 0x12862122: net_real_write (in
/usr/lib/libmysqlclient_r.so.16.0.0)

==20826==    by 0x128623A7: net_flush (in /usr/lib/libmysqlclient_r.so.16.0.0)

==20826==    by 0x12862668: net_write_command (in
/usr/lib/libmysqlclient_r.so.16.0.0)

==20826==    by 0x1285ED37: cli_advanced_command (in
/usr/lib/libmysqlclient_r.so.16.0.0)

==20826==    by 0x1282BE83: cli_stmt_execute (in
/usr/lib/libmysqlclient_r.so.16.0.0)

==20826==    by 0x128297BE: mysql_stmt_execute (in
/usr/lib/libmysqlclient_r.so.16.0.0)

==20826==    by 0x127C97D1: QMYSQLResult::exec() (qsql_mysql.cpp:1031)

==20826==    by 0x4055B0B: QSqlQuery::exec() (qsqlquery.cpp:942)

==20826==    by 0x50EB111:
Digikam::DatabaseCoreBackend::exec(Digikam::SqlQuery&)
(databasecorebackend.cpp:1404)

==20826==    by 0x50ED582:
Digikam::DatabaseCoreBackend::execQuery(Digikam::SqlQuery&, QVariant const&,
QVariant const&, QVariant const&, QVariant const&)
(databasecorebackend.cpp:1076)

==20826==    by 0x50ED5ED: Digikam::DatabaseCoreBackend::execQuery(QString
const&, QVariant const&, QVariant const&, QVariant const&, QVariant const&)
(databasecorebackend.cpp:1021)

==20826==  Address 0x16bec688 is 296 bytes inside a block of size 8,199 alloc'd

==20826==    at 0x4025BD3: malloc (vg_replace_malloc.c:236)

==20826==    by 0x1282E15E: my_malloc (in /usr/lib/libmysqlclient_r.so.16.0.0)

==20826==    by 0x12862E0F: my_net_init (in
/usr/lib/libmysqlclient_r.so.16.0.0)

==20826==    by 0x1285D433: mysql_real_connect (in
/usr/lib/libmysqlclient_r.so.16.0.0)

==20826==    by 0x127CAB12: QMYSQLDriver::open(QString const&, QString const&,
QString const&, QString const&, int, QString const&) (qsql_mysql.cpp:1271)

==20826==    by 0x4057B30: QSqlDatabase::open() (qsqldatabase.cpp:842)

==20826==    by 0x50E868C:
Digikam::DatabaseCoreBackendPrivate::open(QSqlDatabase&)
(databasecorebackend.cpp:218)

==20826==    by 0x50E8E4B:
Digikam::DatabaseCoreBackendPrivate::databaseForThread()
(databasecorebackend.cpp:124)

==20826==    by 0x50E9331: Digikam::DatabaseCoreBackend::getQuery()
(databasecorebackend.cpp:1499)

==20826==    by 0x50EAF18: Digikam::DatabaseCoreBackend::prepareQuery(QString
const&) (databasecorebackend.cpp:1456)

==20826==    by 0x50EDC72: Digikam::DatabaseCoreBackend::execQuery(QString
const&, QVariant const&) (databasecorebackend.cpp:992)

==20826==    by 0x50EDCEF: Digikam::DatabaseCoreBackend::execSql(QString
const&, QVariant const&, QList<QVariant>*, QVariant*)
(databasecorebackend.cpp:894)

==20826==  Uninitialised value was created by a stack allocation

==20826==    at 0x5151346: CPGFImage::Write(CPGFStream*, int, bool (*)(double,
bool, void*), unsigned int*, void*) (PGFimage.cpp:825)

==20826==

-- 
Configure bugmail: https://bugs.kde.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the Digikam-devel mailing list