[IGSTK-Users] Error in Release mode, not in Debug mode

Patrick Cheng cheng at isis.georgetown.edu
Thu Oct 28 17:07:24 EDT 2010


Hi Tamas,

I tried to reproduce the error with Windows 7 + Visual Studio 2008.

I used the attached testing program, a pulse generator with a simple 
callback to print out pulse count. It works under both Release and 
Debug. So PulseGenerator is not the problem.

My guess is there might be some problem with the pulse generator 
callback functions in AscensionTracker code.

There are three place to check:

1. igstkTracker.cxx line 736
void Tracker::AttemptToUpdateStatusProcessing( void )

2. igstkTracker.cxx line 775
void Tracker::UpdateStatusSuccessProcessing( void )

3. igstkAscension3DGTracker line 300
Ascension3DGTracker::ResultType Ascension3DGTracker::InternalUpdateStatus()

Can you debug your code and check to see if whether the callback 
function get stuck in one of these places?

Thank you,

Patrick

On 10/28/2010 3:06 PM, Tamas Ungi wrote:
> Hi Patrick,
>
> Yes, the main function begins with igstk::RealTimeClock::Initialize();
> I have inserted text outputs in igstkPulseGenerator.cxx, and found out that
> the line:
> (t->cb)(t->arg);
> around line 445 in igstkPulseGenerator.cxx doesn't return, but hangs. The
> first time it is called.
>
> Thanks,
> Tamas
>
>
>
> -----Original Message-----
> From: Patrick Cheng [mailto:cheng at isis.georgetown.edu]
> Sent: Thursday, October 28, 2010 2:38 PM
> To: Tamas Ungi
> Cc: igstk-users at public.kitware.com
> Subject: Re: [IGSTK-Users] Error in Release mode, not in Debug mode
>
> Hi Tamas,
>
> Do you have the following line in the beginning of your code?
>
> igstk::RealTimeClock::Initialize();
>
> In release mode, all uninitialized memory are set to zeros. This could be
> the potential reason of failing.
>
> Patrick
>
> On 10/28/2010 2:13 PM, Tamas Ungi wrote:
>> Hi IGSTK Users,
>>
>> I have a strange problem.
>>
>> I have written a simple command line program using IGSTK, using just
>> an Ascension3DGTrackerTool and a TrackerToolObserverToOpenIGTLinkRelay
>> object. The main loop looks like this:
>>
>> try
>>
>> {
>>
>> while( 1 )
>>
>> {
>>
>> igstk::PulseGenerator::Sleep( unsigned int( 1000 / refreshRate ) );
>>
>> igstk::PulseGenerator::CheckTimeouts();
>>
>> }
>>
>> }
>>
>> catch( std::exception&e )
>>
>> {
>>
>> std::cerr<<e.what()<<"\n";
>>
>> return EXIT_FAILURE;
>>
>> }
>>
>> In Debug mode (Visual Studio 2008) the program works perfectly.
>> However, in Release mode, the CheckTimeouts() function never returns,
>> and the program is stuck at that line (line 6 in the above snippet)
> forever.
>>
>> Anybody have any idea how can this be?
>>
>> I would appreciate any help.
>>
>> Thank you,
>>
>> Tamas
>>
>>
>>
>> _______________________________________________
>> Powered by www.kitware.com
>>
>> Visit other Kitware open-source projects at
>> http://www.kitware.com/opensource/opensource.html
>>
>> Follow this link to subscribe/unsubscribe:
>> http://public.kitware.com/cgi-bin/mailman/listinfo/igstk-users
>
>
>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: CMakeLists.txt
URL: <http://public.kitware.com/pipermail/igstk-users/attachments/20101028/65b807f1/attachment-0004.txt>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: Test.cxx
URL: <http://public.kitware.com/pipermail/igstk-users/attachments/20101028/65b807f1/attachment.ksh>


More information about the IGSTK-Users mailing list