> Hi developers, > > I'm debugging an operating system with QEMU and I have a race condition in > the OS. The problem is that each time I run QEMU I get this error in a > different place, so it makes impossible for gdb to debug it. My plan is to > remove this indeterminism and be able to reproduce the same error in the > same place every time. To do that: > > * The test is automated (there is no user IO) > * I've passed the options "-rtc base=2006-06-17,clock=vm,driftfixone > -icount 2" to QEMU > * There is no use of KVM (the modules have been removed from the kernel) > > So even with that, in each execution I get a different error every time. > Do > you have any suggestions to make the execution identical each time is > being > run? > > > Many thanks!! > > -- > Zeus Gómez Marmolejo > Zet - The x86 (IA-32) open implementation > http://zet.aluzina.org > Hello.
Actually any (not only user) I/O can cause non-determinism: it is not known when data would be ready. The things became even more complicated if you took into account multi-threaded nature of QEMU. Threads communicate with each other and you can not predict context switches. AFAIK there is no easy guaranteed-to-work solution for your problem, but there are some hard ones (e.g. vmware retrace, though it is not based on QEMU). If your test case is really simple you can try disabling any multi-threading you can in QEMU and just hope for it to work. -- Kirill Batuzov