Locating access violation in a link map
I had an access violation in some code put into production. We can't
reproduce it.
I can make a link map of the executable. But I was wondering if it is
possible to relate
the virtual address or the program counter identified in the access
violation to the link map in order to learn more about the location of
the access violation.
Re: Locating access violation in a link map
On Dec 5, 1:30 pm, tadamsmar <tadams...@yahoo.com> wrote:[color=blue]
> I had an access violation in some code put into production. We can't
> reproduce it.
>
> I can make a link map of the executable. But I was wondering if it is
> possible to relate
> the virtual address or the program counter identified in the access
> violation to the link map in order to learn more about the location of
> the access violation.[/color]
tadamsmar,
In a word, yes. I have done this many times for clients, and a couple
of times for myself when an error seemed, at first glance, to be
inexplicable..
You will need the LINK map, and you will also need the /MACHINE_CODE
listings of the relevant module(s) to identify the precise point of
failure. A note of caution, tracking these can be a challenge if the
code has been compiled with optimization.
- Bob Gezelter, [url]http://www.rlgsc.com[/url]
Re: Locating access violation in a link map
On Dec 5, 1:36 pm, Bob Gezelter <gezel...@rlgsc.com> wrote:[color=blue]
> On Dec 5, 1:30 pm, tadamsmar <tadams...@yahoo.com> wrote:
>[color=green]
> > I had an access violation in some code put into production. We can't
> > reproduce it.[/color]
>[color=green]
> > I can make a link map of the executable. But I was wondering if it is
> > possible to relate
> > the virtual address or the program counter identified in the access
> > violation to the link map in order to learn more about the location of
> > the access violation.[/color]
>
> tadamsmar,
>
> In a word, yes. I have done this many times for clients, and a couple
> of times for myself when an error seemed, at first glance, to be
> inexplicable..
>
> You will need the LINK map, and you will also need the /MACHINE_CODE
> listings of the relevant module(s) to identify the precise point of
> failure. A note of caution, tracking these can be a challenge if the
> code has been compiled with optimization.
>
> - Bob Gezelter,[url]http://www.rlgsc.com[/url][/color]
Thanks. Turned out to be easier than that. Had me stumped at first
because the virtual address seemed to be too big. Then I noticed that
it corresponded to a error message symbol.
Forgot to put %loc on the message which was declared as a external in
Fortran.
Re: Locating access violation in a link map
In article <0424d335-4a64-4264-b665-92e647984c87@i29g2000prf.googlegroups.com>, tadamsmar <tadamsmar@yahoo.com> writes:[color=blue]
>
>
>I had an access violation in some code put into production. We can't
>reproduce it.
>
>I can make a link map of the executable. But I was wondering if it is
>possible to relate
>the virtual address or the program counter identified in the access
>violation to the link map in order to learn more about the location of
>the access violation.[/color]
Yes.
--
VAXman- A Bored Certified VMS Kernel Mode Hacker VAXman(at)TMESIS(dot)COM
"Well my son, life is like a beanstalk, isn't it?"
[url]http://tmesis.com/drat.html[/url]
Re: Locating access violation in a link map
In article <0424d335-4a64-4264-b665-92e647984c87@i29g2000prf.googlegroups.com>, tadamsmar <tadamsmar@yahoo.com> writes:[color=blue]
> I had an access violation in some code put into production. We can't
> reproduce it.
>
> I can make a link map of the executable. But I was wondering if it is
> possible to relate
> the virtual address or the program counter identified in the access
> violation to the link map in order to learn more about the location of
> the access violation.[/color]
Yep. The link map will tell you where the code for each routine
starts (look for $CODE PSECT). The offset into the code corresponds
to the instruction you'll see when you add /list/machine_code or
something like that when you compile. And comments in the
instruction listing will help you find the line of code in a higher
level language.
Re: Locating access violation in a link map
tadamsmar wrote:[color=blue]
> I had an access violation in some code put into production. We can't
> reproduce it.
>
> I can make a link map of the executable. But I was wondering if it is
> possible to relate
> the virtual address or the program counter identified in the access
> violation to the link map in order to learn more about the location of
> the access violation.[/color]
That's the usual approach. Frequently the ACCVIO triggers an exception
handler that will output a traceback showing not only the location of
the ACCVIO but also how the program got to the particular subroutine in
which the exception occurred.