🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.amiga.tech
Article #9711

Re: IEEE libraries

#9711
From: Kevin Clague
Date: Wed, 07 Sep 1988 15:18
65 lines
3474 bytes
In article <1356@percival.UUCP> billc@percival.UUCP (William Coldwell) writes:

>How come the IEEE libraries when installed are set to -1 whether they are
>being used or not?  I would like to flush them if they are not being used,
>but I would also like to know what program is using them at the time...

This is a bug in someone's code (maybe your's).  Someone has closed the
IEEE library one more time than they opened it.  In my case here is what
happened:

   1.  I open the IEEE library myself, since Manx crashes the machine
       if you don't have the library in your LIBS directory.
   2.  I put the library pointer into the same global library pointer
       that Manx uses so that Manx does not open the library also.
   3.  I use the library.
   4.  I CloseLibrary() the IEEE library since I opened it.
   5.  Manx looks at the global library pointer, if it is NULL then it
       presumes that it never opened the library and does not close it.
       If the global library pointer is not NULL, then Manx presumes
       it opened it and CloseLibrary()'s the IEEE lib.

The result of the above is that the IEEE lib is closed one more time
than it was opened.  Thus a minus one for open count instead of 0.

This results in a time bomb waiting to go off:

   1.  I open the IEEE library again and the open count goes to 0.
       (which means the system can remove the library at it's
        discression).
   2.  Someone malloc (or AllocMem's) lot's of memory and the system
       removes the IEEE library to get more RAM.
   3.  My code does an IEEE operation and crashes with random gurus
       because the library is gone.

So if you are working with Manx (maybe lattice too) and you are
explicitly opening the IEEE library, then when you close the library,
set the global library pointer to NULL (so Manx doesn't close it a
second time).

I wrote Dale Luck about this bug and he says it's a Manx bug.  I think
that the CloseLibrary code should never let the open count go negative,
but I was unable to convince Dale of this.  So you must fix it yourself.

>
> Bill
>  [Yes, I know I ask the strangest questions....]

Strange questions are appropriate for strange bugs 8^).

I presume you are writing your own code that is causing this.  If not,
then try to isolate the code that you use that causes the bug, and
call the company that wrote it and complain.  This kind of bug can
make other people's code look bad.  This is another good reason not
to have a finger pointing requester with GURU's and task helds.

>    William J. Coldwell - Amiga Attitude Adjuster {aka Software Developer}

-- 
UUCP:  kevin@amdahl.uts.amdahl.com
  or:  {sun,decwrl,hplabs,pyramid,seismo,oliveb}!amdahl!kevin
DDD:   408-737-5481
USPS:  Amdahl Corp.  M/S 249,  1250 E. Arques Av,  Sunnyvale, CA 94086

[  Any thoughts or opinions which may or may not have been expressed  ]
[  herein are my own.  They are not necessarily those of my employer. ]
Technical Details
Message-ID: <b03Kac9bnd10108qAIk@amdahl.uts.amdahl.com>
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!super!udel!gatech!ncar!mailrus!ames!amdahl!kevin
References: <1356@percival.UUCP>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!super!udel!gatech!ncar!mailrus!ames!amdahl!kevin
From: kevin@amdahl.uts.amdahl.com (Kevin Clague)
Newsgroups: comp.sys.amiga.tech
Subject: Re: IEEE libraries
Keywords: IEEE
Message-ID: <b03Kac9bnd10108qAIk@amdahl.uts.amdahl.com>
Date: 7 Sep 88 15:18:30 GMT
References: <1356@percival.UUCP>
Reply-To: kevin@amdahl.uts.amdahl.com (Kevin Clague)
Distribution: na
Organization: Amdahl Corporation,  Sunnyvale, CA 94086
Lines: 65