February 08, 2019
On Fri, Feb 08, 2019 at 10:45:39PM +0000, JN via Digitalmars-d-learn wrote: [...]
> Anyway, I reduced the code further manually. It's very hard to reduce it any further. For example, removing the assignments in fromEulerAngles static method hides the bug.  Likewise, replacing writeln with assert makes it work properly too.

Pity we couldn't get rid of std.stdio.  It's a pretty big piece of code, and there are plenty of places where it may go wrong inside, even though we generally expect that the bug lies elsewhere.  Oh well.  Hopefully somebody else can dig into this and figure out what's going on.

Hmm. I just glanced over the std.stdio code... it appears that somebody has added @trusted all over the place, probably just to get it to compile with @safe.  That's kinda scary... somebody needs to vet this code carefully to make sure nothing fishy's going on in there!


T

-- 
For every argument for something, there is always an equal and opposite argument against it. Debates don't give answers, only wounded or inflated egos.
February 08, 2019
On Friday, 8 February 2019 at 23:30:44 UTC, H. S. Teoh wrote:
> On Fri, Feb 08, 2019 at 10:45:39PM +0000, JN via Digitalmars-d-learn wrote: [...]
>> Anyway, I reduced the code further manually. It's very hard to reduce it any further. For example, removing the assignments in fromEulerAngles static method hides the bug.  Likewise, replacing writeln with assert makes it work properly too.
>
> Pity we couldn't get rid of std.stdio.  It's a pretty big piece of code, and there are plenty of places where it may go wrong inside, even though we generally expect that the bug lies elsewhere.  Oh well.  Hopefully somebody else can dig into this and figure out what's going on.
>
> Hmm. I just glanced over the std.stdio code... it appears that somebody has added @trusted all over the place, probably just to get it to compile with @safe.  That's kinda scary... somebody needs to vet this code carefully to make sure nothing fishy's going on in there!
>
>
> T

I can replace it with core.stdc.stdio if it's any better. Looks like any attempt to do a check for "x is null" hides the bug. I tried assert(), also tried if (x is null) throw new Exception(...)
February 08, 2019
On Fri, Feb 08, 2019 at 11:36:03PM +0000, JN via Digitalmars-d-learn wrote:
> On Friday, 8 February 2019 at 23:30:44 UTC, H. S. Teoh wrote:
[...]
> > Pity we couldn't get rid of std.stdio.
[...]
> I can replace it with core.stdc.stdio if it's any better. Looks like
> any attempt to do a check for "x is null" hides the bug. I tried
> assert(), also tried if (x is null) throw new Exception(...)

Aha!  That's an important insight.  It's almost certain that it's caused by a backend bug now.  So testing the value perturbs the codegen code path enough to mask the bug / avoid the bug.  I think from this point somebody who's familiar with the dmd backend ought to be able to track it down reasonably easily.  (Unfortunately I'm completely unfamiliar with that part of the dmd code.)


T

-- 
In order to understand recursion you must first understand recursion.
1 2 3
Next ›   Last »