www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 11939] New: selective imports inside a scope(failure) block cause compiler segfault

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

           Summary: selective imports inside a scope(failure) block cause
                    compiler segfault
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: zorael gmail.com



dmd (git master, cb5ace9) and ldc (merge-2.065 branch, fc8ddb) segfault when
compiling the following, as does dpaste with its dmd 2.064.2 compiler
(http://dpaste.dzfl.pl/e071e049):

---------------------------------------
import std.stdio;

void main() {
    scope(failure)
    {
        import std.string : toUpper;
        writeln("nanana".toUpper);
    }
    writeln("hello world!");
}
---------------------------------------

Changing the import line to instead import all of std.string makes it compile
again. scope(success) and scope(exit) don't seem to trigger this behavior.

gdb output is as follows:

---------------------------------------
Program received signal SIGSEGV, Segmentation fault.
Dsymbol::search_correct (this=0x857d80, ident=0x1) at dsymbol.c:436
436         return (Dsymbol *)speller(ident->toChars(), &symbol_search_fp,
(void *)this, idchars);
(gdb) bt


import.c:263

sc=0x45b3e50) at statement.c:5406

sc=0x45b3e50) at statement.c:635

sc=0x45b3e50) at statement.c:1071

sc=0x3d44cb0) at statement.c:635

sc=0x3d44cb0, sc entry=0x3d44bb0) at statement.c:4768

sc=0x3d44bb0) at statement.c:4594

sc=0x3d44bb0) at statement.c:692

sc=0x3d448c0) at func.c:1330

module.c:811


/lib/x86_64-linux-gnu/libc.so.6

(gdb) explore value ident
'ident' is a pointer to a value of type 'Identifier'
Continue exploring it as a pointer to a single value [y/n]: y
'ident' a pointer pointing to an invalid memory location.

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jan 16 2014
next sibling parent d-bugmail puremagic.com writes:
https://d.puremagic.com/issues/show_bug.cgi?id=11939


hsteoh quickfur.ath.cx changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |ice
                 CC|                            |hsteoh quickfur.ath.cx
           Severity|normal                      |critical


-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jan 19 2014
prev sibling next sibling parent d-bugmail puremagic.com writes:
https://d.puremagic.com/issues/show_bug.cgi?id=11939


yebblies <yebblies gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |pull
                 CC|                            |yebblies gmail.com
         AssignedTo|nobody puremagic.com        |yebblies gmail.com



void test11939()
{
    scope(failure)
    {
        import object : Object;
    }
    throw new Exception("");
}

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

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Feb 04 2014
prev sibling next sibling parent d-bugmail puremagic.com writes:
https://d.puremagic.com/issues/show_bug.cgi?id=11939




Commits pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/0084fe621b86ee022d05822b8f46adbabfec23f1
Fix Issue 11939 - selective imports inside a scope(failure) block cause
compiler segfault

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


Issue 11939 - selective imports inside a scope(failure) block cause compiler
segfault

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Feb 04 2014
prev sibling parent d-bugmail puremagic.com writes:
https://d.puremagic.com/issues/show_bug.cgi?id=11939


Andrej Mitrovic <andrej.mitrovich gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |andrej.mitrovich gmail.com
         Resolution|                            |FIXED


-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Feb 04 2014