Hi Jorg,<div><br></div><div>Nice job, I tried the head of DCMTK, and the OfCondition crash disappeared. <div>However I'm experiencing another crash. I can reproduce in my small program (ofConditionCrash) and in the test application ctkDICOM in CTK.</div>

<div><br></div><div>This is very odd, a static OFList is instantiated twice with the same address  and deleted twice at the same address, therefore a crash. See below the backtrace when I place a breakpoint in OFList() and ~OFList(). Note that the address is always the same (0xa6ea70). Btw, the address is a 32bits address, does it mean DCMTK is built in 32bits ?</div>

<div><br></div><div>I tried with a clean build of CTK. Can you eventually try that CTK branch <a href="https://github.com/finetjul/CTK/tree/dcmtk-trunk">https://github.com/finetjul/CTK/tree/dcmtk-trunk</a>  and see if you have a crash when running ctkDICOM ?</div>

<div><br></div><div>Thanks,</div><div>Julien.</div><div><br></div><div>At startup:<br><br>First time the OFList at address 0xa6ea70 is constructed:<br><br>Breakpoint 1, OFList<DcmCodecList*>::OFList (this=0xa6ea70)<br>

    at /home/julien/Work/CTK/CTK-noPython/DCMTK/ofstd/include/dcmtk/ofstd/oflist.h:330<br>330        OFList() : OFListBase() { }<br>(gdb) backtrace<br>#0  OFList<DcmCodecList*>::OFList (this=0xa6ea70)<br>    at /home/julien/Work/CTK/CTK-noPython/DCMTK/ofstd/include/dcmtk/ofstd/oflist.h:330<br>

#1  0x00007ffff5711005 in __static_initialization_and_destruction_0 (<br>    __initialize_p=1, __priority=65535)<br>    at /home/julien/Work/CTK/CTK-noPython/DCMTK/dcmdata/libsrc/dccodec.cc:43<br>#2  0x00007ffff5711069 in _GLOBAL__sub_I_dccodec.cc(void) ()<br>

    at /home/julien/Work/CTK/CTK-noPython/DCMTK/dcmdata/libsrc/dccodec.cc:652<br>#3  0x00007ffff7deab26 in ?? () from /lib64/ld-linux-x86-64.so.2<br>#4  0x00007ffff7deabff in ?? () from /lib64/ld-linux-x86-64.so.2<br>#5  0x00007ffff7ddd5ea in ?? () from /lib64/ld-linux-x86-64.so.2<br>

#6  0x0000000000000001 in ?? ()<br>#7  0x00007fffffffe507 in ?? ()<br>#8  0x0000000000000000 in ?? ()<br><br>Second time the OFList at address 0xa6ea70 is constructed<br><br>Breakpoint 1, OFList<DcmCodecList*>::OFList (this=0xa6ea70)<br>

    at /home/julien/Work/CTK/CTK-noPython/DCMTK/ofstd/include/dcmtk/ofstd/oflist.h:330<br>330        OFList() : OFListBase() { }<br>(gdb) backtrace<br>#0  OFList<DcmCodecList*>::OFList (this=0xa6ea70)<br>    at /home/julien/Work/CTK/CTK-noPython/DCMTK/ofstd/include/dcmtk/ofstd/oflist.h:330<br>

#1  0x00000000006f997d in __static_initialization_and_destruction_0 (<br>    __initialize_p=1, __priority=65535)<br>    at /home/julien/Work/CTK/CTK-noPython/DCMTK/dcmdata/libsrc/dccodec.cc:43<br>#2  0x00000000006f99e1 in _GLOBAL__sub_I_dccodec.cc(void) ()<br>

    at /home/julien/Work/CTK/CTK-noPython/DCMTK/dcmdata/libsrc/dccodec.cc:652<br>#3  0x00000000007469ed in __libc_csu_init ()<br>#4  0x00007ffff5be92a0 in __libc_start_main ()<br>   from /lib/x86_64-linux-gnu/libc.so.6<br>

#5  0x00000000004b0fd9 in _start ()<br><br>When the application exits:</div><div><br></div><div>First time it gets into the destructor: <br><br>Breakpoint 2, OFListBase::~OFListBase (this=0xa6ea70, <br>    __in_chrg=<optimized out>)<br>

    at /home/julien/Work/CTK/CTK-noPython/DCMTK/ofstd/libsrc/oflist.cc:54<br>54            delete afterLast;<br>(gdb) backtrace<br>#0  OFListBase::~OFListBase (this=0xa6ea70, __in_chrg=<optimized out>)<br>    at /home/julien/Work/CTK/CTK-noPython/DCMTK/ofstd/libsrc/oflist.cc:54<br>

#1  0x00000000006f9cc8 in OFList<DcmCodecList*>::~OFList (this=0xa6ea70, <br>    __in_chrg=<optimized out>)<br>    at /home/julien/Work/CTK/CTK-noPython/DCMTK/ofstd/include/dcmtk/ofstd/oflist.h:291<br>#2  0x00007ffff5c03821 in ?? () from /lib/x86_64-linux-gnu/libc.so.6<br>

#3  0x00007ffff5c038a5 in exit () from /lib/x86_64-linux-gnu/libc.so.6<br>#4  0x00007ffff5be9314 in __libc_start_main ()<br>   from /lib/x86_64-linux-gnu/libc.so.6<br>#5  0x00000000004b0fd9 in _start ()<br><br>Second time it gets into the destructor:<br>

<br>(gdb) backtrace<br>#0  OFListBase::~OFListBase (this=0xa6ea70, __in_chrg=<optimized out>)<br>    at /home/julien/Work/CTK/CTK-noPython/DCMTK/ofstd/libsrc/oflist.cc:54<br>#1  0x00000000006f9cc8 in OFList<DcmCodecList*>::~OFList (this=0xa6ea70, <br>

    __in_chrg=<optimized out>)<br>    at /home/julien/Work/CTK/CTK-noPython/DCMTK/ofstd/include/dcmtk/ofstd/oflist.h:291<br>#2  0x00007ffff5c03c3d in __cxa_finalize ()<br>   from /lib/x86_64-linux-gnu/libc.so.6<br>
#3  0x00007ffff5473e06 in __do_global_dtors_aux ()<br>
   from /home/julien/Work/CTK/CTK-noPython/CTK-build/bin/libCTKDICOMCore.so.0.1<br>#4  0x00007fffffffdf00 in ?? ()<br>#5  0x00007fffffffe140 in ?? ()<br>#6  0x00007ffff5839ff1 in _fini ()<br>   from /home/julien/Work/CTK/CTK-noPython/CTK-build/bin/libCTKDICOMCore.so.0.1<br>

#7  0x00007fffffffe140 in ?? ()<br>#8  0x00007ffff7deb105 in ?? () from /lib64/ld-linux-x86-64.so.2<br>Backtrace stopped: previous frame inner to this frame (corrupt stack?)<br><br><br>This then leads to the following crash:<br>

<br>Program received signal SIGSEGV, Segmentation fault.<br>0x0000000000000031 in ?? ()<br>(gdb) up<br>#1  0x000000000073cb8b in OFListBase::~OFListBase (this=0xa6ea70, <br>    __in_chrg=<optimized out>)<br>    at /home/julien/Work/CTK/CTK-noPython/DCMTK/ofstd/libsrc/oflist.cc:54<br>

54            delete afterLast;<br>(gdb) backtrace<br>#0  0x0000000000000031 in ?? ()<br>#1  0x000000000073cb8b in OFListBase::~OFListBase (this=0xa6ea70, <br>    __in_chrg=<optimized out>)<br>    at /home/julien/Work/CTK/CTK-noPython/DCMTK/ofstd/libsrc/oflist.cc:54<br>

#2  0x00000000006f9cc8 in OFList<DcmCodecList*>::~OFList (this=0xa6ea70, <br>    __in_chrg=<optimized out>)<br>    at /home/julien/Work/CTK/CTK-noPython/DCMTK/ofstd/include/dcmtk/ofstd/oflist.h:291<br>#3  0x00007ffff5c03c3d in __cxa_finalize ()<br>

   from /lib/x86_64-linux-gnu/libc.so.6<br>#4  0x00007ffff5473e06 in __do_global_dtors_aux ()<br>   from /home/julien/Work/CTK/CTK-noPython/CTK-build/bin/libCTKDICOMCore.so.0.1<br>#5  0x00007fffffffdf00 in ?? ()<br>#6  0x00007fffffffe140 in ?? ()<br>

#7  0x00007ffff5839ff1 in _fini ()<br>   from /home/julien/Work/CTK/CTK-noPython/CTK-build/bin/libCTKDICOMCore.so.0.1<br>#8  0x00007fffffffe140 in ?? ()<br>#9  0x00007ffff7deb105 in ?? () from /lib64/ld-linux-x86-64.so.2<br>

Backtrace stopped: previous frame inner to this frame (corrupt stack?)</div><div><br><div class="gmail_quote">On Wed, Feb 15, 2012 at 3:54 PM, Jörg Riesmeier <span dir="ltr"><<a href="mailto:riesmeier@icsmed.de">riesmeier@icsmed.de</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Julien,<br>
<div class="im"><br>
> Anyway, when you guys rewrite the OfCondition code, can you please try to<br>
> build DCMTK in CTK and test the ofConditionCrash project<br>
<br>
</div>I just did that on the same machine as last time: Now it works :-)<br>
<br>
Regards,<br>
Jörg<br>
</blockquote></div><br></div></div>