labath wrote:

> > Could you also make unit tests for these two functions:
> > 
> > * call GetProgramFileSpec and make sure the result is reasonable (exists?)
> > * create a Process and make sure FindProcesses finds it (you can use 
> > [this](https://github.com/llvm/llvm-project/blob/52f568dbbb61ffe26b7973b482e0e504b405a0ab/lldb/unittests/Host/HostTest.cpp#L79)
> >  trick to re-execute yourself)
> 
> Hi @labath Created the testcases for the GetProgramFileSpec & FindProcesses.
> 
> But for the FindProcesses() testcase, we are able to launch the process but 
> later point we are seeing dump on the testcase. Could you please verify are 
> we giving the input correctly or missing something? from the logs we can see 
> that GetProcessAndStatInfo() (which is invoked from GetProcessInfo() & 
> FindProcesses()) dumping the core specifically while calling 
> GetExePathAndArch() function on linux. Could you please help to guide on 
> that.?

I'll take a look. I don't know if this is the source of the problem, but one 
thing I noticed is that you're missing some sort of synchronization to make 
sure the child process doesn't exit before you're able to observe it. A 
slightly lame but probably sufficient method to do that would be to put a long 
(say, 1 minute, it's there just to ensure the process exits if something goes 
wrong) sleep into the child, and then have the parent kill it when it is done 
with it.

https://github.com/llvm/llvm-project/pull/138687
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to