<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Mar 25, 2020 at 9:10 AM Pavel Labath <<a href="mailto:pavelo@centrum.sk">pavelo@centrum.sk</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On 25/03/2020 01:04, Adrian McCarthy wrote:<br>
> I took a stab at this, but I'm not seeing any new test failures. <br>
<br>
That is odd.<br>
<br>
I was doing some stuff on windows today, so I figured I'd take a stab at<br>
this. I was kind of right that the check in ProcessLauncher windows<br>
prevents us from passing an empty environment.<br>
<br>
However, the interesting part starts when I tried to remove that check.<br>
Then the test started behaving nondeterministically -- sometimes passing<br>
and sometimes failing due to ERROR_INVALID_PARAMETER being returned from<br>
CreateProcessW. I can see how windows might need some environment<br>
variables to start up a process correctly, but I do not understand why<br>
this should be nondeterministic...<br></blockquote><div><br></div><div>Oh, I have a guess.  CreateProcessW takes a pointer to an environment block.  If that pointer is null, the process will inherit the parent environment.  If you want to pass it an empty environment, you have to have a valid pointer to an empty string (or possibly to a string with TWO terminating '\0's).</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><br>
This is beyond my knowledge of windows. It might be interesting to<br>
reduce this to a simple test case (independent of lldb) and show it to<br>
some windows expert.<br>
<br>
I am attaching a patch with the lldb changes I've made, in case you want<br>
to play around with it.<br>
<br>
> I assume<br>
> the problem you're seeing is in TestSettings.py, but I've never figured<br>
> out how to run individual Python-based lldb tests since all the<br>
> dotest.py stuff was re-written.<br>
<br>
These days we have multiple ways of achieving that. :)<br>
<br>
One way would be via the "check-lldb-api-commands-settings" target which<br>
would run all tests under api/commands/settings (i.e. TestSettings.py<br>
and TestQuoting.py).<br>
<br>
Another option would be via the lldb-dotest script.<br>
"python bin\lldb-dotest -p TestSettings.py" would just run that single<br>
file. That script passes all of its options to dotest, so you can use<br>
any of the dotest options that you used to use.<br></blockquote><div><br></div><div>I would be thrilled if either of those worked for me.  Somehow, check-lldb works, but the check-lldb-... doesn't.</div><div><br></div><div>The lldb-dotest solution always fails for me because I can't figure out WTF it wants for PYTHONHOME and PYTHONPATH.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
pl<br>
</blockquote></div></div>