Thread overview
[Issue 6813] New: Yet another "cannot get frame pointer" error
Oct 14, 2011
David Simcha
Oct 18, 2011
Trass3r
Oct 21, 2011
Walter Bright
Oct 21, 2011
Walter Bright
Oct 21, 2011
Walter Bright
Oct 22, 2011
Walter Bright
October 14, 2011
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


--- Comment #0 from David Simcha <dsimcha@yahoo.com> 2011-10-14 09:02:28 PDT ---
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: -------
October 18, 2011
http://d.puremagic.com/issues/show_bug.cgi?id=6813



--- Comment #1 from Trass3r <mrmocool@gmx.de> 2011-10-17 17:46:33 PDT ---
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: -------
October 21, 2011
http://d.puremagic.com/issues/show_bug.cgi?id=6813


Walter Bright <bugzilla@digitalmars.com> changed:

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


--- Comment #2 from Walter Bright <bugzilla@digitalmars.com> 2011-10-20 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: -------
October 21, 2011
http://d.puremagic.com/issues/show_bug.cgi?id=6813



--- Comment #3 from Walter Bright <bugzilla@digitalmars.com> 2011-10-20 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: -------
October 21, 2011
http://d.puremagic.com/issues/show_bug.cgi?id=6813



--- Comment #4 from Walter Bright <bugzilla@digitalmars.com> 2011-10-21 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: -------
October 22, 2011
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: -------