www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 6813] New: Yet another "cannot get frame pointer" error

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=6813

           Summary: Yet another "cannot get frame pointer" error
           Product: D
           Version: unspecified
          Platform: Other
        OS/Version: Linux
            Status: NEW
          Keywords: rejects-valid
          Severity: major
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: dsimcha yahoo.com



import std.range, std.algorithm;

void main() {
    auto arr1 = [1, 2, 3, 4, 5];
    float[] f = [1, 2, 3, 4, 5];
    auto ind = sort!((int a, int b) {
        return f[a] > f[b];
    })([1, 2, 3, 4, 5]);

    auto result = indexed(arr1, ind);
}

$ dmd -inline test.d
/cis/home/dsimcha/dmd2/linux/bin64/../../src/phobos/std/range.d(5962): Error:
function
std.range.Indexed!(int[],SortedRange!(int[],__dgliteral1)).Indexed.save cannot
get frame pointer to main
/cis/home/dsimcha/dmd2/linux/bin64/../../src/phobos/std/range.d(6001): Error:
function
std.range.Indexed!(int[],SortedRange!(int[],__dgliteral1)).Indexed.opSlice
cannot get frame pointer to main

I can only reproduce this on Linux, only with -inline and only with the call to
sort(), which isn't related in any obvious way.  I can't reproduce it with GDC,
meaning it's likely a backend bug.  Therefore, my guess is that this bug is
somehow related to Linux exception handling.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Oct 14 2011
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=6813




Created an attachment (id=1040)
DustMite'd testcase

FWIW here's a DustMite reduced testcase that gives one of the errors.

test.d(26): Error: function
test.Indexed!(void[],SortedRange!(void[],__dgliteral1)).Indexed.opSlice cannot
get frame pointer to main

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Oct 17 2011
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=6813


Walter Bright <bugzilla digitalmars.com> changed:

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



19:51:45 PDT ---
What a fantastically convoluted example :-(

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Oct 20 2011
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=6813




20:21:45 PDT ---
It shrinks down to this. Compile with -inline:

struct Foo(T)
{
        Foo opSlice(size_t a, size_t b)
        {
            return Foo(_indices[a..b]);
        }

    T _indices;
}

struct SortedRange(alias pred)
{
    SortedRange opSlice(size_t a, size_t b)
    {
        return SortedRange();
    }
}

void main() {
    auto ind = SortedRange!({ })();
    auto a = Foo!(typeof(ind))();
}

It happens on Windows, too, and is not a backend bug.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Oct 20 2011
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=6813




01:40:51 PDT ---
https://github.com/D-Programming-Language/dmd/commit/3924e924c4c8d7e025efb37f9753927c5ee167f4

https://github.com/D-Programming-Language/dmd/commit/38c9b7ab70ccc061f6dad0c6b8ac0b8af06b19f9

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Oct 21 2011
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=6813


Walter Bright <bugzilla digitalmars.com> changed:

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


-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Oct 22 2011