zero-size malloc and ps: kvm_getprocs: Bad address

Simon 'corecode' Schubert corecode at fs.ei.tum.de
Sun May 24 01:27:11 PDT 2009


YONETANI Tomokazu wrote:
Hello.
On recent -DEVELOPMENT ps command displays a non-intuitive error message
on a non-existent pid:
  ps: kvm_getprocs: Bad address
Apparently the recent malloc reimplementation has changed malloc(3) family
so as malloc(0) now returns a pointer such that useracc() returns EFAULT
for it.
I think we should make malloc(0) return a valid pointer.  Whether to 
return NULL or a pointer is implementation specific, and I believe our 
previous malloc, and most other mallocs out there indeed return a pointer 
and don't return NULL.

cheers
  simon
--
  <3 the future  +++  RENT this banner advert  +++   ASCII Ribbon   /"\
  rock the past  +++  space for low €€€ NOW!1  +++     Campaign     \ /
Party Enjoy Relax   |   http://dragonflybsd.org      Against  HTML   \
Dude 2c 2 the max   !   http://golden-apple.biz       Mail + News   / \





More information about the Bugs mailing list