[Insight-users] What does glibc detected error means?

Rafael S. Medeiros rafaelmedeiros.ufpel at gmail.com
Wed Sep 15 20:29:47 EDT 2010


Hello,

I'm trying to write a program with the following code:

void MaskGenerator::generateOutput(){
ThresholdFilterType::Pointer thresholdFilter = ThresholdFilterType::New();
thresholdFilter->SetInput(this->mask);
thresholdFilter->SetLowerThreshold(0.5);
thresholdFilter->Update();
outputImage = thresholdFilter->GetOutput();
}

This is the header of the class:

#ifndef _RGBTOHSV_H
#define _RGBTOHSV_H

#include "itkRGBPixel.h"
#include <itkImage.h>
#include <itkBinaryThresholdImageFilter.h>



using namespace std;

class MaskGenerator {
public:
#define MAX3(r,g,b) ((r)>(g)?((r)>(b)?(r):(b)):((g)>(b)?(g):(b)))
#define MIN3(r,g,b) ((r)<(g)?((r)<(b)?(r):(b)):((g)<(b)?(g):(b)))
#define MaskImageDimension 2
//-------------------------Public Definitions----------------------
typedef itk::RGBPixel< unsigned char > PixelType;
typedef itk::Image< PixelType, MaskImageDimension > ImageType;
typedef itk::Image< double, MaskImageDimension > OutImageType;
typedef itk::Image< double, MaskImageDimension > MaskImageType;
typedef itk::ImageRegion< MaskImageDimension > RegionType;
typedef itk::Size< MaskImageDimension > SizeType;
typedef itk::Index< MaskImageDimension > IndexType;
typedef MaskGenerator* Pointer;
typedef itk::BinaryThresholdImageFilter< MaskImageType, MaskImageType >
ThresholdFilterType;
//-------------------------Public Methods--------------------------
MaskGenerator();
~MaskGenerator();
OutImageType::Pointer GetOutput();
void SetInput(ImageType::Pointer InputImage);
void Update();
static MaskGenerator::Pointer New();

private:
ImageType::Pointer inputImage;
OutImageType::Pointer outputImage;
MaskImageType::Pointer mask;

double pixelToHSV(PixelType pixel);
void generateOutput();
};
#endif


When i run it I got a Segmentation fault when the thresholdFilter->Update().
Then i tried to save the input of the thresholdFilter in a file to check if
it was ok, and I've got the following error:

*** glibc detected *** ./contaGotas: free(): invalid next size (fast):
0x083a5a38 ***
======= Backtrace: =========
/lib/tls/i686/cmov/libc.so.6(+0x6b591)[0x3742591]
/lib/tls/i686/cmov/libc.so.6(+0x6cde8)[0x3743de8]
/lib/tls/i686/cmov/libc.so.6(cfree+0x6d)[0x3746ecd]
/usr/lib/libstdc++.so.6(_ZdlPv+0x21)[0x344e741]
/usr/lib/libstdc++.so.6(_ZNSs4_Rep10_M_destroyERKSaIcE+0x1d)[0x342ac2d]
/usr/lib/libstdc++.so.6(_ZNSsD1Ev+0x4c)[0x342c5dc]
/home/rafol/InsightToolkit-3.20.0/bin/libITKCommon.so.3.20(_ZN3itk17ObjectFactoryBase15CreateAllObjectEPKc+0x67)[0x274bc7]
/home/rafol/InsightToolkit-3.20.0/bin/libITKCommon.so.3.20(_ZN3itk17ObjectFactoryBase17CreateAllInstanceEPKc+0x78)[0x27357c]
/home/rafol/InsightToolkit-3.20.0/bin/libITKIO.so.3.20(_ZN3itk14ImageIOFactory13CreateImageIOEPKcNS0_12FileModeTypeE+0x3c)[0x5415c0]
./contaGotas(_ZN3itk15ImageFileWriterINS_5ImageIdLj2EEEE5WriteEv+0x61f)[0x806dd95]
./contaGotas(_ZN3itk15ImageFileWriterINS_5ImageIdLj2EEEE6UpdateEv+0x1a)[0x806ca58]
./contaGotas(_ZN13MaskGenerator14generateOutputEv+0xa8)[0x8069e20]
./contaGotas(_ZN13MaskGenerator6UpdateEv+0x1ae)[0x8069a62]
./contaGotas(main+0x13e)[0x807c06e]
/lib/tls/i686/cmov/libc.so.6(__libc_start_main+0xe6)[0x36edbd6]
./contaGotas[0x80695a1]
======= Memory map: ========
00110000-0039f000 r-xp 00000000 08:02 419065
/home/rafol/InsightToolkit-3.20.0/bin/libITKCommon.so.3.20.0
0039f000-003a9000 r--p 0028e000 08:02 419065
/home/rafol/InsightToolkit-3.20.0/bin/libITKCommon.so.3.20.0
003a9000-003b0000 rw-p 00298000 08:02 419065
/home/rafol/InsightToolkit-3.20.0/bin/libITKCommon.so.3.20.0
003b0000-003be000 rw-p 00000000 00:00 0
003be000-003dd000 r-xp 00000000 08:02 421826
/home/rafol/InsightToolkit-3.20.0/bin/libITKStatistics.so.3.20.0
003dd000-003de000 r--p 0001f000 08:02 421826
/home/rafol/InsightToolkit-3.20.0/bin/libITKStatistics.so.3.20.0
003de000-003df000 rw-p 00020000 08:02 421826
/home/rafol/InsightToolkit-3.20.0/bin/libITKStatistics.so.3.20.0
003df000-005fd000 r-xp 00000000 08:02 421987
/home/rafol/InsightToolkit-3.20.0/bin/libITKIO.so.3.20.0
005fd000-005fe000 ---p 0021e000 08:02 421987
/home/rafol/InsightToolkit-3.20.0/bin/libITKIO.so.3.20.0
005fe000-00606000 r--p 0021e000 08:02 421987
/home/rafol/InsightToolkit-3.20.0/bin/libITKIO.so.3.20.0
00606000-0060a000 rw-p 00226000 08:02 421987
/home/rafol/InsightToolkit-3.20.0/bin/libITKIO.so.3.20.0
0060a000-0060b000 rw-p 00000000 00:00 0
0060b000-00610000 r-xp 00000000 08:02 421592
/home/rafol/InsightToolkit-3.20.0/bin/libitkNetlibSlatec.so.3.20.0
00610000-00611000 r--p 00004000 08:02 421592
/home/rafol/InsightToolkit-3.20.0/bin/libitkNetlibSlatec.so.3.20.0
00611000-00612000 rw-p 00005000 08:02 421592
/home/rafol/InsightToolkit-3.20.0/bin/libitkNetlibSlatec.so.3.20.0
00612000-0063a000 r-xp 00000000 08:02 420561
/home/rafol/InsightToolkit-3.20.0/bin/libitkjpeg12.so.3.20.0
0063a000-0063b000 r--p 00027000 08:02 420561
/home/rafol/InsightToolkit-3.20.0/bin/libitkjpeg12.so.3.20.0
0063b000-0063c000 rw-p 00028000 08:02 420561
/home/rafol/InsightToolkit-3.20.0/bin/libitkjpeg12.so.3.20.0
0063c000-0063f000 r-xp 00000000 08:02 261826 /lib/libuuid.so.1.3.0
0063f000-00640000 r--p 00002000 08:02 261826 /lib/libuuid.so.1.3.0
00640000-00641000 rw-p 00003000 08:02 261826 /lib/libuuid.so.1.3.0
00642000-0064b000 r-xp 00000000 08:02 421814
/home/rafol/InsightToolkit-3.20.0/bin/libITKBasicFilters.so.3.20.0
0064b000-0064c000 r--p 00008000 08:02 421814
/home/rafol/InsightToolkit-3.20.0/bin/libITKBasicFilters.so.3.20.0
0064c000-0064d000 rw-p 00009000 08:02 421814
/home/rafol/InsightToolkit-3.20.0/bin/libITKBasicFilters.so.3.20.0
0064d000-0075c000 r-xp 00000000 08:02 421649
/home/rafol/InsightToolkit-3.20.0/bin/libitkgdcm.so.3.20.0
0075c000-0075d000 r--p 0010f000 08:02 421649
/home/rafol/InsightToolkit-3.20.0/bin/libitkgdcm.so.3.20.0
0075d000-0076a000 rw-p 00110000 08:02 421649
/home/rafol/InsightToolkit-3.20.0/bin/libitkgdcm.so.3.20.0
0076a000-00788000 r-xp 00000000 08:02 420741
/home/rafol/InsightToolkit-3.20.0/bin/libitkopenjpeg.so.3.20.0
00788000-00789000 r--p 0001d000 08:02 420741
/home/rafol/InsightToolkit-3.20.0/bin/libitkopenjpeg.so.3.20.0
00789000-0078a000 rw-p 0001e000 08:02 420741
/home/rafol/InsightToolkit-3.20.0/bin/libitkopenjpeg.so.3.20.0
0078a000-007b3000 r-xp 00000000 08:02 420673
/home/rafol/InsightToolkit-3.20.0/bin/libitkpng.so.3.20.0
007b3000-007b4000 r--p 00028000 08:02 420673
/home/rafol/InsightToolkit-3.20.0/bin/libitkpng.so.3.20.0
007b4000-007b5000 rw-p 00029000 08:02 420673
/home/rafol/InsightToolkit-3.20.0/bin/libitkpng.so.3.20.0
007b5000-00807000 r-xp 00000000 08:02 420717
/home/rafol/InsightToolkit-3.20.0/bin/libitktiff.so.3.20.0
00807000-00808000 ---p 00052000 08:02 420717
/home/rafol/InsightToolkit-3.20.0/bin/libitktiff.so.3.20.0
00808000-00809000 r--p 00052000 08:02 420717
/home/rafol/InsightToolkit-3.20.0/bin/libitktiff.so.3.20.0
00809000-0080a000 rw-p 00053000 08:02 420717
/home/rafol/InsightToolkit-3.20.0/bin/libitktiff.so.3.20.0
0080a000-0080b000 r-xp 00000000 08:02 420874
/home/rafol/InsightToolkit-3.20.0/bin/libitkvcl.so.3.20.0
0080b000-0080c000 r--p 00000000 08:02 420874
/home/rafol/InsightToolkit-3.20.0/bin/libitkvcl.so.3.20.0
0080c000-0080d000 rw-p 00001000 08:02 420874
/home/rafol/InsightToolkit-3.20.0/bin/libitkvcl.so.3.20.0
0080e000-00843000 r-xp 00000000 08:02 420822
/home/rafol/InsightToolkit-3.20.0/bin/libITKNrrdIO.so.3.20.0
00843000-00844000 r--p 00035000 08:02 420822
/home/rafol/InsightToolkit-3.20.0/bin/libITKNrrdIO.so.3.20.0
00844000-00846000 rw-p 00036000 08:02 420822
/home/rafol/InsightToolkit-3.20.0/bin/libITKNrrdIO.so.3.20.0
00846000-00859000 r-xp 00000000 08:02 420652
/home/rafol/InsightToolkit-3.20.0/bin/libitkzlib.so.3.20.0
00859000-0085a000 r--p 00012000 08:02 420652
/home/rafol/InsightToolkit-3.20.0/bin/libitkzlib.so.3.20.0
0085a000-0085b000 rw-p 00013000 08:02 420652
/home/rafol/InsightToolkit-3.20.0/bin/libitkzlib.so.3.20.0
0085b000-00860000 r-xp 00000000 08:02 421167
/home/rafol/InsightToolkit-3.20.0/bin/libitkv3p_lsqr.so.3.20.0
00860000-00861000 r--p 00004000 08:02 421167
/home/rafol/InsightToolkit-3.20.0/bin/libitkv3p_lsqr.so.3.20.0
00861000-00862000 rw-p 00005000 08:02 421167
/home/rafol/InsightToolkit-3.20.0/bin/libitkv3p_lsqr.so.3.20.0
00862000-00864000 r-xp 00000000 08:02 268655 /lib/tls/i686/cmov/
libdl-2.11.1.so
00864000-00865000 r--p 00001000 08:02 268655 /lib/tls/i686/cmov/
libdl-2.11.1.so
00865000-00866000 rw-p 00002000 08:02 268655 /lib/tls/i686/cmov/
libdl-2.11.1.so
00869000-00891000 r-xp 00000000 08:02 420635
/home/rafol/InsightToolkit-3.20.0/bin/libitkjpeg16.so.3.20.0Aborted

Does anyone knows what it means or how can I fix it?
Thank you.

Rafael Sachett Medeiros
--
Ciência da Computação - 8º Semestre
Universidade Federal de Pelotas
Grupo de Computação Gráfica e Procesamento de Imagens - GComGPI
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20100915/9fff1386/attachment.htm>


More information about the Insight-users mailing list