IBM Support

C2M1212 Messages

Troubleshooting


Problem

This document provides information about C2M1212 messages.

Resolving The Problem

Background

In V5R1, the C runtime team made a change that enabled the C2M1212 message to be sent when the free() or realloc() functions were called using an invalid pointer. In prior releases, no message was sent, and no action was taken on the memory pointed to by the invalid pointer. It was deemed dangerous to hide the fact that an application is trying to free memory that has not been allocated because the application could potentially free memory that belongs to another process. For this reason, the C2M1212 messages are now externalized.

Cases Where the Message Could Appear

The C2M1212 message could appear whenever an application attempts to call the free() or realloc() functions. If the function determines that the pointer passed to it does not point to memory that was allocated with the malloc() function, it will return without freeing the memory at the pointer offset and send the C2M1212 message.

Getting Rid of the Messages

The only way to prevent the messages from being sent is to fix the application code to properly manage its memory allocation. This can be done by carefully examining memory usage and freeing only memory that is still allocated. Heavy handed tactics of calling free on any pointer that referenced allocated memory during the application lifetime will no longer work. In addition, programmers should be aware of APIs that may modify pointers that are passed as arguments. Usage of the iconv() API is a good example of an API to check closely.

For more information on how to debug a C2M1212 message, refer to the following Rochester Support Center knowledgebase documents:

N1011792, Diagnosing and Debugging Memory Problems: C2M1211 and C2M1212 Messages:
New, Approach for C2M1212 Messages Questions: Database 'DCF Technotes (IBM i)', View 'Products', Document 'Approach for C2M1212 Messages Questions'

[{"Product":{"code":"SWG60","label":"IBM i"},"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Component":"Programming (Languages- compilers- tools)","Platform":[{"code":"PF012","label":"IBM i"}],"Version":"Version Independent","Edition":"","Line of Business":{"code":"LOB57","label":"Power"}}]

Historical Number

26340315

Document Information

Modified date:
18 December 2019

UID

nas8N1019398