D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 20703 - Segfault on missing import in template instantiation
Summary: Segfault on missing import in template instantiation
Status: RESOLVED DUPLICATE of issue 21091
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All All
: P1 normal
Assignee: No Owner
URL:
Keywords: ice
Depends on:
Blocks:
 
Reported: 2020-03-29 03:26 UTC by moonlightsentinel
Modified: 2020-08-07 23:37 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description moonlightsentinel 2020-03-29 03:26:10 UTC
The following code causes a segfault in dmd (checked with current master):

==============================
// c.d:
import stdx.sorting;

const var = sort(string.init);
==============================

==============================
// stdx/sorting.d:
import stdx.traits : Unqual;

auto sort(Range)(Range r)
{
    return Unqual!Range.init;
}

==============================

==============================
// stdx/traits.d:
template Unqual(T)
{
    import CoreUnqual;
    alias Unqual = CoreUnqual;
}
==============================

dmd c.d
stdx\traits.d(3): Error: module CoreUnqual is in file 'CoreUnqual.d' which cannot be read
import path[0] = C:\D\dmd2\windows\bin64\..\..\src\phobos
import path[1] = C:\D\dmd2\windows\bin64\..\..\src\druntime\import
stdx\traits.d(3): Error: module CoreUnqual is in file 'CoreUnqual.d' which cannot be read
import path[0] = C:\D\dmd2\windows\bin64\..\..\src\phobos
import path[1] = C:\D\dmd2\windows\bin64\..\..\src\druntime\import
stdx\traits.d(3): Error: module CoreUnqual is in file 'CoreUnqual.d' which cannot be read
import path[0] = C:\D\dmd2\windows\bin64\..\..\src\phobos
import path[1] = C:\D\dmd2\windows\bin64\..\..\src\druntime\import
Comment 1 Boris Carvajal 2020-03-29 07:23:31 UTC
Introduced by:
commit 17208b854a0ff67bbc05576ae72b966bbe1c60cb (refs/bisect/bad)
Author: Cristian Creteanu <cristian.creteanu@protonmail.com>
Date:   Fri Dec 13 01:19:02 2019 +0200

    Issue6592 - di header file created even if errors occur (#10635)
    
    * Moved header file generation at the end
    
    * Fix Issue 6592 - di header file created even if errors occur
Comment 2 Boris Carvajal 2020-08-07 23:37:28 UTC

*** This issue has been marked as a duplicate of issue 21091 ***