Board index » delphi » Multiple apps using IB causing GPF's

Multiple apps using IB causing GPF's

Hi,

This is the problem I've been getting that's beginning to drive me up the wall.
I'm using Delphi 1.0 on WFW 3.11 with Interbase 4 for Netware. When I have two apps
running against the same alias or even different aliases pointing to different
Interbase databases (but using the Interbase driver) I get one application causing
a GPF in another.

To narrow down this problem I created a new project using only three components. A table,
datasource and grid all linked together. No code whatsoever. I tried duplicating the
executable and running them one after another but they refused to cause a GPF. Then I
made another new project doing the same thing as I had done before. This time I had
success. First I startup up the first exe called PGPF.EXE then I started up the second
called PGPF2.EXE. Switched to the first exe and closed it. This gives me an Application
Error stating that there is an "Exception EGPFault in module PGPF2.EXE at 0002:0E31.
General Protection fault in module PGPF2.EXE at 0002:0E31". There's an OK button but
when you click it the machine hangs. A Control-Alt-Del will get you to the blue screen
where it says that PGPF.EXE has stopped responding to the system. Hit Enter and it
goes back to windows with the second exe still running.

So I tried running PGPF2.EXE first then PGPF.EXE. Then closing PGPF2.EXE. This gives me
a GPF in PGPF.EXE at 0003:0E3F.

I did a file compare between the two. Since there was no code in either the only thing
that I saw was different was that in PGPF.EXE the uses clause was:

  SysUtils, WinTypes, WinProcs, Messages, Classes, Graphics, Controls,
  Forms, Dialogs, DB, DBTables, Grids, DBGrids;

In PGPF2.EXE the uses clause was:

  SysUtils, WinTypes, WinProcs, Messages, Classes, Graphics, Controls,
  Forms, Dialogs, Grids, DBGrids, DB, DBTables;

In desperation I tried reordering the uses clause of PGPF.EXE to be the same as PGPF2.EXE.
And my problem went away! It didn't matter which way the uses clause was ordered as long
as both applications were in the same order.

So I tried doing this with the real application I was having problems with. It uses double
the number of units but I put the ones above in the same order but it still would not work
correctly with the gpf test applications. So I'm still stuck. Has anyone experienced this
problem before? I recall having this problem even when using Access and the database was
on the Netware server, so this may not be be an Interbase problem. I've also used Local
Interbase and I'm quite sure I didn't have these problems.

I tried making PGPF2.EXE use the DBDEMOS Paradox alias instead. What happens now is that
if I start PGPF2.EXE first then PGPF.EXE then close PGPF2.EXE, all is ok. But if I do
it the other way by starting PGPF.EXE first, then starting PGPF2.EXE, I get a GPF when
I try and close PGPF.EXE.

If both use the DBDEMOS alias there are no problems. So there you are. I have also
succeeded in reproducing it on another machine.

Thanks,
Hui Ong.

 

Re:Multiple apps using IB causing GPF's


I have been having the _EXACT_ same problem with some applications I
have been creating as well.  I never thought to rearrange the uses
clause.  Thanks for the tip.

As for what we narrowed the problem down to: the BDE has a bug.  Borland
TechAssist doesn't believe us, but it does.  I finally printed out a map
file, and I kept noticing that the GPF occurs in the DB unit, even
though the address pointed to by the GPF makes it seem like it is in
one's own code.

As a temporary workaround, if you are using Delphi 1.0 Client/Server,
which includes the VCL source code, you can go into the DB.PAS unit and
comment out the ServerCallBack function.  This will completely solve the
problem.  However, be advised that the SQL Hourglass cursor does not
appear as it is supposed to, and we do not know what else the
ServerCallBack function is doing -- YOU MAY EXPERIENCE SOME MALIGNANT
SIDE EFFECTS IF YOU DO THIS, though we didn't.  Borland TechAssist never
did offer any viable solutions to how to solve this problem or what
commenting out the ServerCallBack function would do.  If you can get an
answer from them, I would gladly appreciate it!

-Bill.
------------------------------------------------------------------------ Bill S. Halsey                Comp. Sci. Major/Soc. Minor           -
- 300 N Broadway                Transylvania University               -
- Lexington, KY  40508          Churning out information since 1780   -

Other Threads