mimetex binary, which comes with moodle, is compiled for 32-bit architecture. Because my server have 64-bit architecture, looks like the problem comes from this point.
root@smvs:/var/www/moodle/filter/tex# file mimetex.linux.old
mimetex.linux.old: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), for GNU/Linux 2.2.5, dynamically linked (uses shared libs), for GNU/Linux 2.2.5, not stripped
root@smvs:/var/www/moodle/filter/tex# file /usr/bin/mimetex
/usr/bin/mimetex: ELF 64-bit LSB executable, AMD x86-64, version 1 (SYSV), for GNU/Linux 2.6.0, dynamically linked (uses shared libs), for GNU/Linux 2.6.0, stripped
So, this is not a bug.
The various versions of mimetex is included, so the developers can include the version for 64-bit linux also.