This is the mail archive of the systemtap@sourceware.org mailing list for the systemtap project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug translator/2156] check return value for _stp_pmap_agg()


------- Additional Comments From hunt at redhat dot com  2006-01-18 18:06 -------
Looking at the latest generated code, it does this
if (unlikely(NULL == _stp_pmap_agg (global_foo)))
      c->last_error = "unknown error while aggregating global_foo";
    write_unlock (& global_foo_lock);
  post_unlock_3: ;
    read_lock (& global_foo_lock);
    l->__tmp19 = _stp_map_start (_stp_pmap_get_agg(global_foo));
[...]

_stp_pmap_agg() will return NULL if the map pointer is invalid, the map type in
unknown, or it overflows.  The first two should be impossible with code from the
translator, so I suggest changing the error message to indicate an overflow
happened and suggest the map size needs increased.

_stp_pmap_get_agg() always returns a valid pointer but in the case above the
aggragated map will not be complete. So printing it anyway is safe, but
potentially misleading.


-- 


http://sourceware.org/bugzilla/show_bug.cgi?id=2156

------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]