home *** CD-ROM | disk | FTP | other *** search
- Path: southern.co.nz!ccom!dave
- Newsgroups: comp.sys.amiga.programmer
- From: dave@ccom.co.nz (David Eaves)
- Subject: Strange bug in window blocking Request() - comments please
- X-NewsReader: Interworks_GRn 3.0 January 12, 1996
- MIME-Version: 1.0
- Content-Type: text/plain; charset=iso-8859-1
- Content-Transfer-Encoding: 8bit
- Message-ID: <dave.0bmt@ccom.co.nz>
- Date: Mon, 1 Apr 96 12:16:14 +1200
- Organization: Community Communications
-
- I have recently encountered a bug in a program of mine whose effect only
- seems detectable if conditions are "just right". By a careful process of
- elimination I think I have tracked it to the way in which I was using an
- invisible requester to block window input. Here is the original code:
-
- InitRequester(req);
- req->LeftEdge = req->TopEdge = -1;
- req->Width = req->Height = 1;
- req->Flags = SIMPLEREQ | NOREQBACKFILL;
- Request(req, window);
-
- I am not sure where I got this piece of code from (I think I copied it
- from someone else's source), but after reading up the RKM's and autodocs
- it seems more correct to do just:
-
- InitRequester(req);
- Request(req, window);
-
- This *seems* to have eliminated the bug, but I cannot be completely sure
- yet as this change may have just stopped the bug from showing up in the
- way it was. Note that I have been developing and using the program in
- question every day for over a year, and only just discovered the problem
- on a different system under very rare circumstances. It has been run on
- the following systems without any ill effects being noticed:
-
- A3000 with AmigaOS 3.1 (my development system, enforcer running)
- A3000 with 2.1
- A4000 with 3.1 (my system at work on which I run the program every day)
- A4000 with 3.0
-
- I tried it on a chip only A1200 running 3.0 and set up with MuFS. If I
- started the program immediately after booting, exited, and did an mlist of
- a directory the owner names would be slightly garbled (eg root would show
- up as rnot). If I did anything else (such as opening a shell, or running
- a debugger) before running my program then I would not notice any ill
- effect.
-
- Does the original piece of code seem a likely culprit? Perhaps I just
- hadn't noticed the problem before as I'm usually running 3.1 rather than
- 3.0?
-
- Your comments appreciated,
- Dave
- --
- +----------------------------------------------------------------+
- David Eaves, Community Communications, Christchurch, New Zealand
- Phone: +64-3-3845024, Fax: +64-3-3841997
- EMail: dave@ccom.co.nz
- +----------------------------------------------------------------+
-