Re: [ITK-users] [ITK] ImageSeriesReader type pointer crashes in debug mode
Dženan Zukić <[email protected]> Tue, 25 Sep 2018 10:46:52 -0400
| Newsgroups | gmane.comp.lib.itk.user |
|---|---|
| Message-ID | <CAPf2UMT7FMf4mXGi4vnPSLaSdaLcfNBcMh8c=cMa7yybJZsX_A@mail.gmail.com> |
--===============1414104916== Content-Type: multipart/alternative; boundary="000000000000df82970576b32db0" --000000000000df82970576b32db0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi Ritesh, When code crashes in Debug mode, but runs in Release or vice versa, it means it has a deficiency (bug) which manifests in one of those modes. As you did not provide the code which uses the reader, I cannot offer any more specific advice. Providing a runnable <http://sscce.org/> example will make it easier for people to help you. We have transitioned away from this list, to the forum <https://discourse.itk.org/>. Please post your updated question there, as more people will see it. Regards, D=C5=BEenan On Tue, Sep 25, 2018 at 1:45 AM ritesh.mahajan < [email protected]> wrote: > Hello Team, > > When i am creating a smart pointer globally and allocating the memory to > it. > In debug mode "it crashes". While when the same code is run in release mo= de > it seems to work fine. Can some one help me out why is it so ? > > Please find the below code: > > typedef signed short PixelType; > typedef itk::Image< PixelType, 3>ImageType; > typedef itk::ImageSeriesReader< ImageType >ReaderType; > ReaderType:: Pointer reader=3D ReaderType::New(); > > void ImageRead() > { > // using pointer reader here. > // which is allocated memory at global level > } > > The above code crashes in debug mode > > > > -- > Sent from: http://itk-users.7.n7.nabble.com/ > The ITK community is transitioning from this mailing list to > discourse.itk.org. Please join us there! > ________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Kitware offers ITK Training Courses, for more information visit: > http://www.kitware.com/products/protraining.php > > Please keep messages on-topic and check the ITK FAQ at: > http://www.itk.org/Wiki/ITK_FAQ > > Follow this link to subscribe/unsubscribe: > https://itk.org/mailman/listinfo/insight-users > The ITK community is transitioning from this mailing list to > discourse.itk.org. Please join us there! > ________________________________________ > Community mailing list > [email protected] > https://itk.org/mailman/listinfo/community > --000000000000df82970576b32db0 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable <div dir=3D"ltr"><div class=3D"gmail_default" style=3D"font-family:verdana,= sans-serif;font-size:small">Hi Ritesh,</div><div class=3D"gmail_default" st= yle=3D"font-family:verdana,sans-serif;font-size:small"><br></div><div class= =3D"gmail_default" style=3D"font-family:verdana,sans-serif;font-size:small"= >When code crashes in Debug mode, but runs in Release or vice versa, it mea= ns it has a deficiency (bug) which manifests in one of those modes. As you = did not provide the code which uses the reader, I cannot offer any more spe= cific advice. Providing a <a href=3D"http://sscce.org/">runnable</a> exampl= e will make it easier for people to help you.</div><div class=3D"gmail_defa= ult" style=3D"font-family:verdana,sans-serif;font-size:small"><br></div><di= v class=3D"gmail_default" style=3D"font-family:verdana,sans-serif;font-size= :small"><div class=3D"gmail_default">We have transitioned away from this li= st, to the=C2=A0<a href=3D"https://discourse.itk.org/" target=3D"_blank">fo= rum</a>. Please post your updated question there, as more people will see i= t.</div><div class=3D"gmail_default"><br></div><div class=3D"gmail_default"= >Regards,</div><div class=3D"gmail_default">D=C5=BEenan</div></div></div><b= r><div class=3D"gmail_quote"><div dir=3D"ltr">On Tue, Sep 25, 2018 at 1:45 = AM ritesh.mahajan <<a href=3D"mailto:[email protected]">rite= [email protected]</a>> wrote:<br></div><blockquote class=3D"gmai= l_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left= :1ex">Hello Team,<br> <br> When i am creating a smart pointer globally and allocating the memory to it= .<br> In debug mode "it crashes". While when the same code is run in re= lease mode<br> it seems to work fine. Can some one help me out why is it so ?<br> <br> Please find the below code:<br> <br> typedef signed short PixelType;<br> typedef itk::Image< PixelType, 3>ImageType;<br> typedef itk::ImageSeriesReader< ImageType >ReaderType;<br> ReaderType:: Pointer reader=3D ReaderType::New();<br> <br> void ImageRead()<br> {<br> =C2=A0 =C2=A0 // using pointer reader here.<br> =C2=A0 =C2=A0 // which is allocated memory at global level<br> }<br> <br> The above code crashes in debug mode<br> <br> <br> <br> --<br> Sent from: <a href=3D"http://itk-users.7.n7.nabble.com/" rel=3D"noreferrer"= target=3D"_blank">http://itk-users.7.n7.nabble.com/</a><br> The ITK community is transitioning from this mailing list to <a href=3D"htt= p://discourse.itk.org" rel=3D"noreferrer" target=3D"_blank">discourse.itk.o= rg</a>. Please join us there!<br> ________________________________<br> Powered by <a href=3D"http://www.kitware.com" rel=3D"noreferrer" target=3D"= _blank">www.kitware.com</a><br> <br> Visit other Kitware open-source projects at<br> <a href=3D"http://www.kitware.com/opensource/opensource.html" rel=3D"norefe= rrer" target=3D"_blank">http://www.kitware.com/opensource/opensource.html</= a><br> <br> Kitware offers ITK Training Courses, for more information visit:<br> <a href=3D"http://www.kitware.com/products/protraining.php" rel=3D"noreferr= er" target=3D"_blank">http://www.kitware.com/products/protraining.php</a><b= r> <br> Please keep messages on-topic and check the ITK FAQ at:<br> <a href=3D"http://www.itk.org/Wiki/ITK_FAQ" rel=3D"noreferrer" target=3D"_b= lank">http://www.itk.org/Wiki/ITK_FAQ</a><br> <br> Follow this link to subscribe/unsubscribe:<br> <a href=3D"https://itk.org/mailman/listinfo/insight-users" rel=3D"noreferre= r" target=3D"_blank">https://itk.org/mailman/listinfo/insight-users</a><br> The ITK community is transitioning from this mailing list to <a href=3D"htt= p://discourse.itk.org" rel=3D"noreferrer" target=3D"_blank">discourse.itk.o= rg</a>. Please join us there!<br> ________________________________________<br> Community mailing list<br> <a href=3D"mailto:[email protected]" target=3D"_blank">[email protected]</a= ><br> <a href=3D"https://itk.org/mailman/listinfo/community" rel=3D"noreferrer" t= arget=3D"_blank">https://itk.org/mailman/listinfo/community</a><br> </blockquote></div> --000000000000df82970576b32db0-- --===============1414104916== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline The ITK community is transitioning from this mailing list to discourse.itk.org. Please join us there! ________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Kitware offers ITK Training Courses, for more information visit: http://www.kitware.com/products/protraining.php Please keep messages on-topic and check the ITK FAQ at: http://www.itk.org/Wiki/ITK_FAQ Follow this link to subscribe/unsubscribe: https://itk.org/mailman/listinfo/insight-users --===============1414104916==--