[Issue 11939] New: selective imports inside a scope(failure) block cause compiler segfault

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Jan 16 13:30:46 PST 2014


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 at puremagic.com
        ReportedBy: zorael at gmail.com


--- Comment #0 from JR <zorael at gmail.com> 2014-01-16 13:30:42 PST ---
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
#0  Dsymbol::search_correct (this=0x857d80, ident=0x1) at dsymbol.c:436
#1  0x00000000004928ea in Import::semantic (this=0x857d80, sc=0x45b5c00) at
import.c:263
#2  0x00000000004e5233 in ImportStatement::semantic (this=0x857ea0,
sc=0x45b3e50) at statement.c:5406
#3  0x00000000004eb53a in CompoundStatement::semantic (this=0x45bb4c0,
sc=0x45b3e50) at statement.c:635
#4  0x00000000004e865a in ScopeStatement::semantic (this=0x858260,
sc=0x45b3e50) at statement.c:1071
#5  0x00000000004eb53a in CompoundStatement::semantic (this=0x45ba8b0,
sc=0x3d44cb0) at statement.c:635
#6  0x00000000004edd84 in Catch::semantic (this=this at entry=0x45ba910,
sc=0x3d44cb0, sc at entry=0x3d44bb0) at statement.c:4768
#7  0x00000000004edf29 in TryCatchStatement::semantic (this=0x45ba950,
sc=0x3d44bb0) at statement.c:4594
#8  0x00000000004eba75 in CompoundStatement::semantic (this=0x8583d0,
sc=0x3d44bb0) at statement.c:692
#9  0x0000000000474ea9 in FuncDeclaration::semantic3 (this=<optimized out>,
sc=0x3d448c0) at func.c:1330
#10 0x00000000004a7120 in Module::semantic3 (this=this at entry=0x8573a0) at
module.c:811
#11 0x00000000004a48dc in tryMain (argc=9, argv=0x863140) at mars.c:1546
#12 0x00007ffff6ff8de5 in __libc_start_main () from
/lib/x86_64-linux-gnu/libc.so.6
#13 0x0000000000402e45 in _start ()
(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: -------


More information about the Digitalmars-d-bugs mailing list