Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.sys.acorn.programmer > #5595

Re: Memory corruption problem

Subject Re: Memory corruption problem
Newsgroups comp.sys.acorn.programmer
From Alan Adams <alan@adamshome.org.uk>
Date 2018-11-16 15:53 +0000
Message-ID <dd0dec5757.Alan.Adams@ArmX6.adamshome.org.uk> (permalink)
References <2e86dd5757.Alan.Adams@ArmX6.adamshome.org.uk> <5757e90ea1News03@avisoft.f9.co.uk>
Organization Orpheus Internet Services

Show all headers | View raw


In message <5757e90ea1News03@avisoft.f9.co.uk>
          Martin <News03@avisoft.f9.co.uk> wrote:

> On 16 Nov in article <2e86dd5757.Alan.Adams@ArmX6.adamshome.org.uk>,
>    Alan Adams <alan@adamshome.org.uk> wrote:
>> Hi

>> I have a huge BASIC project which uses TCPIP networking. I am
>> currently making some changes, and have hit a snag. Something seems
>> to be corrupting system memory. The symptoms are that at
>> apparently random times I get "file has been closed or handle is
>> invalid", mainly from my programs but occasionally also from
>> Messenger. Occasionally also the fonts get changed on the desktop,
>> and shutdown produces "font not found".

>> When I get "invalid handle" the handle value is still the one
>> previous writes to the file have used.

>> Hermes also occasionally reports a "network problem" which requires
>> a reboot. While this might be due to runaway socket allocation,
>> exhausting the supply, it also might indicate corruption of the
>> areas pointed to, in the same way I suspect the areas referenced
>> by file handles are being altered.

>> It would help if I knew what areas of memory to look at after the
>> event - the things overwritten there (if that is indeed what is
>> happening) may tell me what part of my code is getting it wrong.

> I cannot think how something that is changed within an application
> wimpslot by that application could possibly cause any other
> application problems.

> However, if you use indirection operators !?$ it is possible that
> something that *should* be within your wimpslot is not. It is
> possible to validate write addresses?

There are a huge number of indirection operaions, not least among the 
ring buffers used in the network communications. My suspicion is that 
somewhere among them a completely invalid address is being produced.

> If your applications use memory that is outside your slot (probably
> RMA?) then overrunning a block, or writing to the wrong address, can
> have predictable unpredictable results. Again, is it possible to
> validate writes?

I'm not using RMA

> If an RMA block has more written than its size, you are likely to get
> Heap errors at some time, but it depends on what and how much is
> overwritten. Note that *ReportHeap always checks the validity of the
> heap and reports any problems with the chains (see example HeapCheck
> program). This can give some clues about an overrun problem before it
> causes chaos.

> The smaller the overwrite, the harder it can be to track down - but
> yours sound larger to me.  However, remember that they could all be
> caused by spurious SYS calls as well.

I'm wondering whether a high-vector build would help. If the disk and 
socket data areas are protected, it would catch such invalid writes. 
I'm on an ARMX6, and I don't know immediately whether there is a 
high-vector build available. I seem to recall that there is.



> Martin



-- 
Alan Adams, from Northamptonshire
alan@adamshome.org.uk
http://www.nckc.org.uk/

Back to comp.sys.acorn.programmer | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Memory corruption problem Alan Adams <alan@adamshome.org.uk> - 2018-11-16 13:15 +0000
  Re: Memory corruption problem Martin <News03@avisoft.f9.co.uk> - 2018-11-16 15:21 +0000
    Re: Memory corruption problem Alan Adams <alan@adamshome.org.uk> - 2018-11-16 15:53 +0000
      Re: Memory corruption problem Martin <News03@avisoft.f9.co.uk> - 2018-11-16 20:04 +0000
        Re: Memory corruption problem Alan Adams <alan@adamshome.org.uk> - 2018-11-16 22:38 +0000
          Re: Memory corruption problem Martin <News03@avisoft.f9.co.uk> - 2018-11-16 23:46 +0000
  Re: Memory corruption problem David Buck <dbuckhome@gmail.com> - 2018-11-16 23:15 -0800
    Re: Memory corruption problem Alan Adams <alan@adamshome.org.uk> - 2018-11-17 12:21 +0000
      Re: Memory corruption problem Alan Adams <alan@adamshome.org.uk> - 2018-11-17 13:10 +0000
        Re: Memory corruption problem Martin <News03@avisoft.f9.co.uk> - 2018-11-17 19:01 +0000
          Re: Memory corruption problem Alan Adams <alan@adamshome.org.uk> - 2018-11-17 21:04 +0000
        Re: Memory corruption problem Erik G <noreply123@xs4all.nl> - 2018-11-24 20:17 +0100
    Re: Memory corruption problem "John Williams (News)" <UCEbin@tiscali.co.uk> - 2018-11-17 12:26 +0000
    Re: Memory corruption problem David Higton <dave@davehigton.me.uk> - 2018-11-17 20:59 +0000

csiph-web