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

Map bricks below first 2GB of address space #132

Merged
merged 3 commits into from
Oct 13, 2021

Conversation

mogery
Copy link
Contributor

@mogery mogery commented Oct 12, 2021

This fixes an issue with mono where JIT compiled code would near-call wrapped libraries, but fail because the difference between PC and the call address did not fit into an imm32.

This was fixed by replacing posix_memalign with my_mmap and providing the MAP_32BIT flag.

Fixes #131

This fixes an issue with mono where JIT compiled code would
near-call wrapped libraries, but fail because the difference
between PC and the call address did not fit into an imm32.

This was fixed by replacing posix_memalign with my_mmap and
providing the MAP_32BIT flag.

Fixes ptitSeb#131
FreeBridge used free to clean up the pointer allocated by
my_mmap, which is incorrect and lead to a crash upon code
that exited gracefully.

The free was replaced with my_munmap.
@mogery
Copy link
Contributor Author

mogery commented Oct 12, 2021

@ptitSeb The build produces -Wimplicit-function-declaration warnings for the usage of my_mmap and my_munmap (see). How should I go about resolving this?

Should I create a header file in src/include that exposes these two methods? Or is there a better way to include methods from wrapped?

@ptitSeb
Copy link
Owner

ptitSeb commented Oct 13, 2021

@ptitSeb The build produces -Wimplicit-function-declaration warnings for the usage of my_mmap and my_munmap (see). How should I go about resolving this?

Should I create a header file in src/include that exposes these two methods? Or is there a better way to include methods from wrapped?

You can just add a declaration of the functions at the beginning of the C file. I haven't create a .h with those function. I'll probably add them to customemem.hat some point...

@ptitSeb
Copy link
Owner

ptitSeb commented Oct 13, 2021

Can you try to run Wine 64bits with this build. Just to be sure, because the first bricks will take a very low address, and I remember that wine tries to allocates them too (cannot tests that myself before next week)

@mogery
Copy link
Contributor Author

mogery commented Oct 13, 2021

I'm busy right now, but will do in the afternoon.

This adds a declaration of my_mmap and my_munmap to
src/tools/bridge.c in order to avoid a
-Wimplicit-function-declaration warning when compiling.

This should probably be moved to a header file in the
future.
@mogery
Copy link
Contributor Author

mogery commented Oct 13, 2021

Wine works without errors. Ready to merge from my end.

@mogery mogery marked this pull request as ready for review October 13, 2021 13:37
@ptitSeb ptitSeb merged commit 7262288 into ptitSeb:main Oct 13, 2021
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

Successfully merging this pull request may close these issues.

hackmud fails to launch sometimes, failed assertion in Mono
2 participants