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

Race condition around parameter remapping #44

Open
DenWav opened this issue Dec 28, 2020 · 0 comments
Open

Race condition around parameter remapping #44

DenWav opened this issue Dec 28, 2020 · 0 comments
Assignees

Comments

@DenWav
Copy link
Contributor

DenWav commented Dec 28, 2020

Running the remapper with multiple threads causes some parameters to nondeterministically remap. From run to run, with identical inputs, the remap output for some methods will fail to remap parameters that were remapped the previous run (or the opposite). Running tiny-remapper with a single thread prevents this from happening, and run-to-run output is identical.

This can be reproduced easily by checking out the following Paper commit: https://github.com/PaperMC/Paper/tree/ffd9e2a4d1363a0148d454a08a448a3aa37d7ce7

Run the task:

./gradlew remapJar

copy the output jar (<project_root>/.gradle/caches/paperweight/taskCache/remapJar.jar) somewhere, and re-run the task:

./gradlew remapJar --rerun-tasks

Compare the result and you'll see many method parameters are mapped differently.

If you do the same test on the next commit the method parameter mappings will be stable: https://github.com/PaperMC/Paper/tree/94538d55bc403403aa04390a4a895070837cdde7

This commit uses #43 with --threads=1 to prevent the issue from occurring.

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

2 participants