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

Memory alignment fix for VS2013 x64 #393

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

rafalbigaj
Copy link

On Windows x64 compilation with VisualStudio 2013 any call to ffi function ends with segmentation fault.
It's caused by invalid memory alignment. The used mask 0x7UL is 32 bit on this platform, 0x7ULL is required.

@tduehr
Copy link
Member

tduehr commented Dec 2, 2014

I'd like to do some testing of this. How do you have visual studio and ruby setup to compile gems rather than mingw?

@rafalbigaj
Copy link
Author

You need to use VS2013 x64 Native Tools Command Prompt to build ruby and the ffi gem extensions.
I share the required ruby dependencies here: https://dl.dropboxusercontent.com/u/51529271/ruby-vc2013-x64-dep.zip.
Regular ruby compilation is required.
When building ffi gem extension I encountered problems when building ffi lib. I had to change manually warnings level -W3 to -W2 in Makefile.vc64 to ignore "non-fatal error".

@tduehr
Copy link
Member

tduehr commented Dec 3, 2014

Thanks

Regular as in compile from source not the installer?

@rafalbigaj
Copy link
Author

Yes, you have to compile ruby with Visual Studio.

@cfis
Copy link
Contributor

cfis commented Oct 8, 2019

Any chance this can be applied? I have just run into the same issue, and the patch correctly fixes it.

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.

None yet

3 participants