Date: Fri, 6 Nov 2009 10:52:24 -0600 From: Peter Steele <psteele@maxiscale.com> To: "freebsd-questions@freebsd.org" <freebsd-questions@freebsd.org> Subject: RE: system() call causes core dump Message-ID: <7B9397B189EB6E46A5EE7B4C8A4BB7CB3394EDDF@MBX03.exg5.exghost.com> In-Reply-To: <c39ec84c0911060743sce9de02n5acb19663cf880df@mail.gmail.com> References: <7B9397B189EB6E46A5EE7B4C8A4BB7CB327D117F@MBX03.exg5.exghost.com> <4AEC5E02.8040705@FreeBSD.org> <7B9397B189EB6E46A5EE7B4C8A4BB7CB327D11A9@MBX03.exg5.exghost.com> <200911040149.48701.mel.flynn%2Bfbsd.questions@mailing.thruhere.net> <7B9397B189EB6E46A5EE7B4C8A4BB7CB3394ED41@MBX03.exg5.exghost.com> <c39ec84c0911060743sce9de02n5acb19663cf880df@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
>I am following this thread since i find it interesting ( playing around wi= th popen & threads at times ). > >I am still trying to understand what Kris said. He says it is not safe to = fork from a multithread proces. And he suggests using execve. > >You stacktrace btw is consistent with what Kris says: "and if that thread = tries to acquire a lock or other formerly-shared resource it may deadlock o= r crash, because the child process is >no longer accessing the same memory location as the threads in the parent = process". -> that's probably the spinlock in malloc. This is why we switched to vsys/vfork, assuming it would effectively do the= same thing as execve. Perhaps not not. I can give it a try. I am still cur= ious though why only this one particular system call is causing a crash. We= have many calls running in other threads and none have ever caused a probl= em. They all do the same thing, run a command and save the output in a file= , and then we process the output. The only thing different is the command w= e run in this case-fstat.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?7B9397B189EB6E46A5EE7B4C8A4BB7CB3394EDDF>