* * *

Author Topic: Bug in FBAdmin component  (Read 1040 times)

RedOctober

  • Full Member
  • ***
  • Posts: 218
Bug in FBAdmin component
« on: December 28, 2017, 11:37:53 pm »
I'm building a small Firebird admin untility and it was going great until I put an FBAdmin component on my TDataModule.  After that, when ever i close the running .exe, I get a SIGSEV error, and now when I try to delete the FBAdmin object at design time, it won't delete, then when I quit the IDE, it throws an error:  Access Violation

What do I do now?  I cannot delete the component that is causing the problem.  Is there an update for FBAdmin component?


taazz

  • Hero Member
  • *****
  • Posts: 5136
Re: Bug in FBAdmin component
« Reply #1 on: December 28, 2017, 11:51:07 pm »
1) open the data module's lfm file in a text editor (while the project is not open in the IDE) and delete the all references of the fbadmin project from there.
2) open the data module's pas file and delete the fbadmin variable and reference from there too.

You probably have found a bug on the designer/ide. After you delete the component manually and the project opens correctly in the IDE try to place a new one on the data module(keep a backup just in case). I bet that most likely your problem will disappear.
Good judgement is the result of experience … Experience is the result of bad judgement.

OS : Windows 7 64 bit
Laz: Lazarus 1.4.4 FPC 2.6.4 i386-win32-win32/win64

RedOctober

  • Full Member
  • ***
  • Posts: 218
Re: Bug in FBAdmin component
« Reply #2 on: December 29, 2017, 12:13:18 am »
Hi taazz,

I deleted all the stuff you recommended and the project opened and closed correctly.  So I localized the problem definitely to FBAdmin.  So I looked up this problem on BugTracker and sure enough, it is there, been reported a few days ago.  The bug is marked as "fixed" however I followed the instructions on the bug fix report and I still have the same problem.

https://bugs.freepascal.org/view.php?id=32732

I modified my FBAdmin.pp (using Notepadd++) to look like this:

destructor TFBAdmin.Destroy;
begin
  if FSvcHandle<>FB_API_NULLHANDLE then
    begin
      WaitInterval:=100;
      DisConnect;
    end;
  FOutput.Destroy;
  inherited Destroy;
end;

I then did a Run/ Clean up and Build, to build all packages.

No good.  I still have the exact same problem.  Am I supposed to build the package somehow else?

Thanks for your speedy help on my original post!

wp

  • Hero Member
  • *****
  • Posts: 4727
Re: Bug in FBAdmin component
« Reply #3 on: December 29, 2017, 12:30:22 am »
The problem is that you must recompile fpc, and this does not happen automatically. Not 100% sure if this works, but you could copy the file fbadmin.pp from (fpc)/packages/fcl-db/src/sqldb/interbase into your project folder and apply the fix. Create the instance of FBAdmin at runtime, and Lazarus will use the patched file (hopefully). Don't create the fpadmin at designtime, because this will access the unpatched version.

The safest way, however, is to switch to fpc 3.1.1 which contains the fix. It can be installed rather easily by using fpcupdeluxe (http://wiki.freepascal.org/fpcupdeluxe).
Lazarus trunk / fpc 3.0.4 / all 32-bit on Win-10

taazz

  • Hero Member
  • *****
  • Posts: 5136
Re: Bug in FBAdmin component
« Reply #4 on: December 29, 2017, 12:32:30 am »
fbadmin is part of FPC not lcl you need to rebuild fpc for the changes to take effect.
there are a number of different ways to solve this other than rebuilding fpc.
1) copy the code to a new unit and rename the class to Myfbadmin.
  a) create it dynamically OR
  b) create a new package to install it on the IDE and use that
2) copy the fbadmin.pp unit in to your application's source so it will be found first. This creates problems with duplicate units and resources so better rename it to a unique name, then added to your uses clause after the fbadmin unit name. This will not stop the IDE from crashing on exit but it will stop your application from doing so.
Good judgement is the result of experience … Experience is the result of bad judgement.

OS : Windows 7 64 bit
Laz: Lazarus 1.4.4 FPC 2.6.4 i386-win32-win32/win64

 

Recent

Get Lazarus at SourceForge.net. Fast, secure and Free Open Source software downloads Open Hub project report for Lazarus