Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] memuc_run calls hang #80

Open
Romhast opened this issue Nov 17, 2023 · 1 comment
Open

[BUG] memuc_run calls hang #80

Romhast opened this issue Nov 17, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@Romhast
Copy link

Romhast commented Nov 17, 2023

When I use the codes below, randomize never gives any output, it seems like it goes into an endless wait. and I noticed that it does this when you use it after the stop_vm command.

from pymemuc import PyMemuc

memuc = PyMemuc(debug=True)

memuc.stop_vm(vm_index=0)
memuc.randomize_vm(vm_index=0)
memuc.start_vm(vm_index=0)
2023-11-17 04:27:29,728 - pymemuc.pymemuc - DEBUG - PyMemuc: Debug mode enabled
2023-11-17 04:27:29,728 - pymemuc.pymemuc - DEBUG - pymemuc._memuc.memuc_run:
2023-11-17 04:27:29,728 - pymemuc.pymemuc - DEBUG - 	Command: "C:\Microvirt\Memu\memuc.exe -i 0 stop"
2023-11-17 04:27:30,848 - pymemuc.pymemuc - DEBUG - 	Output: SUCCESS: stop vm finished.
2023-11-17 04:27:30,849 - pymemuc.pymemuc - DEBUG - pymemuc._memuc.memuc_run:
2023-11-17 04:27:30,849 - pymemuc.pymemuc - DEBUG - 	Command: "C:\Microvirt\Memu\memuc.exe -i 0 randomize"
@martinmiglio
Copy link
Member

Occasionally memuc.exe will hang on a command. pymemuc tries to avoid this by using timeouts on the exec calls but those aren't very reliable.

Often times I found that when commands like this hang, having the 'MEmu Multiple-Instance Manager' window open while applying commands prevents a hang.

Best practice is to have a thread which executes pymemuc commands that isn't joined by the main thread of your program, assuming you don't need the output of pymemuc read.

@martinmiglio martinmiglio added the bug Something isn't working label Nov 17, 2023
@martinmiglio martinmiglio changed the title [BUG] Randomize [BUG] memuc_run calls hang Nov 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants