Forum: Ruby FTGL Seg Faults on Win32

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Xavier (Guest)
on 2006-05-11 13:16
Hi,
I'm trying to use FLGT ruby on Windows XP, but am running into a
segmentation fault at ftgl_test.rb:38 (The first call through to the
FTGL library)

I am installing as follows:
1) Ruby O. Click installer for windows
2) Install ruby-opengl-0.32g
ruby extconf.rb
nmake

At this point the openGL samples work
3) Install FTGL
ruby setup.rb config
ruby setup.rb setup
ruby setup.rb install
4) Try to run ftgl_test.rb
ruby tests/ftgl_test.rb

tests/ftgl_test.rb:38: [BUG] Segmentation fault
ruby 1.8.4 (2005-12-24) [i386-mswin32]

This application has requested the Runtime to terminate it in an unusual
way.
Please contact the application's support team for more information.

I am at a loss as to how to go about debugging this problem. Any
suggestions?

I've got the linux build running on ubuntu with no problems.

- Xavier

OS: Win XP SP2, Fully patched
Ruby: 1.8.4 (2005-12-24) [i386-mswin32]
msvc: Visual Studio .NET 2003
Oky (Guest)
on 2006-05-11 18:05
You could try using the FxRuby OpenGL bindings.
Bill K. (Guest)
on 2006-05-11 20:07
(Received via mailing list)
From: "Xavier" <removed_email_address@domain.invalid>
>
> At this point the openGL samples work
> 3) Install FTGL
> ruby setup.rb config
> ruby setup.rb setup
> ruby setup.rb install
> 4) Try to run ftgl_test.rb
> ruby tests/ftgl_test.rb
>
> tests/ftgl_test.rb:38: [BUG] Segmentation fault
> ruby 1.8.4 (2005-12-24) [i386-mswin32]

Hi,

That's strange.  I'll try to reproduce that problem here.
However, I've compiled it pretty recently on XP with
1.8.4 and it's been working for me.  I've put the binaries
online here:

http://tastyspleen.net/~billk/ftgl_mswin32/

Do these binaries work for you?  Or do you still get the
crash?


Thanks,

Bill
Xavier (Guest)
on 2006-05-12 10:41
Oky wrote:
> You could try using the FxRuby OpenGL bindings.

I'm not sure these are what I'm after. I'm adding text support into my
game rendering engine. Besides, FTGL is purdy.

Bill K. wrote:
> From: "Xavier" <removed_email_address@domain.invalid>
>>
>> At this point the openGL samples work
>> 3) Install FTGL
>> ruby setup.rb config
>> ruby setup.rb setup
>> ruby setup.rb install
>> 4) Try to run ftgl_test.rb
>> ruby tests/ftgl_test.rb
>>
>> tests/ftgl_test.rb:38: [BUG] Segmentation fault
>> ruby 1.8.4 (2005-12-24) [i386-mswin32]
>
> Hi,
>
> That's strange.  I'll try to reproduce that problem here.
> However, I've compiled it pretty recently on XP with
> 1.8.4 and it's been working for me.  I've put the binaries
> online here:
>
> http://tastyspleen.net/~billk/ftgl_mswin32/
>
> Do these binaries work for you?  Or do you still get the
> crash?
>
>
> Thanks,
>
> Bill

No, unfortunately :( I tried on two different machines, also.
I placed them in the following locations:
ruby\bin\libftgl.dll
ruby\lib\libftgl.lib (Is this even required?)
ruby\lib\ruby\1.8\i386-mswin32\ftgl.so

I'm thinking I might try and write a test harness in C++, this would
give me more info to work with (if it crashed), yes? At the moment, I've
got no idea where the problem is.

Also, FYI you can't access .rb files stored on your server, but I
presume ftgl_test.rb is the same as the one in the latest release.

Thanks for you help,
Xavier
Bill K. (Guest)
on 2006-05-12 15:49
(Received via mailing list)
From: "Xavier" <removed_email_address@domain.invalid>
>
>> Do these binaries work for you?  Or do you still get the
>> crash?
>
> No, unfortunately :( I tried on two different machines, also.
> I placed them in the following locations:
> ruby\bin\libftgl.dll
> ruby\lib\libftgl.lib (Is this even required?)

libftgl.lib is not required, no.  I just included it for completeness
sake in case
you needed to link with it at some point.

> ruby\lib\ruby\1.8\i386-mswin32\ftgl.so
>
> I'm thinking I might try and write a test harness in C++, this would
> give me more info to work with (if it crashed), yes? At the moment, I've
> got no idea where the problem is.
>
> Also, FYI you can't access .rb files stored on your server, but I
> presume ftgl_test.rb is the same as the one in the latest release.

Oops!  Yes, ftgl_test.rb is the same as the released version, except
I hacked the paths slightly so that it would load the .dll and .so files
out of the current directory.  E.g.

  ENV['PATH'] += ";."
  $:.unshift "."


Well, this is peculiar.  Why would it run fine on my system and crash
on yours, when we appear to have the same versions of various
software.

Have you tried building FTGL itself from source?  I'm wondering if
it's own C++-based demos would run on your system?


Regards,

Bill
Xavier S. (Guest)
on 2006-05-13 05:29
Bill K. wrote:
> From: "Xavier" <removed_email_address@domain.invalid>
>>
>>> Do these binaries work for you?  Or do you still get the
>>> crash?
>>
>> No, unfortunately :( I tried on two different machines, also.
>> I placed them in the following locations:
>> ruby\bin\libftgl.dll
>> ruby\lib\libftgl.lib (Is this even required?)
>
> libftgl.lib is not required, no.  I just included it for completeness
> sake in case
> you needed to link with it at some point.
>
>> ruby\lib\ruby\1.8\i386-mswin32\ftgl.so
>>
>> I'm thinking I might try and write a test harness in C++, this would
>> give me more info to work with (if it crashed), yes? At the moment, I've
>> got no idea where the problem is.
>>
>> Also, FYI you can't access .rb files stored on your server, but I
>> presume ftgl_test.rb is the same as the one in the latest release.
>
> Oops!  Yes, ftgl_test.rb is the same as the released version, except
> I hacked the paths slightly so that it would load the .dll and .so files
> out of the current directory.  E.g.
>
>   ENV['PATH'] += ";."
>   $:.unshift "."
>
>
> Well, this is peculiar.  Why would it run fine on my system and crash
> on yours, when we appear to have the same versions of various
> software.
>
> Have you tried building FTGL itself from source?  I'm wondering if
> it's own C++-based demos would run on your system?


In the process of getting the C++ FTGL demo to run, I noticed the
default font is c:\winnt\... Not valid on my machine :( Changed it to a
valid path and it works fine. Probably should throw an exception rather
than segfault, but I'm not familiar enough with bindings to write a
patch. If it's a big deal to change, maybe mention it in the readme?

Thanks,
Xavier
This topic is locked and can not be replied to.