home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / os / vms / 19271 < prev    next >
Encoding:
Text File  |  1992-12-14  |  2.2 KB  |  51 lines

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