www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 1857] New: Runtime segfault while profileing - jump to invalid code address

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

           Summary: Runtime segfault while profileing - jump to invalid code
                    address
           Product: D
           Version: 2.010
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla digitalmars.com
        ReportedBy: webmaster villagersonline.com


DMD 2.011
Fedora Core 6 x86_64

The following code runs fine when you compile it normally, but segfaults when
you compile it with "-profile".  It appears, from looking at gdb and "objdump
-d", that the root problem is that the code jumps to an invalid instruction. 
Note, when you test this code, to use the exact code I show here.  The error
vanishes if you change very much, even things like type or module names:



BEGIN MODULE: "main.d"

module main;

import rule_pattern;
import std.stdio;



template my_chain(RET_TYPES...)
{
  void delegate(RET_TYPES)
  of(ARG_TYPES...)(ARG_TYPES args)
  {
return null;
  }
}



typedef char[] IDENT;



int main()
{
writefln("f");

  auto myChain = my_chain!(IDENT, void delegate(rule_pattern*))
                             .of(delegate void(void delegate(IDENT)) {},
                                 delegate void(void delegate(void
delegate(rule_pattern*))) {});

writefln("a2");

  return 0;
}

BEGIN MODULE "rule_pattern.d"

module rule_pattern;

struct rule_pattern {}

END CODE


-- 
Feb 20 2008
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=1857


bugzilla digitalmars.com changed:

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





Fixed dmd 1.028 and 2.012


-- 
Mar 06 2008
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=1857


webmaster villagersonline.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |VERIFIED




-- 
Mar 07 2008
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=1857


Andrei Alexandrescu <andrei erdani.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|VERIFIED                    |RESOLVED
                 CC|                            |andrei erdani.com


-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jan 26 2013