Isolating the PL/I Procedure in which the Corruption Occurred

The Open PL/I compiler directive -initcall is similar to the COBOL initcall directive in that it causes the compiler to inject a call to the named routine before invoking any of the user logic. Follow these steps:

  1. Compile the DEBINIT program provided in the DEBINIT Example topic as a .dll or .so in a directory included in either the Windows PATH or the UNIX LD_LIBRARY_PATH system environment variable.
  2. Recompile your entire application using the -initcall DEBINIT and -ctf 1,16 directives. See Compiler Options for details.
  3. Recreate the problem.
  4. Review your CTF trace(s).

The message from the DEBINIT program should show the corruption as occurring upon entering a given procedure. To isolate it (or at least know that it called something that corrupted memory), work backwards through the CTF tracing to find a "6" event for the calling procedure with no matching "7" event. The trace contains a matched pair of 6/7 events for each entry, so each 6 event without a matched 7 event indicates corruption.

If you cannot isolate the issue, try these suggestions in no particular order of preference:

If you are still unable to easily spot the location that is causing the memory corruption using the suggestions provided thus far, use the technique outlined in Example: Isolating a Heap Corruption Using a Macro.