[Dcmlib] Déboire avec la gdcm et la STL

Mathieu Malaterre Mathieu.Malaterre at creatis.insa-lyon.fr
Thu Jul 24 16:38:11 CEST 2003


Salut,

	J'ai décidement de + en + de problèmes avec la STL. Est-ce que 
quelqu'un peux m'expliquer ce qui ne va pas dans:


#include "gdcm.h"

int main()
{
   list<gdcmHeader> liste;
   gdcmHeader temp( "../gdcmData/test.acr" );
   liste.push_back( temp );

   return 0;
}



Si je le lance:

$ gdb ./Test/.libs/testHelper
GNU gdb Red Hat Linux (5.2-2)
Copyright 2002 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain 
conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i386-redhat-linux"...
(gdb) r
Starting program: /home/malat/Creatis/public/gdcm/Test/.libs/testHelper

Program received signal SIGSEGV, Segmentation fault.
0x4207af79 in chunk_free () from /lib/i686/libc.so.6
(gdb) bt
#0  0x4207af79 in chunk_free () from /lib/i686/libc.so.6
#1  0x4207ad24 in free () from /lib/i686/libc.so.6
#2  0x400a9f56 in __builtin_delete (ptr=0x80c2790) at 
../../gcc/cp/new2.cc:-1
#3  0x4005d222 in gdcmElValSet::~gdcmElValSet (this=0x80c02f4, 
__in_chrg=2) at gdcmElValSet.cxx:13
#4  0x4003b25f in gdcmHeader::~gdcmHeader (this=0x80c02e0, __in_chrg=2) 
at /usr/include/g++-3/std/bastring.h:195
#5  0x0804a8fb in _List_base<gdcmHeader, allocator<gdcmHeader> >::clear 
(this=0xbffff4c0) at /usr/include/g++-3/stl_construct.h:43
#6  0x0804a66f in main (argc=1, argv=0xbffff554) at 
/usr/include/g++-3/stl_list.h:192
#7  0x42017589 in __libc_start_main () from /lib/i686/libc.so.6


Tout en sachant que le programme suivant fonctionne:

#include "gdcm.h"

int main()
{
   gdcmHeader *temp = new gdcmHeader( "../gdcmData/test.acr" );

   delete temp;

   return 0;
}


Je seche vraiment...

Merci infiniment,
mathieu




More information about the Dcmlib mailing list