I've searched through the boards, but have found nothing to help with this problem. I'm writing a program in c++ using Qt in linux, and when a box is checked I want it to run a bash script. I'm using the system("[script]") syntax. Even when I do something as basic as system("echo hello"); the program crashes with "*** glibc detected *** ./[program name] : double free or corruption (fasttop): [mem addr]" followed by a memory dump.

I've tried calling it from my main thread and from my QThread class, and no luck. I've cleaned and recompiled, nothing. Why won't my linux system() call work at all?

Thanks in advance.