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

Possibility for savestates without using /proc/self/pagemap? #223

Closed
jonathanasdf opened this issue May 4, 2019 · 14 comments
Closed

Possibility for savestates without using /proc/self/pagemap? #223

jonathanasdf opened this issue May 4, 2019 · 14 comments

Comments

@jonathanasdf
Copy link

It seems that my system (windows subsystem for linux) does not have /proc/self/pagemap (it has /proc/self/maps though). I don't really understand how these low level stuff works so this might be a stupid question but is it possible to implement savestates without accessing /proc/self/pagemap?

@clementgallet
Copy link
Owner

/proc/self/pagemap is necessary for incremental savestates. Otherwise, it is only used to detect virtual pages that are not mapped to real pages, and could be work around (with increased savestate memory probably). So I guess you managed to run libTAS and a game in WSL?

@chungy
Copy link
Contributor

chungy commented May 17, 2019

WSL1 is like a reverse-Wine, and it's doubtful it'll ever have perfect Linux compatibility.

You might have better luck when WSL2 comes out, which literally runs a VM with a real Linux kernel and disk image to do its thing.

@jonathanasdf
Copy link
Author

Yeah got libTAS working in WSL mostly because for reasons I don't want to dual boot linux.

So you think it should be possible if incremental savestates is not used? Since I don't need incremental savestates that would be great. Would you be able to point me to some material that I should read to figure out how to implement this?

@qixils
Copy link
Contributor

qixils commented May 17, 2019

image

@jonathanasdf
Copy link
Author

I mean more like how to avoid this line

Utils::readAll(spmfd, pagemaps, remaining_pages*8);

@clementgallet
Copy link
Owner

Yes, there are minor modifications to the code to work around reading /proc/self/pagemap, I will take care of that.

@clementgallet
Copy link
Owner

Fixed in d7b7512. You still need to disable "Incremental savestates".

@jonathanasdf
Copy link
Author

Thanks for doing this!

savestates_in_ram must also be disabled because of microsoft/WSL#3542

After that the savestate appears to work !

But after the savestate completes control doesn't seem to return to the program.

A log is at https://pastebin.com/e1xyuY0r if that helps.

@jonathanasdf
Copy link
Author

With gdb attached it says

Thread 19 "GAME_LOADER" received signal SIGSEGV, Segmentation fault.

@clementgallet
Copy link
Owner

If memfd_create is not available, then you should disable "Prevent writing to disk", but I don't think it will solve this problem.
If you didn't do it already, uncheck "Recycle threads" and, to be sure, check "Mute".

The log is not very helpful, there seems to be a crash in fmodstudio code, but I don't know how it is related to savestating.

@clementgallet clementgallet reopened this May 26, 2019
@jonathanasdf
Copy link
Author

Can confirm Prevent writing to disk is disabled, Recycle threads is disabled, and Mute is checked.

I've been trying to find fmod libraries built with -g but doesn't seem like those exist. Getting a friend with an actual linux installation to check if the exact same settings works for them.

@jonathanasdf
Copy link
Author

Verified the problem has to do with the thread suspend/resume rather than the actual checkpointing (same problem with the raise(SIGUSR2) commented)

@clementgallet
Copy link
Owner

Could you check "Runtime > Debug > Print categories > Checkpoint" and "Runtime > Debug > Log to file", then perform a checkpoint (keep raise(SIGUSR2) commented if it's irrelevant to the issue) and copy the obtained log here? The log file is created in the same directory as the executable.

@jonathanasdf
Copy link
Author

For other reasons I'm probably just going to have to dualboot linux anyways, so this issue doesn't matter to me anymore. Thanks a lot for the help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants