@SGaist Thanks for your reply. The random crash may be caused by corrupt memory. Will use valgrind to check the code out.