Jump to page: 1 2 3
Thread overview
[phobos] phobos commit, revision 1553
May 25, 2010
dsource.org
May 25, 2010
Shin Fujishiro
May 25, 2010
Max Samukha
May 25, 2010
Shin Fujishiro
May 25, 2010
David Simcha
[phobos] Switching to git
May 26, 2010
Sean Kelly
May 26, 2010
Sean Kelly
May 26, 2010
Brad Roberts
May 25, 2010
Don Clugston
May 25, 2010
Sean Kelly
May 25, 2010
Walter Bright
May 25, 2010
phobos commit, revision 1553


user: walter

msg:
add @safe to builtin functions

http://www.dsource.org/projects/phobos/changeset/1553

May 24, 2010
Great. Yet I still cannot unittest std.math due to the following failures:

     // @@@BUG@@@
     // f = to!float("1.17549435e-38");
     // assert(feq(cast(real)f, cast(real)1.17549e-38));
     // assert(feq(cast(real)f, cast(real)float.min_normal));
     // f = to!float("3.40282347e+38");
     //assert(to!string(f) == to!string(3.40282e+38));

and

         // @@@BUG@@@
         // r = to!real(to!string(real.min_normal));
         // assert(to!string(r) == to!string(real.min_normal));
         // r = to!real(to!string(real.max));
         // assert(to!string(r) == to!string(real.max));

Then std.functional segfaults :o/.

Thoughts? I'm on the latest Ubuntu 64.


Andrei

On 05/24/2010 11:03 PM, dsource.org wrote:
> phobos commit, revision 1553
>
>
> user: walter
>
> msg:
> add @safe to builtin functions
>
> http://www.dsource.org/projects/phobos/changeset/1553
>
> _______________________________________________
> phobos mailing list
> phobos at puremagic.com
> http://lists.puremagic.com/mailman/listinfo/phobos
May 25, 2010
> Then std.functional segfaults :o/.

Reproduced! unittests for toDelegate() segfault with -O.

obj2asm showed that everything in toDelegate() was optimized away if compiled with the -O option. Then an uninitialized delegate object was returned.

Workaround:
--------------------
--- phobos/std/functional.d
+++ phobos/std/functional.d
@@ -590,7 +590,8 @@ auto ref toDelegate(F)(auto ref F fp) if
(isCallable!(F)) { auto dummyDel = &(dummy.doIt);
         df.funcPtr = dummyDel.funcptr;

-        return df.del;
+        auto del = df.del;
+        return del;
     }
 }

--------------------

toDelegate() is an auto ref function. A compiler bug allows the local
variable df.del to be returned by reference. I'm not very sure, but it
leads toDelegate() to return (reference to) uninitialized value.

I filed the bug into bugzilla: http://d.puremagic.com/issues/show_bug.cgi?id=4232


Shin
May 25, 2010
Shin, while your are at fixing toDelegate, you may want to have a look at http://d.puremagic.com/issues/show_bug.cgi?id=3909. toDelegate in its current incarnation is virtually unusable.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/phobos/attachments/20100525/6db5a6d8/attachment.html>
May 25, 2010
Max Samukha <maxsamukha at gmail.com> wrote:
> Shin, while your are at fixing toDelegate, you may want to have a look at http://d.puremagic.com/issues/show_bug.cgi?id=3909. toDelegate in its current incarnation is virtually unusable.

I suffered from a similar problem when creating AutoImplement. I think I can fix the bug.


Shin
May 25, 2010
See my comment on 3909.  I hadn't noticed how broken this code is until now because I haven't eaten my own dogfood much on toDelegate().  (I wrote the original code.)  Anyhow, it's broken because of a last-minute hack to work around a compiler bug (1818).

On 5/25/2010 8:19 AM, Shin Fujishiro wrote:
> Max Samukha<maxsamukha at gmail.com>  wrote:
> 
>> Shin, while your are at fixing toDelegate, you may want to have a look at
>> http://d.puremagic.com/issues/show_bug.cgi?id=3909. toDelegate in its
>> current incarnation is virtually unusable.
>> 
> I suffered from a similar problem when creating AutoImplement. I think I can fix the bug.
>
>
> Shin
> _______________________________________________
> phobos mailing list
> phobos at puremagic.com
> http://lists.puremagic.com/mailman/listinfo/phobos
>
> 

May 25, 2010
Thanks for looking into this, Shin. For now I commented out that unittest.

My epic saga of getting things to build hasn't ended. In fact my initial goal was just to build the html, but that uses wine, which in turn has a problem. Try this:

make -f linux.mak OS=win32wine debug

to see the following error messages:

std\math.d(1611): Error: sqrt cannot be interpreted at compile time,
because it has no available source code
std\math.d(1611): Error: sqrt cannot be interpreted at compile time,
because it has no available source code
std\math.d(1611): Error: sqrt cannot be interpreted at compile time,
because it has no available source code
std\math.d(1611): Error: sqrt cannot be interpreted at compile time,
because it has no available source code
std\math.d(1611): Error: sqrt cannot be interpreted at compile time,
because it has no available source code
std\math.d(1611): Error: sqrt cannot be interpreted at compile time,
because it has no available source code
std\math.d(1614): Error: static assert  (2L * (1L / (0.5L *
sqrt(0x1p-16382L)) / 2L) * (1L / (0.5L * sqrt(0x1p-16382L)) / 2L) <=
0x1.fffffffffffffffep+16383L) is not evaluatable at compile time

It's great to have so many people contribute to Phobos, but I've never had such a long streak of non-builds. It looks like new scale of contribution asks for corresponding responsibility. Please, make sure everything builds before checking in, and announce to this list if you broke the build and are unable to fix it without help.


Andrei

On 05/25/2010 01:29 AM, Shin Fujishiro wrote:
>> Then std.functional segfaults :o/.
>
> Reproduced! unittests for toDelegate() segfault with -O.
>
> obj2asm showed that everything in toDelegate() was optimized away if compiled with the -O option. Then an uninitialized delegate object was returned.
>
> Workaround:
> --------------------
> --- phobos/std/functional.d
> +++ phobos/std/functional.d
> @@ -590,7 +590,8 @@ auto ref toDelegate(F)(auto ref F fp) if
> (isCallable!(F)) { auto dummyDel =&(dummy.doIt);
>           df.funcPtr = dummyDel.funcptr;
>
> -        return df.del;
> +        auto del = df.del;
> +        return del;
>       }
>   }
>
> --------------------
>
> toDelegate() is an auto ref function. A compiler bug allows the local
> variable df.del to be returned by reference. I'm not very sure, but it
> leads toDelegate() to return (reference to) uninitialized value.
>
> I filed the bug into bugzilla: http://d.puremagic.com/issues/show_bug.cgi?id=4232
>
>
> Shin
> _______________________________________________
> phobos mailing list
> phobos at puremagic.com
> http://lists.puremagic.com/mailman/listinfo/phobos
May 25, 2010

----- Original Message ----
> From: Andrei Alexandrescu <andrei at erdani.com>
> My epic saga of getting things to build hasn't ended. In fact
> my initial goal was just to build the html, but that uses wine, which in turn
> has a problem.

[snip]

> It's great to have so many people contribute to Phobos, but I've never had such a long streak of non-builds. It looks like new scale of contribution asks for corresponding responsibility. Please, make sure everything builds before checking in, and announce to this list if you broke the build and are unable to fix it without help.

I understand your frustration, but it might be unreasonable to ask people to ensure a build occurs properly on all OSes before checking in, this might not be practical (disclaimer: I haven't tried building the latest, maybe the build doesn't work anywhere :)

Another option is to use branches and merging, but dsource's SVN server is very outdated, and doesn't support the better merging capability that the latest version does.

Also, why wine is needed for any building of anything?  Is it even a supported platform?

-Steve




May 25, 2010
On Tue, 2010-05-25 at 07:21 -0700, Steve Schveighoffer wrote:
> 
> ----- Original Message ----
> [snip]
> 
> > It's great to have so many people contribute to Phobos, but I've never had such a long streak of non-builds. It looks like new scale of contribution asks for corresponding responsibility. Please, make sure everything builds before checking in, and announce to this list if you broke the build and are unable to fix it without help.
> 
> I understand your frustration, but it might be unreasonable to ask people to ensure a build occurs properly on all OSes before checking in, this might not be practical (disclaimer: I haven't tried building the latest, maybe the build doesn't work anywhere :)
> 
> Another option is to use branches and merging, but dsource's SVN server is very outdated, and doesn't support the better merging capability that the latest version does.


May I suggest that we switch to a different revision control system? Besides the fact that dsource uses an ancient SVN server, I've really grown to dislike the whole concept of a centralised model for revision control.

For personal uses I've switched to git, and I'd like to ask you to consider the same for Phobos.  If you're not familiar with it, here's a presentation by Linus Torvalds, who invented it:

  http://www.youtube.com/watch?v=4XpnKHJAok8

I think he has some good points which also apply to Phobos. (Granted, as is his usual style, he is very unforgiving towards people who disagree with him.  It makes for an entertaining talk, though.)

-Lars

May 25, 2010
On 05/25/2010 09:21 AM, Steve Schveighoffer wrote:
> Also, why wine is needed for any building of anything?  Is it even a supported platform?

HTML building must be done on Windows. I prefer to use Linux for building, so I'm using wine. Building under wine allowed us to find Phobos bugs in the past and is a good and simple method to test Windows builds on Unix machines.

Andrei
« First   ‹ Prev
1 2 3