CRE Programmer's Guide

CRE Services
Common Run-Time Environment (CRE) Programmer’s Guide528146-004
2-65
Locating the Corrupter of TNS CRE Pointers
memory access breakpoint, the debugger displays a message that shows which
statement overwrote the data.
Example 2-1
on page 2-65 shows the source code of a C program. The statement at
line 7 of the program overwrites the TNS CRE’s pointer at G[0] to the MCB.
Example 2-2
on page 2-65 shows the information written to standard log when the
program is run.
Example 2-3
on page 2-66 is an Inspect session that shows the statement that
overwrites the MCB pointer by setting a memory-access breakpoint at location zero.
The program breaks after it executes the statement at line 7.
Example 2-1. C Program That Overwrites the MCB Pointer
1. #pragma runnable
2. #pragma symbols
3. main ()
4. {
5. int *i;
6. i = 0;
7. *i = 0100;
8. *i = 0101;
9. *i = 0102;
10. }
Example 2-2. Run of C Program That Overwrites the MCB Pointer
mysubv 45> mtro
PID: 1,148 \ASYS.$FACE.MYSUBV.MTRO
\ASYS.$:1:148:61677064 - *** Run-time Error 013 ***
\ASYS.$:1:148:61677064 - MCB pointer corrupt
\ASYS.$:1:148:61677064 - From _MAIN + %24, UC.00
ABENDED: 1,148
3: Premature process termination with fatal errors or
diagnostics