Thread overview
[Issue 17991] ICE with imports without module
Mar 29, 2018
RazvanN
Apr 04, 2018
Seb
Dec 18, 2019
Vladimir Panteleev
Apr 03, 2021
Dlang Bot
March 29, 2018
https://issues.dlang.org/show_bug.cgi?id=17991

RazvanN <razvan.nitu1305@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |razvan.nitu1305@gmail.com

--- Comment #1 from RazvanN <razvan.nitu1305@gmail.com> ---
I cannot reproduce. Compiling on git HEAD (Ubuntu 16.04) from toplevel with the
command:

> dmd a/b/package.d a/b/c.d a/e/f.d

Yields:

a/e/f.d(2): Error: module `c` from file a/b/c.d must be imported with 'import
c;'

Modifying f.d to `import a.b, c;` results in successful compilation. Please close if you cannot reproduce.

--
April 04, 2018
https://issues.dlang.org/show_bug.cgi?id=17991

Seb <greensunny12@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |ice, ice-on-valid-code,
                   |                            |pull
                 CC|                            |greensunny12@gmail.com
           Severity|major                       |critical

--- Comment #2 from Seb <greensunny12@gmail.com> ---
The "good" news - I can reproduce this:

mkdir -p a/b
touch a/b/package.d
touch a/b/c.d
mkdir -p a/e
touch a/e/f.d
echo "import a.b, a.b.c;" > a/e/f.d
dmddev a/e/f.d

Here's the segfault:

---
Program received signal SIGSEGV, Segmentation fault.
0x00005555557de19c in ScopeDsymbol::addAccessiblePackage(Package*, Prot)
(this=0x7ffff7e9eba0, p=0x0, protection=...) at dmd/dsymbol.d:1491
1491            if (pary.length <= p.tag)
#0  0x00005555557de19c in ScopeDsymbol::addAccessiblePackage(Package*, Prot)
(this=0x7ffff7e9eba0, p=0x0, protection=...) at dmd/dsymbol.d:1491
#1  0x00005555557e4076 in DsymbolSemanticVisitor::visit(Import*)
(this=0x7fffffffca40, imp=0x7ffff7e9f010) at dmd/dsymbolsem.d:1379
#2  0x00005555557b57c7 in Import::accept(Visitor*) (this=0x7ffff7e9f010,
v=0x7fffffffca40) at dmd/dimport.d:309
#3  0x00005555557e0dd1 in dsymbolSemantic(Dsymbol*, Scope*)
(dsym=0x7ffff7e9f010, sc=0x7ffff7e9f300) at dmd/dsymbolsem.d:343
#4  0x00005555557e5e7e in DsymbolSemanticVisitor::visit(Module*)
(this=0x7fffffffcaf0, m=0x7ffff7e9eba0) at dmd/dsymbolsem.d:1916
#5  0x00005555557d0916 in Module::accept(Visitor*) (this=0x7ffff7e9eba0,
v=0x7fffffffcaf0) at dmd/dmodule.d:1322
#6  0x00005555557e0dd1 in dsymbolSemantic(Dsymbol*, Scope*)
(dsym=0x7ffff7e9eba0, sc=0x0) at dmd/dsymbolsem.d:343
#7  0x0000555555873175 in dmd.mars.tryMain(ulong, const(char)**)
(argv=0x7fffffffd6a8, argc=2) at dmd/mars.d:804
#8  0x00005555558744c7 in D main () at dmd/mars.d:1098
---

... and here an attempt to fix it: https://github.com/dlang/dmd/pull/8126

--
April 10, 2018
https://issues.dlang.org/show_bug.cgi?id=17991

--- Comment #3 from github-bugzilla@puremagic.com ---
Commits pushed to master at https://github.com/dlang/dmd

https://github.com/dlang/dmd/commit/bed9bf405d1e743e8a594185cd9f40f1b2db92ad Fix Issue 17991 - ICE with imports without module

https://github.com/dlang/dmd/commit/9398ee965054f327d85e2229d679ac09d1272f00 Merge pull request #8126 from wilzbach/fix-17991

Fix Issue 17991 - ICE with imports without module merged-on-behalf-of: Razvan Nitu <RazvanN7@users.noreply.github.com>

--
December 18, 2019
https://issues.dlang.org/show_bug.cgi?id=17991

Vladimir Panteleev <dlang-bugzilla@thecybershadow.net> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |dlang-bugzilla@thecybershad
                   |                            |ow.net

--- Comment #4 from Vladimir Panteleev <dlang-bugzilla@thecybershadow.net> ---
*** Issue 20453 has been marked as a duplicate of this issue. ***

--
April 03, 2021
https://issues.dlang.org/show_bug.cgi?id=17991

--- Comment #5 from Dlang Bot <dlang-bot@dlang.rocks> ---
dlang/dmd pull request #12350 "[dmd-cxx] More fixes for package import visibility" was merged into dmd-cxx:

- 06823ee5703fadb71991fd586d3d03067d8f6218 by Sebastian Wilzbach:
  [dmd-cxx] Fix Issue 17991 - ICE with imports without module

https://github.com/dlang/dmd/pull/12350

--