invalid length may nagtive
bugfix: in freebsd, libthr may call calloc before globalinit