[D#82224] Shared class variables in Dynalibs

forum.gupta.bugreport (2005-2010)
Dave Rabelink
Founder/Site Admin
Founder/Site Admin
Netherlands
Posts: 3390
Joined: 24 Feb 2017, 09:12
Location: Gouda, The Netherlands

[D#82224] Shared class variables in Dynalibs

Post by Dave Rabelink » 13 Apr 2005, 10:29

 Posted by:  Dave Rabelink 

Log-A-Bug has reviewed the issue listed below and determined that this is
a defect. The defect number is 82224.

Short description of problem:

(TD 3.1)
When using class variables in classes which are shared between dynalibs and
executables,
the main executable which uses the dynalib(s) crash when the application
exits.
It only crashed when the class variable is an object.

It seems the executable clears up memory which is used by dynalibs or the
dynalibs clears the
memory when the executable uses it.

The problem does not occur with SqlWindows 1.5.1 (PTF6)

This issue is found when porting to CTD3.1

Reproducable code included :

- Dynalib.apt includes a shared library (sharedlibrary.apl)
- The shared library has classes. One class uses class variables (incl an
object instance)
- The dynalib offers an exported function to set the class variable
- Build the APD
- Executable.apt includes the sharedlibrary.apl and includes the dynalib
- Executable.apt calls the exported function on button click

2 versions are made, one for CTD1.5.1 and the other for CTD3.1

Run the example and see it crashes when exiting the application.

Dave Rabelink

You do not have the required permissions to view the files attached to this post.

Pedro Vazquez

Re: [D#82224] Shared class variables in Dynalibs

Post by Pedro Vazquez » 13 Apr 2005, 14:03

 Posted by:  Pedro Vazquez 

Dave,
It is solved in TD 2005.

Regards

Pedro E. Vazquez
Buenos Aires Software S.A. -- www.bas.com.ar
Argentina

Dave Rabelink
Founder/Site Admin
Founder/Site Admin
Netherlands
Posts: 3390
Joined: 24 Feb 2017, 09:12
Location: Gouda, The Netherlands

Re: [D#82224] Shared class variables in Dynalibs

Post by Dave Rabelink » 13 Apr 2005, 15:56

Ah, nice to know.

But we need 3.1 fixed !

Pedro Vazquez

Re: [D#82224] Shared class variables in Dynalibs

Post by Pedro Vazquez » 13 Apr 2005, 16:05

 Posted by:  Pedro Vazquez 

I assume it will be fixed in the next PTF.

Pedro E. Vazquez
Buenos Aires Software S.A. -- www.bas.com.ar
Argentina

Mark

Re: [D#82224] Shared class variables in Dynalibs

Post by Mark » 14 Apr 2005, 10:49

 Posted by:  Mark 

Dave,

We had a similar issue when we moved to TD 2.0 a few years back, at design
time you ran and compiled the application, when you closed the application
rather than being returned to TD it GPF'd and you had to start all over, it
was awkward to re-produce - because we didn't know what the problem was,
eventually someone from Centura ( as was at that time I think ) visited us
and took away a test machine with the software on, I think it ended up in a
dev lab, maybe in the states where the problem was tracked down and was to
be fixed. In the meantime we implemented a workaround so I don't think we
ever tested the fix properly, but Im suprised its still there in 3.1

Dave Rabelink
Founder/Site Admin
Founder/Site Admin
Netherlands
Posts: 3390
Joined: 24 Feb 2017, 09:12
Location: Gouda, The Netherlands

Re: [D#82224] Shared class variables in Dynalibs

Post by Dave Rabelink » 23 Oct 2005, 09:22

 Posted by:  Dave Rabelink 


Maybe you could make an exported function on each dynalib which
actually sets their own shared class variables to NULL.

So dynalib X has :

SetClassVariablesToNull( ) !__Exported
Actions
Set MyClassObject.cVariable = OBJ_Null
Set AnotherObject.cVariable = OBJ_Null

And the exe calls this function from dynalib X.

I dont know if this helps, but you could try it.

Dave Rabelink
Founder/Site Admin
Founder/Site Admin
Netherlands
Posts: 3390
Joined: 24 Feb 2017, 09:12
Location: Gouda, The Netherlands

Re: [D#82224] Shared class variables in Dynalibs

Post by Dave Rabelink » 23 Oct 2005, 19:13

 Posted by:  Dave Rabelink 


I have found no issues with base data types as class variables.

So boolean, number, string, datetime and handles can savely be used as
class variables in dynalibs, even as arrays. The only situation where
TD does produces crashes when exiting are objects as class variables.

I use class variables all over the place, so i think your problem must
be found elsewhere.

Could you make a small test exe and dynalib which is failing ?

Gregor

Re: [D#82224] Shared class variables in Dynalibs

Post by Gregor » 24 Oct 2005, 09:42

 Posted by:  Gregor 

Will this ever be solved ? We just migrate from TD 1.51 to TD 3.1 and now
we
are crashing each hour.

Gregor

Mirko
Italy
Posts: 1299
Joined: 04 Apr 2017, 08:56
Location: Geneva

Re: [D#82224] Shared class variables in Dynalibs

Post by Mirko » 24 Oct 2005, 10:21

 Posted by:  Mirko BONANNO 

The work-around Dave gave us do work nicely !!!

!!CB!! 28
On SAM_AppExit
Set cDosPreHolder.cDosIcons = OBJ_Null

HTH
Mirko

Gregor

Re: [D#82224] Shared class variables in Dynalibs

Post by Gregor » 24 Oct 2005, 10:33

 Posted by:  Gregor 

Thank´s Mirko. Unfortunately we cannot use it. We don´t have the shared
class variables in the exe-file.

Gregor

Re: [D#82224] Shared class variables in Dynalibs

Post by Gregor » 25 Oct 2005, 13:01

 Posted by:  Gregor 

I tried it. But it doesn´t work. It seems, that TD doesn´t clean up class
variables in dynalibs. In my dynalib I have something like

if not binit
InitClass()

bInit is a class variable. This function is only called one time although
I
restartet my program in TD.

Gregor

Re: [D#82224] Shared class variables in Dynalibs

Post by Gregor » 16 Jan 2006, 13:52

 Posted by:  Gregor 

Up to now I wasn´t able to produce a small test.exe. But my IDE is
crashing
in my application, if I´m using class-variables. Switching this variables
to
instant-variables I have no more chrashes.

The IDE is not crashing with first application start - sometimes after
second or third application start. When exiting my application, the IDE is
crashing. There is no error-message.

I really don´t know what to do.

----------------------------------------
Ich verwende die kostenlose Version von SPAMfighter,
die bei mir bis jetzt 10 Spammails entfernt hat.
Für private Anwender ist SPAMfighter völlig kostenlos!
Jetzt gratis testen: www.SPAMfighter.com

Gregor

Re: [D#82224] Shared class variables in Dynalibs

Post by Gregor » 18 Jan 2006, 11:36

 Posted by:  Gregor 

I put an example under "Gupta TD 3.1 PFT4 crashes using apd and
class-variables" in bugreport.

Return to “gupta.bugreport”

Who is online

Users browsing this forum: [Ccbot] and 0 guests