Reported by a user here.
The shell reads the whole script file into memory and compile it, so shell doesn't allow script file to exceed 2G to keep the compatibility on 32bit OS. But the current limit is about 4G.
Also when reading a file in file.cpp, pread() doesn't guarantee reading until the EOF in one shot. It should be checked in a loop until the EOF or an error.