Operating System - OpenVMS
1753948 Members
7271 Online
108811 Solutions
New Discussion юеВ

Re: Interpreting Symbolic dump

 
Kris Clippeleyr
Honored Contributor

Re: Interpreting Symbolic dump

Hi Ram,

A the DBG> prompt, you first type a GO to reach the "main" function. Then, type SET BREAK/EXCEPTION, and GO again.
This will cause the debugger to stop executing your program when an exception occurs. If this happens, the DBG> prompt returns, and then you can type SET MODE SCREEN,and you'll see where the error occured.

Regards,
Kris (aka Qkcl)
I'm gonna hit the highway like a battering ram on a silver-black phantom bike...
ram_47
Frequent Advisor

Re: Interpreting Symbolic dump

Here at the steps and messages that I have got

$ run
DBG>GO
%DEBUG-I-EXITSTATUS, is '%SYSTEM-S-NORMAL, normal successful completion'
DBG>SET BREAK/EXCEPTION
DBG>GO
%DEBUG-E-BADSTARTPC, cannot access start PC = 00000000
DBG>SET MODE SCREEN
- SRC -scroll-source--
%DEBUG-W-SCRNOSRCLIN, no source line for address 00000000 for display in SRC
- OUT -output---
- PROMPT -error-program-prompt--

Looks like it is not going to show me the error source :)
Antoniov.
Honored Contributor

Re: Interpreting Symbolic dump

$ run
DBG>SET BREAK/EXCEPTION
DBG>GO
%DEBUG-I-EXITSTATUS, is '%SYSTEM-S-NORMAL, normal successful completion'

Antonio Vigliotti
Antonio Maria Vigliotti
Volker Halle
Honored Contributor

Re: Interpreting Symbolic dump

Ram,


DBG>GO
%DEBUG-I-EXITSTATUS, is '%SYSTEM-S-NORMAL, normal successful completion'


your program did NOT cause an ACCVIO this time - it successfully ran until completion.

The original access violation happened in MY_FILE_READ in line 6232. If you issue a SET PROC/DUMP before running your original program, you will get a process dump written (imagename.DMP), which you can analyze with ANAL/PROCESS. On the DBG> prompt, issue DBG> EXA/INS @PC to see the failing machine code instruction.

Volker.
ram_47
Frequent Advisor

Re: Interpreting Symbolic dump

strange things happening here. initially i used to get a dump on the screen but since i started debugging the program the dump just disappeared. and now without the debug my program runs fine :-)

i think at some point i changed some code. but not sure of the change :)

anyways, i'll keep a watch on my program and see.
Willem Grooters
Honored Contributor

Re: Interpreting Symbolic dump

For interactive debugging, with all facilities the VMS debugger has (viewing code, knowing symbols) you need to compile and link with the /DEBUG qualifier. For basic debug, I should use the /NOOPTIMIZE qualifier as well.
Compile with /LIST, it gives yoy the source listing; link with /MAP/FULL that will give you the full image map, which can be very usefull (for final builds, I would strongly suggest both of these, since that will come out exteremely handy if the program crashes and you have to analyze the process dump).
If you make this your standard procedure, you never can go wrong ;-)


Ok, your dump and traceback:
%SYSTEM-F-ACCVIO, access violation, reason mask=00, virtual address=0000000A, PC=00003F3F, PSL=03C00000

Volker already explained that.
One reason could be you expect to read a value, but actually access an address; probably in an assignment, or in passing a parameter to a C-function, or one of your own.

%TRACE-F-TRACEBACK, symbolic stack dump follows
module name routine name line rel PC abs PC

MY_FILE_READ main 6232 000001C7 00003F3F

The problem is found in the main() of your program (MY_FILE_READ.C) at line 6232.

Now you take your listing and look for this line. One of the variables on that line will have a value of 10 (0000000A in hex), but you will need to access the ADDRESS of that var, not the value.

Next, to analyze (assuming you built the program like above):

$ RUN MY_FILE_READ
DBG> SET BREAK %LINE 6232
DBG> GO

and on breakpoint, examine source and each var in it, before excuting that line.

(here, it is essential you compile with /NOOPTIMIZE, to force the processor to execute the code in-line, not out-of-order (which is the default method)).


Willem Grooters
OpenVMS Developer & System Manager
Willem Grooters
Honored Contributor

Re: Interpreting Symbolic dump



Sorry, just the other way around ;-) Read this as:

One reason could be you expect to access an address but actually read an value.

Some additional hint:
DBG> EXAMINE wiill give you the CONTENTS on the variable.
DBG> EXAMINE @ will use the contents of as the address and display the contents at that address.

Consider you specified in your program:

int a
...
a = 10;

and at the breakpoint, you give:

DBG> EXAMINE a

you will get 10, and

DBG> EXAMINE @a

will give something stating you accessed a location you're not allowed to: ACCVIO, as in your crash.

Hope this explains.

Willem
Willem Grooters
OpenVMS Developer & System Manager
Hein van den Heuvel
Honored Contributor

Re: Interpreting Symbolic dump


>I would have liked to attach the code but I cannot do that.
> But I shall certainly try creating the debug script.

Just a little code around that reported line 6232 should be a good start

One good address for that address 10 could be that the source line 6232 contains a reference to a field with offset 10 within a structure where the pointer to the structure was not valid.
Something like

struct detail {char name[10], flag, ...} detail_p;
struct {long id; struct detail *detail_p; ...} control
:
detail_p = control.detail_p; /* what if NULL? */
x = detail_p->x;
:

fwiw,
Hein.
ram_47
Frequent Advisor

Re: Interpreting Symbolic dump

ok, here i am again. this time i managed to reproduce the error. yesterday after the error what i did was i initialized some of my variables in the function. so that had eliminated the error. and today to reproduce the error i have removed the variable initialization part and i get the error again.

am using a variable inside a WHILE loop which is getting incremented but never initialized. Do think this should cause the error?
Volker Halle
Honored Contributor

Re: Interpreting Symbolic dump

Ram,

why speculate ?!

Show us the failure (traceback info) and the associated source code line. Also show us the failing machine instruction (DBG> EXA/INS @PC) and the values of the registers involved in that instruction.

Volker.