While one-sided communication introduced in MPI-2 is convenient to access remote memory, it is easier for programmers to make serious errors such as race conditions. Although there are several tools for detecting race conditions in MPI programs, these tools do not provide any mechanism to detect race conditions occurring in one-sided communication. In this paper, we present a technique to detect race conditions caused by unsafe accesses of onesided operations. Our technique creates a mirror window whenever a process creates a window memory for onesided communication, and uses it to monitor and detect race conditions. Whenever any one-sided operation accesses a window memory, the corresponding mirror window will be marked and checked to see if the window memory is unsafely accessed by any concurrent operation. In our experiment, we evaluate our technique using two public benchmark programs, and the results show that our technique can precisely detect race conditions. Therefore our technique is effective to detect race conditions in MPI programs and helpful to develop reliable parallel programs.