home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / vmsnet / internal / 1678 next >
Encoding:
Internet Message Format  |  1992-12-12  |  2.8 KB

  1. Path: sparky!uunet!usc!news.service.uci.edu!unogate!mvb.saic.com!macro32
  2. From: Arne Vajhxj <ARNE@ko.hhs.dk>
  3. Newsgroups: vmsnet.internals
  4. Subject: Re: Why does this code crash with ACCVIO?
  5. Message-ID: <01GS824V1BIA8WW79H@kopc.hhs.dk>
  6. Date: 12 Dec 1992 09:43:15 +0100
  7. Organization: Macro32<==>Vmsnet.Internals Gateway
  8. X-Gateway-Source-Info: Mailing List
  9. Lines: 82
  10.  
  11. > I apologize if the question is trivial/stupid; my VAX architecture knowledge
  12. > is rusty. I also had trouble deciding which vmsnet newsgroup should I post it
  13.  to:
  14. > I selected .internals because all other newsgroups seemed less appropriate.
  15.  
  16. To use that logic, then you must know for a fact, that there is an appropriate
  17. vmsnet group for your question :-)
  18.  
  19. > I have the following C code in my program:
  20. >
  21. >   for (i = 0; (i<SYMBOL_NAME_SIZE - 1) && (*source != '\0'); i++)
  22. >     *dest++ = *source++;
  23. >
  24. > which, when compiled (using gcc 1.39) results in :
  25. >
  26. > %SYSTEM-F-ACCVIO, access violation, reason mask=04,
  27. > virtual address=175C4, PC=25C8A,PSL=03C00000
  28. >
  29. > The machine code that generates the error is
  30. >
  31. > 025C8A:         movb (r1), (r0)
  32. >
  33. > with r0=95684(=0x175c4), r1=94591.
  34.  
  35. >  TFM says that reason mask 04 (4(dec) = 0100(bin), so that bit 2 is
  36. > on ?) means that I attempted a read-modify operation---am I right
  37. > here?  But the source and destination addresses do not seem to
  38. > overlap, so why exactly does my computer complain?
  39.  
  40. As several other answers has pointed out, then this error is a ordinary
  41. write access-violation, which means that *dest is not valid for writing.
  42. Why it is not valid for writing depends a lot on the rest of the code !!!!
  43.  
  44. >                                    I can manually deposit values at
  45. > location pointed to by dest/r0 (using debugger 'deposit *dest=...'),
  46. > so it is not a invalid address.
  47.  
  48. But now for the interesting !
  49.  
  50. The above test do NOT test what you think it tests at all !
  51.  
  52. The debugger is capable of depositing values in NOWRT psects !
  53.  
  54. Small example:
  55.  
  56. $ fortran/obj=z sys$input
  57.       PROGRAM Z
  58.       CALL DUMMY(1)
  59.       END
  60. *
  61.       SUBROUTINE DUMMY(I)
  62.       WRITE(*,*) I
  63.       RETURN
  64.       END
  65. $
  66. $ link z
  67. $ define/nolog/user dbg$process NONE
  68. $ run/debug z
  69. set mode noscreen
  70. dep 512=2
  71. go
  72. exit
  73. $ exit
  74.  
  75. (And for the less FORTRAN knowledgable: constants are passed by reference and
  76. the $PDATA psect is NOWRT !)
  77.  
  78. This little feature has been around for all the VMS versions I have
  79. used and can be quite usefull.
  80.  
  81. I once got the explanation that it is due to the fact, that the NOWRT
  82. psect actually means user-mode:readonly and the debugger runs in
  83. supervisor-mode !
  84.  
  85. Does anyone know if this stuff is documented anywhere ?
  86.  
  87.                                                           Arne
  88.  
  89. Arne Vajhxj                             local DECNET:  KO::ARNE
  90. Computer Department                     PSI:           PSI%23831001304030::ARNE
  91. Business School of Southern Denmark     Internet:      ARNE@KO.HHS.DK
  92.  
  93.