home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.os.vms
- Path: sparky!uunet!zaphod.mps.ohio-state.edu!sdd.hp.com!hplabs!nsc!voder!woodstock!news
- From: ted@airplane.sharebase.com (Ted Marshall)
- Subject: Re: Why does this code crash with ACCVIO?
- Message-ID: <1992Dec15.015544.12086@sharebase.com>
- Nntp-Posting-Host: airplane
- Reply-To: ted@airplane.sharebase.com (Ted Marshall)
- Organization: NCR/ShareBase Corporation
- References: <PRZEMEK.92Dec9100328@rrdstrad.nist.gov>
- Date: Tue, 15 Dec 92 01:55:44 GMT
- Lines: 38
-
- In article <PRZEMEK.92Dec9100328@rrdstrad.nist.gov> przemek@rrdstrad.nist.gov (Przemek Klosowski) writes:
- > for (i = 0; (i<SYMBOL_NAME_SIZE - 1) && (*source != '\0'); i++)
- > *dest++ = *source++;
- >which, when compiled (using gcc 1.39) results in :
- >%SYSTEM-F-ACCVIO, access violation, reason mask=04,
- >virtual address=175C4, PC=25C8A,PSL=03C00000
- >
- >The machine code that generates the error is
- >025C8A: movb (r1), (r0)
- >with r0=95684(=0x175c4), r1=94591. I can manually deposit values at
- >location pointed to by dest/r0 (using debugger 'deposit *dest=...'),
- >so it is not a invalid address.
- >
- > TFM says that reason mask 04 (4(dec) = 0100(bin), so that bit 2 is
- >on ?) means that I attempted a read-modify operation---am I right
- >here? But the source and destination addresses do not seem to
- >overlap, so why exactly does my computer complain?
-
- Actually, bit 2 means that it attempted a WRITE or MODIFY operation.
- Since you have no bits set, the fault was due to a WRITE or MODIFY
- to a read-only page.
-
- I reproduced your error and the debugger response in VAX C by putting
- a variable in a NOWRT psect (with a linker option) and having the
- variable on the left side of an assignment. The debugger still allowed
- me to modify the variable (I assume that the debugger changes read-
- only pages to copy-on-write while it is in control).
-
- So it looks like you have dest pointing at read-only memory. Not
- knowing the details of gcc, I'd guess that it is pointing at a
- variable somehow declared read-only or maybe a constant string.
-
- Hope this helps.
-
- --
- Ted Marshall ted@sharebase.com (408)369-5574
- NCR Corp. (ShareBase Div.) 2055A Logic Dr., San Jose, CA 95124
- The opinions expressed above are those of the poster and not his employer.
-