Thread overview
[phobos] unittest failure on wine
Sep 16, 2010
Shin Fujishiro
September 16, 2010
I ran this on Linux:

make OS=win32wine -f posix.mak

Testing generated/win32wine/debug/unittest/std/socket.exe object.Exception at std\process.d(538): Environment variable not found: DESKTOP_STARTUP_ID

Could someone look into the problem?


Andrei
September 16, 2010
I am not seeing that error.

Also, I wrote the code that throws that exception, namely std.process.environment.opIndex(), and I have absolutely no clue how it can be thrown.  environment is rather new, and the only place it's used in Phobos right now is in its own unittest...

The only way I can see this happening is if you do

  auto x = environment["DESKTOP_STARTUP_ID"];

or something similar.  Grepping both Phobos and druntime for DESKTOP_STARTUP_ID turns up nothing, and like I said, environment isn't used anywhere either.

Does commenting out the std.process.environment unittests help?

-Lars


On Thu, 2010-09-16 at 13:32 -0500, Andrei Alexandrescu wrote:
> I ran this on Linux:
> 
> make OS=win32wine -f posix.mak
> 
> Testing generated/win32wine/debug/unittest/std/socket.exe object.Exception at std\process.d(538): Environment variable not found: DESKTOP_STARTUP_ID
> 
> Could someone look into the problem?
> 
> 
> Andrei
> _______________________________________________
> phobos mailing list
> phobos at puremagic.com
> http://lists.puremagic.com/mailman/listinfo/phobos


September 17, 2010
Lars Tandle Kyllingstad <lars at kyllingen.net> wrote:
> I am not seeing that error.
> 
> Also, I wrote the code that throws that exception, namely std.process.environment.opIndex(), and I have absolutely no clue how it can be thrown.  environment is rather new, and the only place it's used in Phobos right now is in its own unittest...

Repro:

    environment["std_process_empty"] = "";
    assert (environment["std_process_empty"] == "");

I think it's a bug of Wine.  When a variable is an empty string ("\0"),
GetEnvironmentVariable(var, null, 0) should return 1.  But Wine's impl
returns 0.


Shin
September 17, 2010
Thanks, Shin!

Now I understand what has happened.  I got thrown off by the fact that Andrei's mail indicated that the error originated in std.socket, but I suspect he was running make with -j.  Am I right, Andrei?  (That's probably not a good idea, btw. :)

So the error actually occurs in the std.process unittest.  You are right, Shin, it's a Wine bug.  Or, I should say, *another* Wine bug -- I was already aware of a similar thing happening when a variable has a zero-length *name* (which shouldn't be allowed at all, I think).  I had already taken that fact into account in the unittest, and now I'll add this case too.

-Lars



On Fri, 2010-09-17 at 07:05 +0900, Shin Fujishiro wrote:
> Lars Tandle Kyllingstad <lars at kyllingen.net> wrote:
> > I am not seeing that error.
> > 
> > Also, I wrote the code that throws that exception, namely std.process.environment.opIndex(), and I have absolutely no clue how it can be thrown.  environment is rather new, and the only place it's used in Phobos right now is in its own unittest...
> 
> Repro:
> 
>     environment["std_process_empty"] = "";
>     assert (environment["std_process_empty"] == "");
> 
> I think it's a bug of Wine.  When a variable is an empty string ("\0"),
> GetEnvironmentVariable(var, null, 0) should return 1.  But Wine's impl
> returns 0.
> 
> 
> Shin
> _______________________________________________
> phobos mailing list
> phobos at puremagic.com
> http://lists.puremagic.com/mailman/listinfo/phobos


September 17, 2010
Yes, I always use -j. We should design unittests so they can be run in parallel, it saves a bunch of time.

Thanks for changing the unittest!

Andrei

On 9/17/10 3:38 CDT, Lars Tandle Kyllingstad wrote:
> Thanks, Shin!
>
> Now I understand what has happened.  I got thrown off by the fact that Andrei's mail indicated that the error originated in std.socket, but I suspect he was running make with -j.  Am I right, Andrei?  (That's probably not a good idea, btw. :)
>
> So the error actually occurs in the std.process unittest.  You are right, Shin, it's a Wine bug.  Or, I should say, *another* Wine bug -- I was already aware of a similar thing happening when a variable has a zero-length *name* (which shouldn't be allowed at all, I think).  I had already taken that fact into account in the unittest, and now I'll add this case too.
>
> -Lars
>
>
>
> On Fri, 2010-09-17 at 07:05 +0900, Shin Fujishiro wrote:
>> Lars Tandle Kyllingstad<lars at kyllingen.net>  wrote:
>>> I am not seeing that error.
>>>
>>> Also, I wrote the code that throws that exception, namely std.process.environment.opIndex(), and I have absolutely no clue how it can be thrown.  environment is rather new, and the only place it's used in Phobos right now is in its own unittest...
>>
>> Repro:
>>
>>      environment["std_process_empty"] = "";
>>      assert (environment["std_process_empty"] == "");
>>
>> I think it's a bug of Wine.  When a variable is an empty string ("\0"),
>> GetEnvironmentVariable(var, null, 0) should return 1.  But Wine's impl
>> returns 0.
>>
>>
>> Shin
>> _______________________________________________
>> phobos mailing list
>> phobos at puremagic.com
>> http://lists.puremagic.com/mailman/listinfo/phobos
>
>
> _______________________________________________
> phobos mailing list
> phobos at puremagic.com
> http://lists.puremagic.com/mailman/listinfo/phobos