The stats effect, as in
sox somefile.wav -n stats
e.g., tends to cause segmentation faults or glibc warnings and often simply hangs. This is apparently due to line 72 in stats.c:
memcpy(obuf, ibuf, len * sizeof(*olen));
As *olen is a size_t, it is 8 bytes long on my 64-bit system, while the size of one sample is only 4 bytes (32 bits). This leads to memcpy copying twice as much as was intended.
Perhaps what was meant was sizeof(*obuf)? Anyway, I attach a patch that changes it to sizeof(sox_sample_t). With this change, the stats effect works fine for me.