C/C++ Programmer's Guide (G06.27+, H06.08+, J06.03+)
NOTE: HP recommends that the SCF MISALIGNLOG attribute be left ON (its default setting) so
that any process that is subject to rounding of misaligned addresses will generate log entries,
facilitating diagnosis and repair of the code. Only if the volume of misalignment events becomes
burdensome should this attribute be turned OFF.
The tracing facility traces exceptions that would be rounded down on a NonStop system running
any release version update (RVU) earlier than G06.17.
The tracing facility does not count and trace every misaligned address, only those that cause
round-down exceptions. Other accesses that use misaligned addresses without rounding them
down do not cause exceptions and are not counted or traced. Also, only a periodic sample of the
counted exceptions are traced by means of their own EMS event messages.
While a process runs, the tracing facility:
• Counts the number of misaligned-address exceptions that the process causes (the exception
count)
• Records the program address and code-file name of the instruction that causes the first
misaligned-address exception
Sampling
Because a process can run for a long time, the tracing facility samples the process (that is, checks
its exception data) approximately once an hour. If the process recorded an exception since the
previous sample, the tracing facility records an entry in the Event Management Service (EMS) log.
If the process ends, and any exception has occurred since the last sample, the operating system
produces a final EMS event.
The EMS event includes:
• The process’s exception count
• Details about one misaligned-address exception, including the program address, data address,
and relevant code-file names
Sampling is short and infrequent enough to avoid flooding the EMS log, even for a continuous
process with many misaligned-address exceptions. One sample logs a maximum of 100 events,
and at most one event is logged for any process.
If misaligned-address exceptions occur in different periods of a process, the operating system
produces multiple EMS events for the same process, and these EMS events might have different
program addresses.
For more details about EMS events or the EMS log, see the EMS Manual.
Misalignment Handling
Misalignment handling is determined by these SCF attributes, which are set system-wide (that is,
for all processors in the node) during system configuration:
• MISALIGNLOG
MISALIGNLOG enables or disables the tracing facility (see Misalignment Tracing Facility
(page 383)).
• TNSMISALIGN
TNSMISALIGN applies to all programs running in TNS mode or accelerated mode.
• NATIVEATOMICMISALIGN
NATIVEATOMICMISALIGN applies to calls to pTAL atomic functions in programs running in
native mode. Non-atomic accesses in native mode are always NOROUND (For the definition
of NOROUND, see Table 58: TNS Misalignment Handling Methods ).
384 Handling TNS Data Alignment