Issue Details (XML | Word | Printable)

Key: CORE-4581
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Vlad Khorsun
Reporter: Nick
Votes: 0
Watchers: 3
Operations

If you were logged in you would be able to see more operations.
Firebird Core

FB3 embedded loads udfs from wrong place

Created: 16/Oct/14 11:00 AM   Updated: 23/Sep/15 11:30 AM
Component/s: UDF
Affects Version/s: 3.0 Beta 1
Fix Version/s: 3.0 Beta 2

Environment: Windows 7 x64, FB 3.0.0.31378 32-bit embedded with default config

QA Status: Cannot be tested


 Description  « Hide
FB library: D:\Firebird\3.0.0.31378\fbclient.dll, loaded by full path by function "LoadLibraryEx('D:\Firebird\3.0.0.31378\fbclient.dll', 0, LOAD_WITH_ALTERED_SEARCH_PATH)".
Exe: D:\Project\Test.exe
Got error on work with udf:
invalid request BLR at offset 31
function FUNC is not defined
module name or entrypoint could not be found
Invalid token
GDS Code: 335544343, SQL Code: -104, Error Code: 23

Process Monitor from SysInternals shows me that fb tryed to load my library from D:\Project\UDF\, but not from D:\Firebird\3.0.0.31378\UDF\

On 2.5.3 embedded it's ok.

 All   Comments   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Sean Leyne added a comment - 16/Oct/14 02:56 PM
I am not sure that this is a bug.

The purpose of the embedded engine is to allow for it to be intergrated into an application. As such, all application components (including the FB engine DLL) should be in the application folder. So, loading the DLL from another path is wrong, for an embedded usage.

Expecting/requiring the UDF's to be placed in the application folder 'tree' is therefore appropriate.

Adriano dos Santos Fernandes added a comment - 16/Oct/14 03:17 PM
> As such, all application components (including the FB engine DLL) should be in the application folder. So, loading the DLL from another path is wrong, for an embedded usage.

Wrong.

Sean Leyne added a comment - 16/Oct/14 04:39 PM
Adriano,

How is it wrong?

Adriano dos Santos Fernandes added a comment - 16/Oct/14 04:45 PM
Copying of binaries here and there for the sake of "to work" is wrong at all. Since 2.5 (at least) one can load an embedded from another directory and it should locate the files relative to the DLL place.

Sean Leyne added a comment - 16/Oct/14 08:02 PM
Actually, by Windows standard ("Windows Certified" application requirements), all application related program files/executables are required to be placed in a single Publisher/Application folder path.

Only shared application/services or common libraries (which is not the purpose of the embedded engine) are allowed to be installed in a "common location" which applications can commonly access.

So, the embedded engine and all components (UDF/ICU) are required to be in the application path.

How else are 2 applications using different embedded server versions, installed on a single system, expected to co-exist?

Karol Bieniaszewski added a comment - 17/Oct/14 05:17 AM
i do not test this, bu what if i put embeded firebird in sub folder of my application, this work in fb3? if not then i suppose it is a bug then? this follow windows cert app rules
c:\myapp\my.exe
c:\myapp\fbembeded_dir\

Vlad Khorsun added a comment - 26/Nov/14 09:52 AM
Should be fixed now. Try next snapshot build, please.

Nick added a comment - 30/Nov/14 08:52 AM
Fixed.