Menu ▾ ▴

#1269 IMM: Library side behavior at failure to allocatge memory needs to be consistent

future
assigned
None
enhancement
imm
lib
major
2015-09-19
2015-03-17
No

The IMM library/agent side (IMMA) should behave consistently and follow
a consistent coding pattern for dealing with the case of failure to allocate
memory.

The IMMA library is linked with an application process that is using the IMM
service. Failure to allocate memory is rare and means that the the processor
where the application is executing is overloaded. Because the IMMA library is
hosted by a an application, there is some merrit in returning control to the
application letting it decide how to escalate. This is "nice" towards the
application, making troubleshooting simpler for those responsible for the
application.

In terms coding, the simplest solution possible should be used. The allowed
solutions in coding on the IMM library/agent side should be:

a) Return SA_AIS_ERR_NO_MEMORY
b) osafassert the pointer after malloc/calloc/strdup....
c) Nothing, i.e. segv at the next dereference.

where (a) is recommended when the allocation error occurs close to the API;
(b) is recommended in deeper levels of function invocation;
(c) is allowed in legacy library code, but should be avoided in new/updated code.

We need to allow (c) in the agent/library, otherwise this ticket would be a defect
ticket.

Writing explict if statements checking for null and writing explicit customized
syslog error messages, or trace messages is not allowed in the library for the
memory allocation failure case. Osafassert does write to the syslog but that
is allowed exception here.

Discussion

  • Anders Bjornerstedt

    • status: unassigned --> assigned
    • assigned_to: Hung Nguyen
    • Milestone: future --> 4.7-Tentative
     
  • Anders Bjornerstedt

    • Milestone: 4.7.FC --> future
     

Log in to post a comment.