Recent

Author Topic: IBX 2.3.2 is now available for download  (Read 8115 times)

tonyw

  • Full Member
  • ***
  • Posts: 140
    • MWA Software
Re: IBX 2.3.2 is now available for download
« Reply #30 on: February 14, 2019, 04:03:42 pm »
Well, I've looked at the changelog and code diffs and can't see anything obvious that could cause a a SIGSERV. Not very much has changed in this area apart from tidying up how starttransaction behaves for single database connection versus multiple database connections - and I can't see how that could affect his.

I believe the most likely reason is an out of step error, especially if you have not removed an earlier version o IBX.

The Lazarus IDE is very sticky when it comes to package references and I am just wondering if you are compiling IBX 2.3.3 using the old version of the low level fbintf package. The way to test this is to open the new package (i.e. ibx/fbintf.lpk) in the iDE before compiling your program with IBX 2.3.3. That will make the IDE choose the new version over the old.

gerardus

  • Jr. Member
  • **
  • Posts: 84
Re: IBX 2.3.2 is now available for download
« Reply #31 on: February 14, 2019, 04:41:46 pm »
I shall have a look at it as soon as I have some time, in a clean VM with a fresh Lazarus install.
But I'm pretty sure last time I removed  everything, making sure that I couldn't compile my programs before reinstalling  the 2.3.3 package.

Zoran

  • Hero Member
  • *****
  • Posts: 1429
    • http://wiki.lazarus.freepascal.org/User:Zoran
Re: IBX 2.3.2 is now available for download
« Reply #32 on: June 04, 2019, 08:44:22 pm »
Hello, Tony
I just checked out the trunk version of IBX and there is a problem currently with package fbintf -- the paths are broken (open fbintf in Lazarus' package editor and you'll see that it cannot see the files).

In 2.3.3, the paths are correct.
I'm attaching the snapshots, comparing trunk and 2.3.3 package options. In trunk version the paths should be prefixed with "fbintf\", like they are in 2.3.3.

EDIT:
Now I see that not only paths listed in "other unit files" edit box (which I surrounded in red) are wrong, but also paths in "include files", as well as "unit output directory". This can be also seen on attached screenshot.
« Last Edit: June 04, 2019, 08:53:32 pm by Zoran »

Zoran

  • Hero Member
  • *****
  • Posts: 1429
    • http://wiki.lazarus.freepascal.org/User:Zoran
Re: IBX 2.3.2 is now available for download
« Reply #33 on: June 04, 2019, 09:02:21 pm »
Sorry, I was too fast.
Not enough, actually, just to change paths.
The files were moved, reorganized, so should be added again to the package, one by one.

tonyw

  • Full Member
  • ***
  • Posts: 140
    • MWA Software
Re: IBX 2.3.2 is now available for download
« Reply #34 on: June 05, 2019, 12:17:34 am »
Apologies. Looks like a step was missing in the script that performed the last update.

The correct version of fbintf.lpk is now available in trunk

Zoran

  • Hero Member
  • *****
  • Posts: 1429
    • http://wiki.lazarus.freepascal.org/User:Zoran
Re: IBX 2.3.2 is now available for download
« Reply #35 on: June 05, 2019, 12:02:15 pm »
Thank you, Tony.

Zoran

  • Hero Member
  • *****
  • Posts: 1429
    • http://wiki.lazarus.freepascal.org/User:Zoran
Re: IBX 2.3.2 is now available for download
« Reply #36 on: June 06, 2019, 08:25:47 pm »
Hello, Tony,

I think that IBX's strategy of finding the client library path should be changed.

Please allow me to explain my today's experience:

On my Windows 7 computer, I just couldn't make IBDatabase connect.
I tried on Linux and had no problems. I tried on another computer with Windows, and it also just worked without problems.

Both these Windows machines have the same FB version installed, both have fbclient.dll of the same version (3.0.4) in System32 directory.

On both machines, FlameRobin connects without problems.
On both machines other libraries in Lazarus (I tried SQLdb and Zeos) connect without problems.

I had no idea what it could be, then, I tried to give client dll path expicitely, and I was surprised that it worked:
Code: Pascal  [Select]
  1. procedure TForm1.Button1Click(Sender: TObject);
  2. begin
  3.   // Only with this line, the connection was succesfull:
  4.   IBDatabase1.FirebirdLibraryPathName := 'C:\Windows\System32\FBCLIENT.DLL';
  5.  
  6.   IBDatabase1.DatabaseName := 'localhost/3053:employee';
  7.  
  8.   IBDatabase1.Params.Values['lc_ctype'] := 'UTF8';
  9.   IBDatabase1.Params.Values['user_name'] := 'sysdba';
  10.   IBDatabase1.Params.Values['password'] := 'masterkey';
  11.  
  12.   IBDatabase1.Connected := True;
  13. end;
  14.  

However, I know that, if IBX didn't see any client library, the components would not appear in component palette at all. Hence, it does see it.

Then I found it -- apart from FB 3.0.4, I have FB 2.5 engine installed on same machine. They use different ports.
What should matter is that the client library installed in system directory is fbclient 3.0.4.

However, there was still fbclient.dll 2.5 inside folder where FB 2.5 engine is installed. When I removed it, everything started to work, without setting the client path explicitely.

Yes, the old FB 2.5 engine is installed in default location (C:\Program files\Firebird\... etc.), and FB 3.0 is not, but that should not matter. The two services listen to different ports, and again, only newer client is installed in system folder, which is why other client utilities make their connections through it.

I could accept that the application's folder might have priority over system folder (and that is still questionable, if a programmer wants to distribute client library in application folder, he knows what he is doing and he can set FirebirdLibraryName to current directory in code).

Anyway, I strongly believe that client library which is installed in system folder must have priority over default installation folder of FB engine.

My customer could even have older Firebird server installed on current machine, but want to connect to different server which has newer FB engine. He should just install newer client, no need to touch his old server installation -- newer client library connects to older server, but the older cannot connect to new FB engine.

Don't you agree?
« Last Edit: June 06, 2019, 08:29:45 pm by Zoran »

tonyw

  • Full Member
  • ***
  • Posts: 140
    • MWA Software
Re: IBX 2.3.2 is now available for download
« Reply #37 on: June 08, 2019, 04:03:20 pm »
Zoran,

"DLL Hell" is one of the many pleasures(?) of using Windows. As you noted, things are just so much simpler under Linux. I first published about 15+ years ago the algorithm used by IBX to locate the FBCiient library under Windows and it's documented in the "Firebird Pascal API Guide" in section 3.2.2.

Briefly, the algorithm first looks in the installation folder. This is because installing the Firebird Client library along with the application follows MS guidelines (my understanding) and is the best way to avoid stealth upgrades and downgrades. This is the first action because this is what you expect in a production system.

The alogrithm next checks the registry. If Firebird has been installed using one of the official installers, then the registry key is set to the Firebird installation directory and that's where IBX will look next. This is typical of a development system where a Firebird Server has been installed alongside Lazarus and you want it available to all of your development applications.

After that you are really more into trying to get something to work in a broken system where Firebird has not been correctly installed. IBX checks well known installation folders, and then only then tries use the PATH variable. This is when it will find FBCLIENT.DLL if it is in "System32". Finally, in desperation, IBX looks for "gds32.dll". I assume that in your case, it picked up the Firebird 2.5 client DLL because it was in a well known location. Flamerobin probably skips this step.

"System32" is a bad place to locate any third party DLL. I'm sure I recall Microsoft advising against it. There are, for example, no naming conventions to make sure that someone else doesn't come along and over-write your DLL with a totally different one.

The good news is that as you observed, IBX does allow you to explcitly specify which FBClient.DLL you want when the one you want is not the one returned by the search algorithm. However, I do believe that the correct sequence is:

1. Installation folder (production systems)

2. Folder given by Firebird Registry Key (development systems).

3. Go though well known Firebird installation folders in order of Firebird 3 and downwards.

4. Finally use the PATH.

5. Give up and assume InterBase

The last three are really for non-standard installations and undofrunately, IBX cannot always second guess what you intend.


Zoran

  • Hero Member
  • *****
  • Posts: 1429
    • http://wiki.lazarus.freepascal.org/User:Zoran
Re: IBX 2.3.2 is now available for download
« Reply #38 on: June 09, 2019, 12:02:38 am »
Thank you, for thorough answer.

incendio

  • Jr. Member
  • **
  • Posts: 90
Re: IBX 2.3.2 is now available for download
« Reply #39 on: June 15, 2019, 01:35:57 pm »
Hi guys,

I tried IBX 2.3.3 on Lazarus 2.0.2 on Linux Mint 19.1.

The Project file was a modified version of multi threading example from Lazarus.

When Step Over the project (pressed F8), got an error :
The file build/glibc-otsel5/glibc-2.27/elf/dl-error-skeleton.c was not found.

The codes is something like this
Code: Pascal  [Select]
  1. // on Datamodule unit, class name DtM
  2. type
  3. Conn1: TIBDatabase;
  4. Q5: TIBQuery;
  5.  
  6. // On MainUnit.Pas
  7. DtM.Conn1.Close;
  8. DtM.Conn1.Open
  9. DtM.Q5.Close;
  10. DtM.Q5.SQL.Clear;
  11. DtM.Q5.SQL.Add('.....');
  12. DtM.Q5.Open;
  13.  

Error when DtM.Conn1.Open called. On Database Editor, test connection on Conn1 was succesfull.

Without Step Over, project runs OK.

So is this error from IBX or Lazarus?

Edited Jun,17,2019
This is not IBX problem, most likely it is from Lazarus.
« Last Edit: June 17, 2019, 06:35:44 am by incendio »

Zoran

  • Hero Member
  • *****
  • Posts: 1429
    • http://wiki.lazarus.freepascal.org/User:Zoran
Re: IBX 2.3.2 is now available for download
« Reply #40 on: June 16, 2019, 02:04:35 pm »
Hello, Tony,

I remember that for a short period there used to be the bugtracker on mwa site, but it dissappeared after a while.
Would you think about the "official" place where IBX should be discussed?
Instead of maintaing the bugtracker yourself, you might ask for a subforum in Lazarus forum, like some other libraries have. Probaby, a dedicated subforum here would be more suitable for IBX.

For example, TAChart, BGRA have their place under Graphics; then, fpspreadsheet, RichMemo have their subforums under Packages and Libraries.
For these libraries, this is the right place for asking questions and reporting bugs.

IBX is a big library, have been actively developed and maintained for several years already.
I don't know if there are some conditions that need to be satisfied for getting the subforum, but surely IBX has significance for FPC/Lazarus community which is not smaller than significance of some other libraries which have its own subforums, so in my opinion it deserves its own place here.
It could be placed either under Packages and Libraries or under Databases.

What do you think?

Zoran

  • Hero Member
  • *****
  • Posts: 1429
    • http://wiki.lazarus.freepascal.org/User:Zoran
Re: IBX 2.3.2 is now available for download
« Reply #41 on: June 16, 2019, 02:14:37 pm »
So is this error from IBX or Lazarus?

I think that there is more that you can do yourself before asking community:

First, try the same with SQLdb controls instead of IBX. Does the same problem appear?
If the answer is yes, then this is FPC or Lazarus problem and should be reported to the bugtracker.

If not, then prepare the application which shows the problem, as simple as possible. Upload this sample application here, instead of just code snippets. Tony will surely try to answer this eventually, but please first you try to do your best to help debugging.