I have a multithreaded application that uses popen() for system calls. Here is the snippet. I crashes in popen() (line 2 below). 1 fp = NULL; 2 if ((fp = popen(dnsCommand, r)) == NULL) { 3 logPrint(errno, *executeDNS: popen failed. Exiting...); 4 exitProcess(__func__, __LINE__); } I caught this under xcode debug and under cli lldb. To replicate it I have to let it run for several hours, and this functions is called repeatedly during that time. I can't really tell the exact conditions that cause the crash. The error messages is Thread 43: EXC_BAD_ACCESS (code=1, address=0x3010000080e) In this case dnsCommand is dnsCommand char [200] /Applications/NetBeez/bin/dig +noall +search +stats +comments xfinity.com 2>/dev/null Here is the backtrace (lldb) bt * thread #43, stop reason = EXC_BAD_ACCESS (code=1, address=0x3010000080e) * frame #0: 0x00007ff803997d22 libsystem_c.dylib`popen + 478 frame #1: 0x000000010004b53e nbagentgdb`executeDNS(param=0x0000000128900000) at executeDNS.
11
0
1.9k