Lazarus

Programming => Databases => Topic started by: eenplus on April 22, 2021, 08:01:24 pm

Title: Reference to object set to Nil after installation of IBX Components
Post by: eenplus on April 22, 2021, 08:01:24 pm
Hallo, I've installed the latest version of the IBX components in two Lazarus versions. One on Mac High Sierra 10.13.16 ( native ) and on Windows 10 in Parallels.
After each install via the Online Package Manager and rebuilding and restarting the IDE , Lazarus quits with a 'Reference set to object is Nil' . Afterwards I need
to reinstall Lazarus.

Is this a known issue ?

Tia.

/Dirk 
Title: Re: Reference to object set to Nil after installation of IBX Components
Post by: balazsszekely on April 22, 2021, 08:38:12 pm
@eenplus
Quote
Hallo, I've installed the latest version of the IBX components in two Lazarus versions. One on Mac High Sierra 10.13.16 ( native ) and on Windows 10 in Parallels.
After each install via the Online Package Manager and rebuilding and restarting the IDE , Lazarus quits with a 'Reference set to object is Nil' . Afterwards I need
to reinstall Lazarus.

Is this a known issue ?
First of all you don't have to reinstall Lazarus, you always have a backup of the binary in the installation folder(see attached screenshot). Delete the current executable, then rename lazarus.old to lazarus.
Secondly I don't think this issue is related to OPM, please try to install IBX by opening the lpk file. Does the same error occurs?
Title: Re: Reference to object set to Nil after installation of IBX Components
Post by: eenplus on April 22, 2021, 09:55:05 pm
Hallo, as per suggestion of GetMem I did. Unfortunately same issue. I enclose an image of the error at startup. Rgds.
Title: Re: Reference to object set to Nil after installation of IBX Components
Post by: balazsszekely on April 23, 2021, 06:51:24 am
Quote
Hallo, as per suggestion of GetMem I did. Unfortunately same issue. I enclose an image of the error at startup. Rgds.

Tested with:
Lazarus: 2.0.12/Trunk
FPC:  3.2.0
OS: Windows 10

IBX works fine here.
Title: Re: Reference to object set to Nil after installation of IBX Components
Post by: eenplus on May 11, 2021, 04:33:03 pm
Still suffering with installation of IBX controls .... whatever way I install the componenten, each installation ends up with Lazarus not being able anymore to start. Always "Object reference is Nil."

And I can start over to rename the old Lazarus.app etc. to get things going.

Is there a possibility to start Lazarus in some kind of 'safe mode' , of debug mode ?

Title: Re: Reference to object set to Nil after installation of IBX Components
Post by: patyit on May 16, 2021, 10:05:45 am
I also have this problem, "Object reference is Nil." when I start the Lazarus !

XUbuntu 20.04 LTS 64bit fresh installation on new laptop (Acer Intel N5000 CPU, 8Gb RAM, 128Gb SSD),
FpcUpDeluxe FPC Fixes (v3.2.1), Lazatus Fixes (v2.0.13), date 2021.05.15.

Installed all dependencies for Lazarus, maybe something else is missing for the IBX ? 
p.s. Firebird 3.0.7 64bit installed before Lazarus and IBX !
Title: Re: Reference to object set to Nil after installation of IBX Components
Post by: egsuh on September 06, 2021, 06:43:46 am
This happens in Windows 10 as well, with Lazarus 2.0.12 and FPC 3.2.0.
Title: Re: Reference to object set to Nil after installation of IBX Components
Post by: trev on September 06, 2021, 08:18:27 am
@egsuh Did you install any IBX dependenceies first? See the post above yours, Firebird needed to be installed before IBX.
Title: Re: Reference to object set to Nil after installation of IBX Components
Post by: balazsszekely on September 06, 2021, 09:18:47 am
@egsuh Did you install any IBX dependenceies first? See the post above yours, Firebird needed to be installed before IBX.
OK. I do have Firebird running on my computer, so most likely this is the reason why IBX works at my side. Still showing a strange, cryptic message like: "Object reference is Nil", then blocking the entire IDE is not a good practice in my opinion, even when Firebird is not installed.
Title: Re: Reference to object set to Nil after installation of IBX Components
Post by: patyit on September 06, 2021, 10:36:57 am
In my case, there was a Firebird server on the machine before the IBX was installed,
however, Lazarus did not want to start.
The solution was that after installing FlameRobin, Lazarus also started smoothly !
So I’m assuming that some addiction has been fulfilled with FlameRobin, but I don’t know what !
Title: Re: Reference to object set to Nil after installation of IBX Components
Post by: tonyw on September 06, 2021, 11:15:45 am
Are you using the 32-bit or 64-bit version of Lazarus? If installing FlameRobin cured the problem, it does suggest a problem with the client library. If you are running with 32-bit Lazarus then you need the 32-bit client library and if only the 64-bit is installed then this will certainly cause problems when IBX tries to load the client library. If Flame Robin was 32-bit then would have brought in the needed 32-bit DLL

It may be that an error message needs improving here.
Title: Re: Reference to object set to Nil after installation of IBX Components
Post by: patyit on September 06, 2021, 11:54:24 am
XUbuntu 20.04 LTS 64bit, FlameRobin allso 64bit. Im not using 32bit at all.
Title: Re: Reference to object set to Nil after installation of IBX Components
Post by: patyit on September 06, 2021, 12:19:24 pm
There are the following 3 so-files with the same creation date as when the server was installed in /usr/lib/x86_64-linux-gnu/

libfbclient.so.3.0.7
@libfbclient.so.2   (symlink from libfbclient.so.3.0.7)
@libfbclient.so      (symlink from libfbclient.so.3.0.7)

may add @libfbclient.so.3 symlink, but it is not relevant to error.

I don't see what FlameRobin adds.
Title: Re: Reference to object set to Nil after installation of IBX Components
Post by: tonyw on September 06, 2021, 12:22:26 pm
The current test environment for IBX under Linux is Mint 20 which is derived from Ubuntu 20.04 and so there really should be no reason for IBX not to work.

If you look at the Flame Robin dependencies list then libfbclient2 is the only common dependency, so it does suggest that there was something wrong with your Firebird Client library that was corrected once Flame Robin was installed.

When IBX starts in the IDE, it first checks to ensure that the client library has been successfully loaded. If not then it will show the error message "'IBX is unable to locate the Firebird Library - have you remembered to install it?'" and once you click on OK, the register procedure exits allowing the IDE to continue. Your experience has pointed to the need to protect this check inside a "try..except" block as an error in loading the library can clearly block the IDE. That will be included in the next release.

Generally, the library load is very robust given that it is probably the most heavily tested and used feature. Looking through the code I did find one unprotected call to a library handle buried deep in TFBClientAPI.GetProcAddr, which will also be protected in the next release.

However, all this is really doing is improving the error message. The underlying issue seems to be with a corrupt Firebird Client Library, and the solution will always be to re-install the client library. All the error messages can do is to make this step more obvious.
Title: Re: Reference to object set to Nil after installation of IBX Components
Post by: tonyw on September 06, 2021, 12:36:35 pm
There are the following 3 so-files with the same creation date as when the server was installed in /usr/lib/x86_64-linux-gnu/

libfbclient.so.3.0.7
@libfbclient.so.2   (symlink from libfbclient.so.3.0.7)
@libfbclient.so      (symlink from libfbclient.so.3.0.7)

may add @libfbclient.so.3 symlink, but it is not relevant to error.

I don't see what FlameRobin adds.
That's the same versions that I am using. The fix may have been as simple as rebuilding your .so cache after Flame Robin was installed.
Title: Re: Reference to object set to Nil after installation of IBX Components
Post by: patyit on September 06, 2021, 12:45:42 pm
I understand Toni and thanks for the answer, but this error has already occurred twice, on two laptops, one I reinstalled, the other was brand new.
For both, the Firebird server (not just the client) was installed first, followed by Lazarus, and IBX. None of them indicated a lack of Firebird Cliens, the IBX was installed normally, but when Lazarus would have restarted it threw out this bug !
Title: Re: Reference to object set to Nil after installation of IBX Components
Post by: tonyw on September 06, 2021, 12:47:27 pm
Can you duplicate the problem as that would help track down where things are going wrong.
Title: Re: Reference to object set to Nil after installation of IBX Components
Post by: patyit on September 06, 2021, 01:07:04 pm
Is it possible that the Firebird installation script does not execute an ldconfig command?
For the next installation, I will test before installing FlameRobin if an ldconfig statement will help fix the error.
TinyPortal © 2005-2018