🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: PIPE: and AmigaDOS bug (was Re: SKsh 1.4 comments)

#3405
From: Jesper Peterson
Date: Thu, 03 May 1990 07:38
41 lines
2370 bytes
In article <ROSENBER.90May2001409@ra.abo.fi> rosenber@ra.abo.fi (Robin Rosenberg INF) writes:
|There is a bug it seems in AmigaDOS 1.3 that can cause problems when a
|handler is refered to the first time. AmigaDOS may load the handler
|TWICE and create two processes when there should be only one. I had some 
|trouble debugging the following little simple script:

[ script deleted ]

|It seems AmigaDOS can be fooled to load a handler TWICE. 
|Theory:
|	TEE needs pipe:
|	Dos finds out that it has to load pipe: and starts loading it
|	Meanwhile TYPE needs pipe: and dos again finds out that pipe: has to
|	be loaded. Dos doesn't know that it is doing this already and starts
|	loading the pipe handler for the second time.
|	The result is that TEE is talking to one pipe: and TYPE to another.
|

It isn't a bug. sometimes you actually DO want handlers to get "loaded" 
for each Open() on them eg. CON:.

When a handler starts it has to indicate whether it should be "forked"
as shared text or if packets should go to the "old" instance of the handler.
The default is to fork. The handler will fork if either ??_Port or ??_Task
is NULL. ?? is the device node structure prefix (dn_ perhaps?). When I say
_either_ Port or Task I just mean that don't remember which of them it is as
I normally use a template of a handler to create new ones (I'll create a new
handler for even the most stupid reason).

A *really* well behaved handler should probably Delay() then check if
it is already in the device list and abort if it finds "itself".
In reality you don't do this of course, so you are correct in your analysis
when you suggest it is a race condition.

Jesper


-- 
ACSnet: jep@mtiame.mtia.oz                 "This lottery is my bathroom."
UUCP:	...!uunet!munnari!mtiame.oz!jep       - Peg (Married with Children)
PHONE: (03) 699-1022
Technical Details
Message-ID: <223@mtiame.oz>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rutgers!uwm.edu!zaphod.mps.ohio-state.edu!samsung!munnari.oz.au!mtiame!jep
References: <90May1.074656edt.2589@ois.db.toronto.edu> <ROSENBER.90May2001409@ra.abo.fi>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rutgers!uwm.edu!zaphod.mps.ohio-state.edu!samsung!munnari.oz.au!mtiame!jep
From: jep@mtiame.oz (Jesper Peterson)
Newsgroups: comp.sys.amiga.tech
Subject: Re: PIPE: and AmigaDOS bug (was Re: SKsh 1.4 comments)
Message-ID: <223@mtiame.oz>
Date: 3 May 90 07:38:25 GMT
References: <90May1.074656edt.2589@ois.db.toronto.edu> <ROSENBER.90May2001409@ra.abo.fi>
Organization: Metal Trades Industry Association, Victoria, Australia.
Lines: 41