Friday, 26 October 2012

PStep USE and Stubs

We were recently asked to help a customer diagnose a runtime problem with their Gen application. They have a server p-step (server1) that calls an action block which in turn performs a USE of a p-step in another server load module (server2).

pstep1 --> ab --> pstep2

This worked fine until one day they re-generated the server manager for server1 and when the action block attempted the use of server2, there was a runtime failure.

The reason was because at some point they had converted the action block in this model to a 'stub' (it is developed in a different model). A p-step USE is implemented in the generated code by a runtime function call that references the called server details which resides in a table that is generated into the server manager. The Gen server manager generator needs to know about all of the servers that are called by the p-steps and subordinate action blocks. If some of these subordinate action blocks are 'stubs', then the generators will not detect that the action block calls a server and that server will not be added to the table.

However the code is still generated and the load module build will succeed. The code will also run until the point when the p-step use is invoked, at which point a runtime error will result.

This can be difficult to detect, and so we will develop a new VerifIEr check to detect these conditions.

No comments: