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

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

Аватар пользователя Greg B.

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

8 сообщений / 0 новое
Последнее сообщение
Пожалуйста, обратитесь к странице Уведомление об оптимизации для более подробной информации относительно производительности и оптимизации в программных продуктах компании Intel.
Аватар пользователя Sergey Kostrov

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?

Аватар пользователя Peter Wang (Intel)

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.

Аватар пользователя Greg B.

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?

Аватар пользователя Peter Wang (Intel)

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   

Аватар пользователя Greg B.

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

Аватар пользователя mark-dewing (Intel)

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.

Аватар пользователя Peter Wang (Intel)

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.

Зарегистрируйтесь, чтобы оставить комментарий.