Re: Race with atexit functions in system emulation

2020-07-02 Thread Paolo Bonzini
On 02/07/20 08:18, Pavel Dovgalyuk wrote: > Is it true, that semihosting can be used to access (read and write) host > files from the guest? > In such a case it can't be used with RR for the following reasons: > 1. We don't preserve modified files, therefore the execution result may > change in the

Re: Race with atexit functions in system emulation

2020-07-02 Thread Pavel Dovgalyuk
On 02.07.2020 10:49, Alex Bennée wrote: Pavel Dovgalyuk writes: Is it true, that semihosting can be used to access (read and write) host files from the guest? They can - but in these test cases we are only using semihosting for console output and signalling an exit code at the end of the te

Re: Race with atexit functions in system emulation

2020-07-02 Thread Alex Bennée
Pavel Dovgalyuk writes: > Is it true, that semihosting can be used to access (read and write) host > files from the guest? They can - but in these test cases we are only using semihosting for console output and signalling an exit code at the end of the test. I don't think that gets in the way

Re: Race with atexit functions in system emulation

2020-07-01 Thread Pavel Dovgalyuk
Is it true, that semihosting can be used to access (read and write) host files from the guest? In such a case it can't be used with RR for the following reasons: 1. We don't preserve modified files, therefore the execution result may change in the future runs. 2. Even in the case, when all the file

Re: Race with atexit functions in system emulation

2020-07-01 Thread Paolo Bonzini
On 01/07/20 13:05, Alex Bennée wrote: > Should we maybe defer the exit to once the main loop has been exited > with a some sort of vmstop? Or could we have an atexit handler that > kills the main thread? Yes, I think the way to do "exit" is to use qemu_system_shutdown_request. Possibly halt the C

Race with atexit functions in system emulation

2020-07-01 Thread Alex Bennée
Hi, While running some TSAN tests I ran into the following race condition: WARNING: ThreadSanitizer: data race (pid=1605) Write of size 4 at 0x55c437814d98 by thread T2 (mutexes: write M619): #0 replay_finish /home/alex.bennee/lsrc/qemu.git/replay/replay.c:393:17 (qemu-system-aarch64