[Digikam-devel] Crash when using CIMG image resizing in Digikam SVN

Thorsten Schnebeck thorsten.schnebeck at gmx.net
Sat Mar 24 21:18:34 GMT 2007


Am Samstag 24 März 2007 schrieb Gilles Caulier:
> I cannot reproduce it. In your backtrace, there is no info relevant of the
> plugin. If you can, start digiKam in GDB and try again
>
> Also, recently there are a lots of change in core. To be sure, I recommend
> you to cleanup all source code and recompile from scratch digiKam & co.

I recompile from scratch everytime I have a change in a Makefile.am during SVN 
update  :-)

Ok here is a gdb session:

digikam: GreycstorationIface::Initialization...
digikam: GreycstorationIface::Process Computation...
digikam: Resizing image: size 575 x 496, value range [0 , 255]
[New Thread -1364300912 (LWP 303)]
[New Thread -1328039024 (LWP 304)]
kdecore (KAcceleratorManager): KAcceleratorManager::manage
kdecore (KAcceleratorManager): findAccelerators
[Thread -1328039024 (LWP 304) exited]
[New Thread -1493476464 (LWP 350)]
[New Thread -1501869168 (LWP 351)]
[Thread -1364300912 (LWP 303) exited]

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread -1501869168 (LWP 351)]
0xb5c1162c in memcpy () from /lib/libc.so.6
(gdb) bt
#0  0xb5c1162c in memcpy () from /lib/libc.so.6
#1  0xb7df0c68 in cimg_library::CImg<float>::draw_image (this=0xb1c04678, 
sprite=@0xa67b3ea4, x0=<value optimized out>, y0=<value optimized out>, 
z0=<value optimized out>,
    v0=0, opacity=1) at CImg.h:11228
#2  0xb7dfe881 in cimg_library::CImg<float>::greycstoration_thread 
(arg=0x8e456bc) at greycstoration.h:156
#3  0xb5ea64bb in start_thread () from /lib/libpthread.so.0
#4  0xb5c6376e in clone () from /lib/libc.so.6

As the crash starts in memcopy here is the end of a valgrind session:

digikam: GreycstorationIface::Resize: new size: (1911, 2025)
digikam: GreycstorationIface::Initialization...
digikam: GreycstorationIface::Process Computation...
digikam: Resizing image: size 501 x 531, value range [0 , 255]
kdecore (KAcceleratorManager): KAcceleratorManager::manage
kdecore (KAcceleratorManager): findAccelerators
kdecore (KAcceleratorManager): KAcceleratorManager::manage
kdecore (KAcceleratorManager): findAccelerators
==6402==
==6402== Thread 6:
==6402== Invalid read of size 1
==6402==    at 0x1BC15E8B: cimg_library::CImg<float>& 
cimg_library::CImg<float>::blur_anisotropic<unsigned 
char>(cimg_library::CImg<unsigned char> const&, float, float, float, float, 
float, float, float, float, unsigned, bool) (CImg.h:14487)
==6402==  Address 0x1DD1CB70 is 0 bytes inside a block of size 8 free'd
==6402==    at 0x1B9099A3: operator delete(void*) (vg_replace_malloc.c:155)
==6402==    by 0x1BC83E27: Digikam::ImageResize::customEvent(QCustomEvent*) 
(imageresize.cpp:553)
==6402==
==6402== Invalid read of size 4
==6402==    at 0x1BBFC824: cimg_library::CImg<float>::is_empty() const 
(CImg.h:6772)
==6402==  Address 0x2507B03C is not stack'd, malloc'd or (recently) free'd
==6402==
==6402== Invalid read of size 4
==6402==    at 0x1BBFC82B: cimg_library::CImg<float>::is_empty() const 
(CImg.h:6772)
==6402==  Address 0x2507B028 is not stack'd, malloc'd or (recently) free'd
==6402==
==6402== Invalid read of size 4
==6402==    at 0x1BBFC831: cimg_library::CImg<float>::is_empty() const 
(CImg.h:6772)
==6402==  Address 0x2507B02C is not stack'd, malloc'd or (recently) free'd
==6402==
==6402== Invalid read of size 4
==6402==    at 0x1BBFC838: cimg_library::CImg<float>::is_empty() const 
(CImg.h:6772)
==6402==  Address 0x2507B030 is not stack'd, malloc'd or (recently) free'd
==6402==
==6402== Invalid read of size 4
==6402==    at 0x1BBFC846: cimg_library::CImg<float>::is_empty() const 
(CImg.h:6772)
==6402==  Address 0x2507B034 is not stack'd, malloc'd or (recently) free'd
==6402==
==6402== Invalid read of size 4
==6402==    at 0x1BBFC1B4: cimg_library::CImg<float>::dimx() const 
(CImg.h:6687)
==6402==  Address 0x2507B028 is not stack'd, malloc'd or (recently) free'd
==6402==
==6402== Invalid read of size 4
==6402==    at 0x1BBFC1C4: cimg_library::CImg<float>::dimy() const 
(CImg.h:6695)
==6402==  Address 0x2507B02C is not stack'd, malloc'd or (recently) free'd
==6402==
==6402== Invalid read of size 4
==6402==    at 0x1BBFCB54: cimg_library::CImg<float>::dimz() const 
(CImg.h:6703)
==6402==  Address 0x2507B030 is not stack'd, malloc'd or (recently) free'd
==6402==
==6402== Invalid read of size 4
==6402==    at 0x1BBFCB64: cimg_library::CImg<float>::dimv() const 
(CImg.h:6711)
==6402==  Address 0x2507B034 is not stack'd, malloc'd or (recently) free'd
==6402==
==6402== Invalid read of size 4
==6402==    at 0x1BC089E1: 
cimg_library::CImg<float>::draw_image(cimg_library::CImg<float> const&, int, 
int, int, int, float) (CImg.h:11219)
==6402==  Address 0x2507B028 is not stack'd, malloc'd or (recently) free'd
==6402==
==6402== Invalid read of size 4
==6402==    at 0x1BC08A14: 
cimg_library::CImg<float>::draw_image(cimg_library::CImg<float> const&, int, 
int, int, int, float) (CImg.h:11220)
==6402==  Address 0x2507B02C is not stack'd, malloc'd or (recently) free'd
==6402==
==6402== Invalid read of size 4
==6402==    at 0x1BC08A51: 
cimg_library::CImg<float>::draw_image(cimg_library::CImg<float> const&, int, 
int, int, int, float) (CImg.h:11221)
==6402==  Address 0x2507B030 is not stack'd, malloc'd or (recently) free'd
==6402==
==6402== Invalid read of size 4
==6402==    at 0x1BBFC3E2: cimg_library::CImg<float>::offset(int, int, int, 
int) const (CImg.h:6793)
==6402==  Address 0x2507B028 is not stack'd, malloc'd or (recently) free'd
==6402==
==6402== Invalid read of size 4
==6402==    at 0x1BBFC3E4: cimg_library::CImg<float>::offset(int, int, int, 
int) const (CImg.h:6793)
==6402==  Address 0x2507B02C is not stack'd, malloc'd or (recently) free'd
==6402==
==6402== Invalid read of size 4
==6402==    at 0x1BBFC3FE: cimg_library::CImg<float>::offset(int, int, int, 
int) const (CImg.h:6793)
==6402==  Address 0x2507B030 is not stack'd, malloc'd or (recently) free'd
==6402==
==6402== Invalid read of size 4
==6402==    at 0x1BBFC9D2: cimg_library::CImg<float>::ptr(unsigned, unsigned, 
unsigned, unsigned) (CImg.h:6816)
==6402==  Address 0x2507B03C is not stack'd, malloc'd or (recently) free'd
==6402==
==6402== Invalid write of size 1
==6402==    at 0x1B90A7DD: memcpy (mac_replace_strmem.c:285)
==6402==    by 0x1BC08C67: 
cimg_library::CImg<float>::draw_image(cimg_library::CImg<float> const&, int, 
int, int, int, float) (CImg.h:11228)
==6402==  Address 0x2F78802B is not stack'd, malloc'd or (recently) free'd
==6402==
==6402== Invalid write of size 1
==6402==    at 0x1B90A7E4: memcpy (mac_replace_strmem.c:286)
==6402==    by 0x1BC08C67: 
cimg_library::CImg<float>::draw_image(cimg_library::CImg<float> const&, int, 
int, int, int, float) (CImg.h:11228)
==6402==  Address 0x2F78802A is not stack'd, malloc'd or (recently) free'd
==6402==
==6402== Invalid write of size 1
==6402==    at 0x1B90A7EB: memcpy (mac_replace_strmem.c:287)
==6402==    by 0x1BC08C67: 
cimg_library::CImg<float>::draw_image(cimg_library::CImg<float> const&, int, 
int, int, int, float) (CImg.h:11228)
==6402==  Address 0x2F788029 is not stack'd, malloc'd or (recently) free'd
==6402==
==6402== Invalid write of size 1
==6402==    at 0x1B90A7F2: memcpy (mac_replace_strmem.c:288)
==6402==    by 0x1BC08C67: 
cimg_library::CImg<float>::draw_image(cimg_library::CImg<float> const&, int, 
int, int, int, float) (CImg.h:11228)
==6402==  Address 0x2F788028 is not stack'd, malloc'd or (recently) free'd
==6402==
==6402== Invalid read of size 4
==6402==    at 0x1BC08C7D: 
cimg_library::CImg<float>::draw_image(cimg_library::CImg<float> const&, int, 
int, int, int, float) (CImg.h:11228)
==6402==  Address 0x2507B028 is not stack'd, malloc'd or (recently) free'd
==6402==
==6402== Invalid read of size 1
==6402==    at 0x1BC166BB: 
cimg_library::CImg<float>::greycstoration_thread(void*) 
(greycstoration.h:144)
==6402==  Address 0x1DD1CB70 is not stack'd, malloc'd or (recently) free'd
==6402==
==6402== Invalid read of size 1
==6402==    at 0x1BC1690E: 
cimg_library::CImg<float>::greycstoration_thread(void*) 
(greycstoration.h:143)
==6402==  Address 0x1DD1CB70 is not stack'd, malloc'd or (recently) free'd
KCrash: crashing... crashRecursionCounter = 2
KCrash: Application Name = digikam path = <unknown> pid = 6402
QSocketNotifier: invalid socket 18 and type 'Read', disabling...
QSocketNotifier: invalid socket 14 and type 'Read', disabling...
QSocketNotifier: invalid socket 8 and type 'Read', disabling...
QSocketNotifier: invalid socket 17 and type 'Read', disabling...
QSocketNotifier: invalid socket 12 and type 'Read', disabling...
digikam: Fatal IO error: client killed
==6402==
==6402== ERROR SUMMARY: 6319910 errors from 38 contexts (suppressed: 7 from 1)
==6402== malloc/free: in use at exit: 177121583 bytes in 402523 blocks.
==6402== malloc/free: 10944244 allocs, 10541716 frees, 1058099670 bytes 
allocated.
==6402== For counts of detected errors, rerun with: -v
==6402== searching for pointers to 402523 not-freed blocks.
==6402== checked 230188972 bytes.
==6402==
==6402==
==6402== 1 bytes in 1 blocks are definitely lost in loss record 5 of 2474
==6402==    at 0x1B909441: operator new(unsigned) (vg_replace_malloc.c:132)
==6402==    by 0x1BC0B262: 
cimg_library::CImg<float>::greycstoration_run(cimg_library::CImg<unsigned 
char> const&, float, float, float, float, float, float, float, float, 
unsigned, bool, unsigned, unsigned, unsigned) (greycstoration.h:256)
==6402==
==6402==
==6402== 216 bytes in 1 blocks are definitely lost in loss record 1398 of 2474
==6402==    at 0x1B9092C5: malloc (vg_replace_malloc.c:130)
==6402==    by 0x1D905209: _XimOpenIM (in /usr/lib/libX11.so.6.2.0)
==6402==
==6402==
==6402== 312 (72 direct, 240 indirect) bytes in 2 blocks are definitely lost 
in loss record 1454 of 2474
==6402==    at 0x1B9092C5: malloc (vg_replace_malloc.c:130)
==6402==    by 0x1DC59799: (within /lib/libc-2.5.so)
==6402==    by 0x1DC59E85: __nss_database_lookup (in /lib/libc-2.5.so)
==6402==    by 0x1E10B079: ???
==6402==    by 0x1E10BDAA: ???
==6402==    by 0x1DC17294: getpwuid_r (in /lib/libc-2.5.so)
==6402==    by 0x1DC16C98: getpwuid (in /lib/libc-2.5.so)
==6402==    by 0x1D09223C: (within /usr/qt/3/lib/libqt-mt.so.3.3.6)
==6402==    by 0x1D092B21: (within /usr/qt/3/lib/libqt-mt.so.3.3.6)
==6402==    by 0x1D86DE27: _SmcProcessMessage (in /usr/lib/libSM.so.6.0.0)
==6402==
==6402==
==6402== 208 (128 direct, 80 indirect) bytes in 1 blocks are definitely lost 
in loss record 1578 of 2474
==6402==    at 0x1B9092C5: malloc (vg_replace_malloc.c:130)
==6402==    by 0x1D6932BB: (within /usr/lib/libfontconfig.so.1.2.0)
==6402==
==6402==
==6402== 152 bytes in 4 blocks are definitely lost in loss record 1594 of 2474
==6402==    at 0x1B9092C5: malloc (vg_replace_malloc.c:130)
==6402==    by 0x1B8EE5DE: _dl_new_object (in /lib/ld-2.5.so)
==6402==    by 0x1B8EA367: _dl_map_object_from_fd (in /lib/ld-2.5.so)
==6402==    by 0x1B8EC239: _dl_map_object (in /lib/ld-2.5.so)
==6402==    by 0x1B8EFFE5: openaux (in /lib/ld-2.5.so)
==6402==    by 0x1B8F1811: _dl_catch_error (in /lib/ld-2.5.so)
==6402==    by 0x1B8F01DF: _dl_map_object_deps (in /lib/ld-2.5.so)
==6402==    by 0x1B8F570E: dl_open_worker (in /lib/ld-2.5.so)
==6402==    by 0x1B8F1811: _dl_catch_error (in /lib/ld-2.5.so)
==6402==    by 0x1B8F51D8: _dl_open (in /lib/ld-2.5.so)
==6402==    by 0x1DA80E3C: (within /lib/libdl-2.5.so)
==6402==    by 0x1B8F1811: _dl_catch_error (in /lib/ld-2.5.so)
==6402==
==6402==
==6402== 228 bytes in 1 blocks are possibly lost in loss record 1683 of 2474
==6402==    at 0x1B90968A: operator new[](unsigned) (vg_replace_malloc.c:138)
==6402==    by 0x1BF89D44: QValueVectorPrivate<QRegExp>::growAndCopy(unsigned, 
QRegExp*, QRegExp*) (qvaluevector.h:223)
==6402==
==6402==
==6402== 360 bytes in 21 blocks are possibly lost in loss record 1809 of 2474
==6402==    at 0x1B909441: operator new(unsigned) (vg_replace_malloc.c:132)
==6402==    by 0x1DB128D3: std::string::_Rep::_S_create(unsigned, unsigned, 
std::allocator<char> const&) 
(in /usr/lib/gcc/i686-pc-linux-gnu/4.1.1/libstdc++.so.6.0.8)
==6402==    by 0x1DB13A74: 
(within /usr/lib/gcc/i686-pc-linux-gnu/4.1.1/libstdc++.so.6.0.8)
==6402==    by 0x1DB13C28: std::string::string(char const*, 
std::allocator<char> const&) 
(in /usr/lib/gcc/i686-pc-linux-gnu/4.1.1/libstdc++.so.6.0.8)
==6402==    by 0x1C468504: __static_initialization_and_destruction_0(int, int) 
(tiffvisitor.cpp:344)
==6402==    by 0x1C475421: (within /usr/lib/libexiv2-0.13.so)
==6402==    by 0x1C3F9304: (within /usr/lib/libexiv2-0.13.so)
==6402==    by 0x1B8F1BC4: call_init (in /lib/ld-2.5.so)
==6402==    by 0x1B8F1CD0: _dl_init (in /lib/ld-2.5.so)
==6402==    by 0x1B8E48FE: (within /lib/ld-2.5.so)
==6402==
==6402==
==6402== 864 bytes in 6 blocks are possibly lost in loss record 2065 of 2474
==6402==    at 0x1B909C70: calloc (vg_replace_malloc.c:175)
==6402==    by 0x1B8F4898: allocate_dtv (in /lib/ld-2.5.so)
==6402==    by 0x1B8F495B: _dl_allocate_tls (in /lib/ld-2.5.so)
==6402==    by 0x1D99CCD6: pthread_create@@GLIBC_2.1 
(in /lib/libpthread-2.5.so)
==6402==    by 0x1BC0B366: 
cimg_library::CImg<float>::greycstoration_run(cimg_library::CImg<unsigned 
char> const&, float, float, float, float, float, float, float, float, 
unsigned, bool, unsigned, unsigned, unsigned) (greycstoration.h:284)
==6402==
==6402==
==6402== 1304 bytes in 1 blocks are definitely lost in loss record 2131 of 
2474
==6402==    at 0x1B909441: operator new(unsigned) (vg_replace_malloc.c:132)
==6402==    by 0x1BC0B3B1: 
cimg_library::CImg<float>::greycstoration_run(cimg_library::CImg<unsigned 
char> const&, float, float, float, float, float, float, float, float, 
unsigned, bool, unsigned, unsigned, unsigned) (greycstoration.h:253)
==6402==
==6402==
==6402== 27200 (9600 direct, 17600 indirect) bytes in 25 blocks are definitely 
lost in loss record 2395 of 2474
==6402==    at 0x1B909D6A: realloc (vg_replace_malloc.c:196)
==6402==    by 0x1D6931D3: (within /usr/lib/libfontconfig.so.1.2.0)
==6402==
==6402==
==6402== 16816 bytes in 4 blocks are definitely lost in loss record 2409 of 
2474
==6402==    at 0x1B909D6A: realloc (vg_replace_malloc.c:196)
==6402==    by 0x1D6AEC42: (within /usr/lib/libfreetype.so.6.3.8)
==6402==
==6402==
==6402== 18238 bytes in 5 blocks are definitely lost in loss record 2416 of 
2474
==6402==    at 0x1B9092C5: malloc (vg_replace_malloc.c:130)
==6402==    by 0x1D6AEBBA: (within /usr/lib/libfreetype.so.6.3.8)
==6402==
==6402==
==6402== 46437300 bytes in 1 blocks are possibly lost in loss record 2474 of 
2474
==6402==    at 0x1B90968A: operator new[](unsigned) (vg_replace_malloc.c:138)
==6402==    by 0x1BC01089: 
cimg_library::CImg<float>::CImg(cimg_library::CImg<float> const&) 
(CImg.h:6351)
==6402==
==6402== LEAK SUMMARY:
==6402==    definitely lost: 46527 bytes in 44 blocks.
==6402==    indirectly lost: 17920 bytes in 894 blocks.
==6402==      possibly lost: 46438752 bytes in 29 blocks.
==6402==    still reachable: 130618384 bytes in 401556 blocks.
==6402==         suppressed: 0 bytes in 0 blocks.
==6402== Reachable blocks (those to which a pointer was found) are not shown.

digikam --version
Qt: 3.3.6
KDE: 3.5.6
digiKam: 0.9.2-svn

libkipi 0.1.5
KExiv2 0.1.2-svn
Exiv2 0.13.0

HTH

  Thorsten

P.S. Lets see, if ML likes me this time ;-)



More information about the Digikam-devel mailing list