[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: Calysto v1.5 reports on openldap_v2.4.4alpha



Domagoj Babic wrote:
On 8/20/07, Howard Chu <hyc@symas.com> wrote:
If a malloc fails in a one-shot command, that means the runtime environment is
broken, not any of our code. Whether it is very probable or totally unlikely is
irrelevant in that case.

That's one opinion. The fact that most apps I've checked so far actually guard against "broken environment" speaks for itself.

>>>
viola:~/Desktop> limit vmemoryuse 128
viola:~/Desktop> ls
Killed
viola:~/Desktop> limit vmemoryuse 1024
viola:~/Desktop> ls
ls: error while loading shared libraries: libc.so.6: failed to map segment from shared object: Cannot allocate memory
viola:~/Desktop> limit vmemoryuse 2048
viola:~/Desktop> ls
Segmentation fault
<<<


1) Sometimes you will run out of memory and just die, regardless of what kind of precautionary code you write.
2) In library code that can be invoked many times, yes, it's important to provide diagnostics.
3) In code that only executes once and then exits, it's pointless.


This is just common sense, life is short, put the effort where it matters.
--
  -- Howard Chu
  Chief Architect, Symas Corp.  http://www.symas.com
  Director, Highland Sun        http://highlandsun.com/hyc/
  Chief Architect, OpenLDAP     http://www.openldap.org/project/