<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>

<META NAME="Generator" CONTENT="MS Exchange Server version 6.5.7226.0">
<TITLE>Re: [Insight-users] problem with running gdb on cygwin</TITLE>
</HEAD>
<BODY>
<DIV id=idOWAReplyText41418 dir=ltr>
<DIV dir=ltr><FONT face=Arial color=#000000 size=2>Hi Luis</FONT></DIV>
<DIV dir=ltr><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV dir=ltr><FONT face=Arial size=2>unfortunately, it's a single processor 
pentium 4.</FONT></DIV>
<DIV dir=ltr><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV dir=ltr><FONT face=Arial size=2>Kris</FONT></DIV></DIV>
<DIV dir=ltr><BR>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B> Luis Ibanez 
[mailto:luis.ibanez@kitware.com]<BR><B>Sent:</B> Sun 25/09/2005 
13:10<BR><B>To:</B> Thielemans, Kris<BR><B>Cc:</B> 
insight-users@itk.org<BR><B>Subject:</B> Re: [Insight-users] problem with 
running gdb on cygwin<BR></FONT><BR></DIV>
<DIV><BR>
<P><FONT size=2>Hi Kris,<BR><BR>This seems to be a threading problem...<BR>are 
you running in a dual processor machine ?<BR><BR><BR>Please let us 
know,<BR><BR><BR>&nbsp; Thanks<BR><BR><BR>&nbsp;&nbsp;&nbsp; 
Luis<BR><BR><BR><BR>------------------------<BR>Thielemans, Kris wrote:<BR>&gt; 
Hi<BR>&gt;&nbsp;<BR>&gt;&nbsp;<BR>&gt; I am trying to run gdb on 
Examples/Registration/DeformableRegistration7,<BR>&gt; but gdb gets stuck 
quickly (even before reading any data). This happens<BR>&gt; even on data for 
which the program runs fine if I don't use gdb.<BR>&gt;&nbsp;<BR>&gt; My 
configuration:<BR>&gt;<BR>&gt; ITK 2.2 on a fairly recent cygwin 
installation&nbsp; (cygwin 1.5.18-1, gcc<BR>&gt; 3.4.4-1, binutils 20050610-1, 
cmake 2.0.6-1,&nbsp; gdb 6.3.50_2004-12-28-cvs;<BR>&gt; none of which have any 
updates available via cygwin's setup) running&nbsp; on<BR>&gt; top of XP sp2. 
I've used ccmake to do the configuration with selecting<BR>&gt; the Debug 
build-type.<BR>&gt;<BR>&gt;&nbsp;<BR>&gt;<BR>&gt; What I do is:<BR>&gt;<BR>&gt; 
break main<BR>&gt; run<BR>&gt; next a few times<BR>&gt;<BR>&gt; gdb/the program 
then hangs in the line<BR>&gt;<BR>&gt;&nbsp; TransformType::Pointer&nbsp; 
transform = TransformType::New();<BR>&gt;<BR>&gt; If I single step through that 
one I end up in KERNEL32!IsBadWritePtr<BR>&gt; (see reproducible debugging 
session below).<BR>&gt;<BR>&gt; Ok, the program does seem to work fine, but this 
makes me feel<BR>&gt; uncomfortable, and I'd like to be able to use gdb. It 
could of course be<BR>&gt; a cygwin-gdb 
problem.<BR>&gt;<BR>&gt;&nbsp;<BR>&gt;<BR>&gt; Any 
suggestions?<BR>&gt;<BR>&gt;&nbsp;<BR>&gt;<BR>&gt; Kris Thielemans<BR>&gt; 
Hammersmith Imanet Ltd<BR>&gt; part of GE Healthcare<BR>&gt; London, 
UK<BR>&gt;<BR>&gt;&nbsp;<BR>&gt;<BR>&gt; PS: debugging session:<BR>&gt;<BR>&gt; 
(gdb) r<BR>&gt; Starting program:<BR>&gt; 
/home/kris/MyDocuments/devel/ITK/ITK-bin-debug/bin/DeformableRegistration7.exe<BR>&gt; 
largervox_atn_2.mha largervox_atn_1.mha largervox_atn_2_to_1.mha<BR>&gt;<BR>&gt; 
Breakpoint 1, main (argc=4, argv=0x1332878)<BR>&gt;&nbsp;&nbsp;&nbsp;&nbsp; 
at<BR>&gt; 
/home/kris/MyDocuments/devel/ITK/InsightToolkit-2.2.0/Examples/Registration/DeformableRegistration7.cxx:119<BR>&gt; 
119 {<BR>&gt; (gdb) n 12<BR>&gt; 195&nbsp;&nbsp; TransformType::Pointer&nbsp; 
transform = TransformType::New();<BR>&gt; (gdb) s 29<BR>&gt; 
itk::LightObject::operator new (n=272)<BR>&gt;&nbsp;&nbsp;&nbsp;&nbsp; 
at<BR>&gt; 
/home/kris/MyDocuments/devel/ITK/InsightToolkit-2.2.0/Code/Common/itkLightObject.cxx:78<BR>&gt; 
78&nbsp;&nbsp; return new char[n];<BR>&gt; (gdb) backtrace<BR>&gt; #0&nbsp; 
itk::LightObject::operator new (n=272)<BR>&gt;&nbsp;&nbsp;&nbsp;&nbsp; 
at<BR>&gt; 
/home/kris/MyDocuments/devel/ITK/InsightToolkit-2.2.0/Code/Common/itkLightObject.cxx:78<BR>&gt; 
#1&nbsp; 0x00636fc9 in itk::BSplineDeformableTransform&lt;double, 3u, 
3u&gt;::New ()<BR>&gt;&nbsp;&nbsp;&nbsp;&nbsp; at<BR>&gt; 
/home/kris/MyDocuments/devel/ITK/InsightToolkit-2.2.0/Code/Common/itkBSplineDeformableTransform.h:121<BR>&gt; 
#2&nbsp; 0x00401391 in main (argc=4, 
argv=0x1332878)<BR>&gt;&nbsp;&nbsp;&nbsp;&nbsp; at<BR>&gt; 
/home/kris/MyDocuments/devel/ITK/InsightToolkit-2.2.0/Examples/Registration/DeformableRegistration7.cxx:195<BR>&gt; 
(gdb) s<BR>&gt; 0x005bb3d6 in operator new[] ()<BR>&gt;&nbsp;&nbsp;&nbsp;&nbsp; 
at /usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/iostream:77<BR>&gt; 
77&nbsp;&nbsp; static ios_base::Init __ioinit;<BR>&gt; (gdb)<BR>&gt; 0x6109dbe0 
in pthread_getspecific () from /usr/bin/cygwin1.dll<BR>&gt; (gdb)<BR>&gt; Single 
stepping until exit from function pthread_getspecific,<BR>&gt; which has no line 
number information.<BR>&gt; 0x6109d010 in cygwin1!__getreent () from 
/usr/bin/cygwin1.dll<BR>&gt; (gdb)<BR>&gt; Single stepping until exit from 
function cygwin1!__getreent,<BR>&gt; which has no line number 
information.<BR>&gt; 0x610e0bb0 in cygwin1!_alloca () from 
/usr/bin/cygwin1.dll<BR>&gt; (gdb)<BR>&gt; Single stepping until exit from 
function cygwin1!_alloca,<BR>&gt; which has no line number information.<BR>&gt; 
0x7c809f29 in KERNEL32!IsBadWritePtr () from<BR>&gt; 
/c/WINDOWS/system32/kernel32.dll<BR>&gt; (gdb)<BR>&gt; Single stepping until 
exit from function KERNEL32!IsBadWritePtr,<BR>&gt;<BR>&gt; (It never gets out of 
here).<BR>&gt;<BR>&gt;<BR>&gt; 
------------------------------------------------------------------------<BR>&gt;<BR>&gt; 
_______________________________________________<BR>&gt; Insight-users mailing 
list<BR>&gt; Insight-users@itk.org<BR>&gt; <A 
href="http://www.itk.org/mailman/listinfo/insight-users">http://www.itk.org/mailman/listinfo/insight-users</A><BR><BR><BR></FONT></P></DIV>

</BODY>
</HTML>