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

Segfaults on Win64 #99

Open
gix opened this issue Jan 10, 2014 · 3 comments
Open

Segfaults on Win64 #99

gix opened this issue Jan 10, 2014 · 3 comments
Milestone

Comments

@gix
Copy link

gix commented Jan 10, 2014

With a 64-bit Windows build of Ruby (ruby 2.1.0p0 (2013-12-25 revision 44422) [x64-mswin64_120]), just starting irb segfaults when calling GetConsoleScreenBufferInfo.

The Fiddle signatures for winapi calls are wrong. They treat pointers and handles as 32-bit values: Parameters are declared using "L" (long) but should be "P", and an "S" parameter pointer is unpacked using "l!" but should use "q!".

@luislavena
Copy link
Collaborator

I personally don't have a mswin build, can you reproduce this with
mingw-w64 one?

Patches to correct this are welcome :-)

Sorry for top posting. Sent from mobile.
On Jan 10, 2014 12:13 PM, "Nico Rieck" [email protected] wrote:

With a 64-bit Windows build of Ruby (ruby 2.1.0p0 (2013-12-25 revision
44422) [x64-mswin64_120]), just starting irb segfaults when calling
GetConsoleScreenBufferInfo.

The Fiddle signatures for winapi calls are wrong. They treat pointers and
handles as 32-bit values: Parameters are declared using "L" (long) but
should be "P", and an "S" parameter pointer is unpacked using "l!" but
should use "q!
".


Reply to this email directly or view it on GitHubhttps://github.com//issues/99
.

@phasis68
Copy link
Contributor

This is Windows 8 and x64-mswin64 specific issue.
You should use DL::PackInfo::PACK_MAP[DL::TYPE_VOIDP] instead of "l!"
Refer to https://bugs.ruby-lang.org/issues/7492

@gix
Copy link
Author

gix commented Jan 11, 2014

I couldn't reproduce it fully with a 64-bit RubyInstaller, but it was only 2.0.0.

I've fixed it in #100 and the test suite completes with my above mentioned ruby and "ruby 2.0.0p353 (2013-11-22) [x64-mingw32]".

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

No branches or pull requests

3 participants