As far as my memory and Googling skills reach, "Argument list too long" is not a shell error, it is reported by the kernel. The argument space limit is set to 1/4 of the stack, so you might postpone the crash by increasing the stack size - but there is probably something somewhere leaking in the process, so try to detect the source. I have used
valgrind several times for similar tasks, but it slows the process significantly.