Analyzers
Talk to fellow users of Intel Analyzer tools (Intel VTune™ Profiler, Intel Advisor)
4974 Discussions

"Debug this problem" with data race - stop only when the race occurs?

Greg_B_
Beginner
397 Views

I'm a new user and am investigating a data race. I used the "debug this problem" feature and when the debugger stopped, only 1 thread was in the problematic code. So, I couldn't actually see the data race occurring. Is there any way to have the debugger continue until an actual data race occurs (e.g. one thread is reading the value while another thread is writing the value)?

Thanks,

Greg Bishop

0 Kudos
7 Replies
SergeyKostrov
Valued Contributor II
397 Views
It is Not clear What platform and IDE you're using. >>... Is there any way to have the debugger continue until an actual data race occurs (e.g. one thread is reading the value while >>another thread is writing the value)? Did you try to put breakpoints in both threads and then press a button that continues processing?
0 Kudos
Peter_W_Intel
Employee
397 Views

If you work on big project, and want to focus data race error detection on specific code area. You have to do "Select analysis start at location with debug", in general speaking you have to set breakpoint before interest of code area. Note that Inspector doesn't work (paused) before meeting breakpoint, and you have to click "Continue with Intel Inspector XE analysis" under "Debugger". If you don't set breakpoint, Inspector never be resumed, so report will be empty.

0 Kudos
Greg_B_
Beginner
397 Views

Thanks for your responses!

@Sergey: I am using Intel Inspector XE 2013 from the command line on 64-bit Linux (SUSE), using GDB for debugging. I did not set any breakpoints myself, I used Inspector's -debug-this command line option, which sets breakpoint(s) at the location(s) of the reported problem for me.

@Peter: I am trying to debug a single reported data race. I want Inspector to set a breakpoint when the data race occurs, so I can see the problem in the debugger. I don't care whether Inspector generates a report, I just want to see the problem in the debugger. Inspector did set a breakpoint, but when the breakpoint was hit, GDB showed that only 1 thread was in the problematic code. Thus, there was no race in this instance because only 1 thread was executing that code. Is there some way for Inspector to tell the debugger to continue in such cases and only stop when a real data race occurs?

0 Kudos
Peter_W_Intel
Employee
397 Views

Greg:

Inspector can support this way - simply go to debugger when data race is detected <Enable debugger when problem detected>. However if you set breakpoint that will be useless, if Inspector detect any error then go to gdb, which might not be in code you set breakpoint.

My understanding you need : <Enable debugger when problem detected, only for breakpoints>. That should be a new feature request.

Regards,Peter   

0 Kudos
Greg_B_
Beginner
397 Views

Hi Peter,

Thanks again for replying, but I don't understand your response. Perhaps you could just tell me what the "-debug-this" command line option does. I want to use that option, but maybe it doesn't do what I need.

Thanks,

Greg Bishop

0 Kudos
Mark_D_Intel
Employee
397 Views

Greg,

   You probably want to use the option  '-appdebug=on-error' with collection.  Then it will stop in the debugger when a race is encountered.

0 Kudos
Peter_W_Intel
Employee
397 Views

Yes. I assume that your code might meet data races A,B, C,...N

You only wants to verify data race C, you might want to ignore data race A and B. So, you can Start analysis after breakpoint C.

See this article. This function is available, not a new feature request.

0 Kudos
Reply