Support

If you have a problem or need to report a bug please email : support@dsprobotics.com

There are 3 sections to this support area:

DOWNLOADS: access to product manuals, support files and drivers

HELP & INFORMATION: tutorials and example files for learning or finding pre-made modules for your projects

USER FORUMS: meet with other users and exchange ideas, you can also get help and assistance here

NEW REGISTRATIONS - please contact us if you wish to register on the forum

Users are reminded of the forum rules they sign up to which prohibits any activity that violates any laws including posting material covered by copyright

Win32API bug

For general discussion related FlowStone

Win32API bug

Postby trogluddite » Fri Jun 20, 2014 3:15 pm

Hi All,
Anybody else having trouble with the Win32API Ruby library? I'm finding it really useful for calling the Windows API to add new features to FlowStone - however, it seems to crash whenever you try to 'require' it from an exported EXE or VST.
I have copied the necessary files to the same directory as the export, as directed by the manual, and my testing indicates that the file IS being found. But it seems that Ruby fails without even raising an exception as soon as it tries to import the C-extension 'dl.so' (the interfacing code for the API).

Here's a test schematic - I'd be really grateful if anyone could confirm the problem - particularly on Win7/8, as I'm still on XP, so Malc will want to know if the bug is OS specific.
Win32API Test.fsm
(2.9 KiB) Downloaded 942 times

To run the test, you need to follow these steps.
1) - Export the test module to an EXE in a known directory path.
2) - Go to your Flowstone installation directory, i.e. /Program Files/DSPRobotics/Flowstone (or Program Files(x86) if you use Win7/8).
3) Copy the whole of the 'ruby' sub-folder into the same directory as the export to make the library available.
4) Run the EXE.

In the EXE window, you should see...
1) - A list of directories that were searched for the file.
2) - The current working directory, should be the same as the directory where the EXE is placed.
3) - One or more 'Found' messages to say that Win32API was successfully located.
4) - POSSIBLY - a message to say that Win32PI was 'required' successfully.

If you DON'T see the 'require SUCCESS' message, Ruby has bombed out in the same way that I'm seeing here (two different machines show the same problem). Due to Ruby bombing, I can't get any better diagnostics than that - so remember that you are checking that you DON'T see this last message.

If you see a 'LoadError' message, the file has not been found - check that you copied the 'ruby' folder to the right location.

Thanks for any help with this. I'm working on a test/de-bugging suite for FlowStone at the moment that I think folks will find very useful - and I want this to be able to work with exports so that you can debug plugins while they're actually in use within a host. Not having Win32API in exports really screws this up!!

Best wishes,
Trog.
All schematics/modules I post are free for all to use - but a credit is always polite!
Don't stagnate, mutate to create!
User avatar
trogluddite
 
Posts: 1730
Joined: Fri Oct 22, 2010 12:46 am
Location: Yorkshire, UK

Re: Win32API bug

Postby Xtinct » Fri Jun 20, 2014 3:32 pm

Win 7 no 'require SUCCESS' message

Win32API Test.png
Win32API Test.png (22.2 KiB) Viewed 15929 times


sorry :(
Last edited by Xtinct on Fri Jun 20, 2014 4:58 pm, edited 1 time in total.
Xtinct
 
Posts: 106
Joined: Fri Feb 11, 2011 12:06 am

Re: Win32API bug

Postby trogluddite » Fri Jun 20, 2014 3:56 pm

Wow, that was fast! :shock:
Many thanks, this is exactly what Malc needs to know so that he can get to the source of the bug - I'll pass that info onto him straight away.
Xtinct wrote:sorry

No need to apologise - it's not your fault that Flowstone has a bug!
All schematics/modules I post are free for all to use - but a credit is always polite!
Don't stagnate, mutate to create!
User avatar
trogluddite
 
Posts: 1730
Joined: Fri Oct 22, 2010 12:46 am
Location: Yorkshire, UK

Re: Win32API bug

Postby Walter Sommerfeld » Fri Jun 20, 2014 4:37 pm

Hi Trog!

My System:
Win8 64 bit Quad Core

with Admin rights

cheers,
Walter
Attachments
win32API Test_in FS.png
win32API Test_in FS.png (53.92 KiB) Viewed 15933 times
Win32API Test.png
Win32API Test.png (28.92 KiB) Viewed 15933 times
User avatar
Walter Sommerfeld
 
Posts: 249
Joined: Wed Jul 14, 2010 6:00 pm
Location: HH - Made in Germany

Re: Win32API bug

Postby trogluddite » Fri Jun 20, 2014 5:30 pm

Brilliant - thanks Walter. :D
That pretty much wraps it up then - definitely something in Flowstone.

Looking at the reports, I also notice something else...
The User guide states that you must copy the 'ruby' folder OR have FS installed on the machine. However, no-ones $LOAD_PATH includes the 'win32/common' folder from Program Files - just a duplicate of the working directory relative path. This is why I explicitly asked for folks to copy the folder - were the user guide and $LOAD_PATH correct, this shouldn't be necessary for any of us. Seems that this is "universal" to all installations as well.

Time to mail Malc again!
All schematics/modules I post are free for all to use - but a credit is always polite!
Don't stagnate, mutate to create!
User avatar
trogluddite
 
Posts: 1730
Joined: Fri Oct 22, 2010 12:46 am
Location: Yorkshire, UK

Re: Win32API bug

Postby MyCo » Fri Jun 20, 2014 5:55 pm

Failing on Windows 8 here, too.

However I think it tries to load the lib, when you copy the ruby folder to the root of your EXE filesystem. eg. when the EXE is on drive C, copy the ruby folder to C:/ruby. Problem there is quite bad, though. It crashs the EXE instantly.
User avatar
MyCo
 
Posts: 718
Joined: Tue Jul 13, 2010 12:33 pm
Location: Germany

Re: Win32API bug

Postby trogluddite » Fri Jun 20, 2014 6:25 pm

Hi MyCo,
From what I've been able to tell, the problem is with the underlying 'DL' class - 'Win32API' is just a simple wrapper around that to maintain compatibility with older Ruby versions after the original class was deprecated.
'DL' uses an '.so' file - i.e. a compiled 'C' extension - and it seems that this is the sticking point. If you make a 'dummy' Win32API.rb file and put it in the right place, it will require no problem, and I've had no problems requiring my own native Ruby libraries from any folder I care to.
Even adding the proper entry to $LOAD_PATH for the install path version of the file makes no difference.

I've also seen the complete crashing - "Problem encountered, had to close" etc.- but can't quite get a handle on when or why. Your example might give a hint though - some kind of access permission maybe? Allowing items in a folder to execute is a distinct permission from 'read/write' within the OS, IIRC - maybe this applies to the 'dl.so' file because it is a compiled binary?
All schematics/modules I post are free for all to use - but a credit is always polite!
Don't stagnate, mutate to create!
User avatar
trogluddite
 
Posts: 1730
Joined: Fri Oct 22, 2010 12:46 am
Location: Yorkshire, UK

Re: Win32API bug

Postby trogluddite » Sat Jun 21, 2014 3:59 pm

Just had a mail from Malc about this problem.

It seems it was introduced during the last update. One of the big features was having Ruby statically linked within the exports, to avoid the problems with shared Ruby namespace and make unpacking of the interpreter and .dlls unnecessary.
However, a side effect of this is that Ruby can no longer dynamically link to C-extensions, such as the DL class within Win32API- native Ruby files are fine, but not binary '.so' files.

He's offered to make the old method of embedding Ruby available as an export option, but I'm not too comfortable with giving him extra work to do and slowing down the next release just for little old me - I've yet to see anyone else using Win32API for anything! Much easier for him to just edit the User Guide to make the situation clear.

If anyone else feels that access to Win32API/C-extensions is a "must have" feature, then let me or Malc know. Otherwise it's time for me to roll my sleeves up, fire up Visual Studio, and get to grips with the dreaded C++. :?
All schematics/modules I post are free for all to use - but a credit is always polite!
Don't stagnate, mutate to create!
User avatar
trogluddite
 
Posts: 1730
Joined: Fri Oct 22, 2010 12:46 am
Location: Yorkshire, UK


Return to General

Who is online

Users browsing this forum: No registered users and 55 guests