November 02, 2015
https://issues.dlang.org/show_bug.cgi?id=15272

--- Comment #10 from ag0aep6g@gmail.com ---
(In reply to ag0aep6g from comment #7)
> Here's a reduction that segfaults reliably for me with -release -O -inline:
> ----
[...]
> ----

Reduced a little further, showing that bucketCount gets corrupted:
----
import core.stdc.stdio: printf;

pragma(inline, false) void[] calloc_(size_t bc) nothrow pure
{
    debug printf("%x\n", bc); /* prints "ffffffff", should print "1" */
    return [];
}

void main()
{
    {
        File file_;
        nop();
    }

    auto scache = StringCache(1);
}

struct File
{
    ~this() {}
}

void nop() {}

struct StringCache
{
    this(size_t bucketCount)
    {
        buckets = calloc_(bucketCount)[0 .. bucketCount];
        printf("");
    }

    void[] buckets;
}
----

--
November 02, 2015
https://issues.dlang.org/show_bug.cgi?id=15272

--- Comment #11 from ag0aep6g@gmail.com ---
(In reply to ag0aep6g from comment #10)
> Reduced a little further, showing that bucketCount gets corrupted:
> ----
[...]
> ----

And further, removing -inline from the equation (still needs -release -O):
----
import core.stdc.stdio: printf;

void[] calloc_(size_t bc) nothrow pure
{
    debug printf("%x\n", bc); /* prints "ffffffff", should print "1" */
    return [];
}

void main()
{
    try nop();
    finally {}

    StringCache scache;
    size_t bucketCount = 1;
    void[]* buckets = &scache.buckets;
    *buckets = calloc_(bucketCount)[0 .. bucketCount];
    printf("");
}

void nop() {}

struct StringCache
{
    void[] buckets;
}
----

--
November 02, 2015
https://issues.dlang.org/show_bug.cgi?id=15272

Martin Nowak <code@dawg.eu> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |code@dawg.eu

--- Comment #12 from Martin Nowak <code@dawg.eu> ---
I diggered and found https://github.com/D-Programming-Language/dmd/pull/4909 to be the culprit.

--
November 02, 2015
https://issues.dlang.org/show_bug.cgi?id=15272

safety0ff.bugz <safety0ff.bugz@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |safety0ff.bugz@gmail.com

--- Comment #13 from safety0ff.bugz <safety0ff.bugz@gmail.com> ---
(In reply to Martin Nowak from comment #12)
> I diggered and found https://github.com/D-Programming-Language/dmd/pull/4909 to be the culprit.

FWIW, the following patch fixes it for me:

--- a/src/backend/cgelem.c
+++ b/src/backend/cgelem.c
@@ -3545,8 +3545,8 @@ STATIC elem * eleq(elem *e, goal_t goal)
             {
                 e->E2 = e2->E1;
                 eb = el_bin(OPeq,ty,eb,e2->E2);
-                e2->E1 = eb;
-                e2->E2 = e;
+                e2->E1 = e;
+                e2->E2 = eb;
             }
             else
             {

--
November 02, 2015
https://issues.dlang.org/show_bug.cgi?id=15272

Walter Bright <bugzilla@digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bugzilla@digitalmars.com

--- Comment #14 from Walter Bright <bugzilla@digitalmars.com> ---
(In reply to safety0ff.bugz from comment #13)
> FWIW, the following patch fixes it for me:
> 
> --- a/src/backend/cgelem.c
> +++ b/src/backend/cgelem.c
> @@ -3545,8 +3545,8 @@ STATIC elem * eleq(elem *e, goal_t goal)
>              {
>                  e->E2 = e2->E1;
>                  eb = el_bin(OPeq,ty,eb,e2->E2);
> -                e2->E1 = eb;
> -                e2->E2 = e;
> +                e2->E1 = e;
> +                e2->E2 = eb;
>              }
>              else
>              {

https://github.com/D-Programming-Language/dmd/pull/5253

--
November 03, 2015
https://issues.dlang.org/show_bug.cgi?id=15272

--- Comment #15 from Walter Bright <bugzilla@digitalmars.com> ---
BTW, this is a critical bug.

--
November 03, 2015
https://issues.dlang.org/show_bug.cgi?id=15272

Walter Bright <bugzilla@digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Hardware|x86_64                      |All
                 OS|Linux                       |All

--
November 03, 2015
https://issues.dlang.org/show_bug.cgi?id=15272

github-bugzilla@puremagic.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--
November 03, 2015
https://issues.dlang.org/show_bug.cgi?id=15272

--- Comment #16 from github-bugzilla@puremagic.com ---
Commits pushed to stable at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/633c50a4ffd3980502eaacecf7c743e7051925a3
fix Issue 15272 - [2.069-rc2,inline] nothing written to output when -inline is
set

https://github.com/D-Programming-Language/dmd/commit/90433ba633c85ce784e971077b2af8aef389ed47 Merge pull request #5258 from MartinNowak/fix15272

fix Issue 15272 - [2.069-rc2,inline] nothing written to output when -inline is set

--
December 01, 2015
https://issues.dlang.org/show_bug.cgi?id=15272

--- Comment #17 from github-bugzilla@puremagic.com ---
Commits pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/633c50a4ffd3980502eaacecf7c743e7051925a3
fix Issue 15272 - [2.069-rc2,inline] nothing written to output when -inline is
set

https://github.com/D-Programming-Language/dmd/commit/90433ba633c85ce784e971077b2af8aef389ed47 Merge pull request #5258 from MartinNowak/fix15272

--
1 2
Next ›   Last »