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 joshua dot i dot stone at intel dot com  2006-01-18 18:54 -------
(In reply to comment #4)
> > buildok/pmap_foreach.stp tests the unsorted case - I just modified it to test
> > the sorted case as well.
> 
> OK, but that tests only buildability.  Is there a run-time test?

I will make sure that there's a runtime test.  If possible, I will also try to
create tests of the failure case as well.


(In reply to comment #5)
> _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.

Ok, I will change the message as suggested.

> _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.

There won't be anything misleading, because the first statement within the
foreach (maybe a print, or anything) will check c->last_error before doing
anything.  Thus the error is delayed a little bit, but as long as the operations
between the error and its detection are safe, there's no problem.  I see no
reason to optimize for the error case and try to catch it sooner.


-- 


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]