Solaris Purify 4.x reports invalid pointer read/write (IPW/IPR) allocating a VBC++ 3.x sequence

From Support
Jump to: navigation, search

Question:

Purify may report IPW/IPR errors for the allocation of sequence of structures in a server implemenation method. Allocating the same sequence in the application main does not cause any errors.

For example:

IDL:

interface server {

struct Property {

// some members

};

typedef sequence PropertyList;

readonly attribute PropertyList Prop;

};

Server method for attribute Prop:

server::PropertyList_ptr Server::Prop()

{

server::PropertyList_var pList = new server::PropertyList(10);

pList->length(4);

// code to populate the property list

return pList._retn();

}

Most of the purify errors seem to be pointing to these lines in

server.C:

server::PropertyList_var pList = new server::PropertyList(10);

pList->length(4);

Purify Errors:

IPW: Invalid pointer write (10 times)

IPR: Invalid pointer read (10 times)

IPR: Invalid pointer read (10 times)

IPW: Invalid pointer write (10 times)

IPW: Invalid pointer write (10 times)

IPR: Invalid pointer read (10 times)

IPR: Invalid pointer read (10 times)

IPR: Invalid pointer read (10 times)

IPR: Invalid pointer read (10 times)

SIG: Signal handled


Answer:

The IPW/IPR errors are erroneously reported by Purify. Use the Purify

command-line option "-mark_wrapped_stacks" (or put this option in the

PURIFYOPTIONS environment variable) when using Solaris Purify 4.x with

VBC++ 3.x. This options should eliminate such errors.

(Note: make sure that the application is rebuilt and that all libraries are instrumented with the mark_wrapped_stacks option. We recommend that the developer delete all purify caches and instrumented libraries and rebuild the entire application).

The "-mark-wrapped-stacks" is not currently documented. This information was provided by Rational support in response to a problem report submitted by Inprise:

"This is a known problem and the IPR/IPW messages can be safely ignored. The work-around is to re-build your program with the options:

purify -mark-wrapped-stacks -force-rebuild $(CC) ...

You can remove the -force-rebuild option after your first re-build."

Article originally contributed by