Bugs: Browse | Submit New | Admin

[#5204] Segfault on Win32 with latest bgd.dll

Date:
2006-07-26 18:32
Priority:
3
Submitted By:
Bob Showalter (bshow)
Assigned To:
Nobody (None)
Category:
None
State:
Open
Summary:
Segfault on Win32 with latest bgd.dll

Detailed description
Using gd2 gem on Windows results in segfaults from Ruby 1.8.2 and 1.8.4, perhaps due to the change in call conventions
in bgd.dll.

http://www.boutell.com/gd/ says:

WARNING: AS OF GD 2.0.24, THE WINDOWS DLL HAS BEEN CHANGED IN A WAY THAT REQUIRES RECOMPILING EXISTING APPLICATIONS.
This does NOT affect your program if you are NOT on Windows or you are NOT using bgd.dll. It does NOT affect your program
if you have already rebuilt it for gd 2.0.24 or higher.

    * Windows users: bgd.dll now uses the __stdcall calling convention. This means the DLL is now compatible with Visual
BASIC and other languages that cannot handle the __cdecl calling convention. While there are no code changes required
for C/C++ users of the DLL, such users must still recompile their code that uses the DLL, and make certain that the
new .h files are being used, as well as the new version of the DLL. I regret the inconvenience this one-time breakage
of binary compatibility may cause, however the benefits for those not using C/C++ are too great to ignore.

I cannot seem to find an older version of bgd.dll to test against, but is this the possible problem. Are there
any workarounds?

Add A Comment: Notepad

Please login


Followup

Message
Date: 2006-10-04 20:27
Sender: Scott Persinger

Well, the problem is that this Ruby GD2 wrapper does not have
any C code, so there's nothing to recompile. It would seem the
problem is that ruby.exe (at least the standard one) is built
in some way that is incompatible with the way that the gd dll
is built. The GD site lists a whole bunch of warnings about how
to use the library properly on windows.

So I think in fact the warning message listed above is a red
herring.

For what it's worth, I downloaded php 4.3.7 for windows, extracted
the php-gd.dll (and related php4ts.dll), renamed it to bgd.dll.
Then I had to go into gd2.rb and comment out references to missing
functions:

#    :gdImageCopyMergeGray               => '0PPIIIIIII',
#    :gdImageSquareToCircle              => 'PPI',

and the result was a GD library that DOES NOT WORK, but at least
it doesn't crash! I have a feeling that someone might actually
have luck using a more recent version of the GD library from
a more recent version of php built for windows.

--Scott

Attached Files:

Name Description Download
No Files Currently Attached

Changes:

No Changes Have Been Made to This Item