From amiga!oliveb!ames!lll-lcc!well!sjm Tue May 17 11:59:48 PDT 1988
Status: RO

Article 15198 of comp.sys.amiga:
Path: amiga!oliveb!ames!lll-lcc!well!sjm
>From: sjm@well.UUCP (Stephen Moehle)
Newsgroups: comp.sys.amiga
Subject: A bug in the OS
Keywords: bug OS ramlib
Message-ID: <5976@well.UUCP>
Date: 16 May 88 19:34:57 GMT
Lines: 13


To a CATS person:

     I have found what I believe to be a bug.  Under v1.2 (Kickstart 33.180 and
Workbench 33.59), a call to the Expunge entry point of ramlib.library will guru
the machine with the meditation 81000005: corrupted memory list.  For all other
libraries, both system libraries and ones I have written, calling the Expunge
entry point works alright.  By the way, I am using a B2000 with expanded
memory.

Stephe
{ucbvax,pacbell,hplabs}!well!sjm     or     well!sjm@lll-winken.arpa
"You heard the weirdo man.  What is truth?"


From neil@spam Wed May 18 16:47:17 1988
Return-Path: <neil@spam>
Received: from spam.amiga.uucp by tooter.amiga.uucp (1.1/SMI-3.0DEV3)
	id AA07352; Wed, 18 May 88 16:47:13 PDT
Received: by spam.amiga.uucp (1.1/SMI-3.0DEV3)
	id AA13598; Wed, 18 May 88 16:53:39 PDT
Date: Wed, 18 May 88 16:53:39 PDT
From: neil@spam (Neil Katin)
Message-Id: <8805182353.AA13598@spam.amiga.uucp>
To: bryce@spam
Subject: Re:  Suggested patch for addition to system_patch_02 (resend)
Cc: andy@spam, kodiak@spam
Status: RO

>From pyramid!sbcs!sunybcs!rutgers!cbmvax!bryce Wed May 18 15:10:39 1988
Return-Path: <pyramid!sbcs!sunybcs!rutgers!cbmvax!bryce>
From: sbcs!sunybcs!rutgers!cbmvax!bryce
Date: Tue, 17 May 88 22:52:21 EDT
Message-Id: <8805180252.AA00307@chaos.ETHER>
To: spam!amiga!neil
Subject: Re:  Suggested patch for addition to system_patch_02 (resend)
Status: R


original message:
---------------------
Code from ramlib.library:

	cmp.w  #1,LIB_OPENCNT(a5)
	bls.s  do_the_expunge
	...

That's branch less than or same.  Thus ramlib.library will expunge itself
if there is just one opener.  That's the bug.

		-Bryce
------------------------


Ah, now I understand.  Actually, that's not a bug.  its on purpose.
Ramlib plays a trick: it's opencount starts out at one.  That way,
it won't try and expunge itself when the system is out of memory.
However, if a user calls expunge, then it really tries to expunge
itself (that code used to work, but since no one ever expunges
it, who knows if it's broken due to bit rot...)

Anyway, please don't add the patch.  While I don't think it will
break anything, it won't fix anything either.

	Neil

the data init table from ramlib/amain.asm:
-----------------------------------------
dataTable:
        INITBYTE        LN_TYPE,NT_LIBRARY
        INITLONG        LN_NAME,subSysName
        INITBYTE        LIB_FLAGS,LIBF_SUMUSED!LIBF_CHANGED
        INITWORD        LIB_VERSION,VERNUM
        INITWORD        LIB_REVISION,REVNUM
        INITLONG        LIB_IDSTRING,VERSTRING
        INITWORD        LIB_OPENCNT,1
        DC.L    0




