www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Segmentation fault in DMD - how to debug?

reply Andrey Zherikov <andrey.zherikov gmail.com> writes:
I'm refactoring my library by mostly moving functions between 
modules and I get DMD crashes pretty often. The latest example:
```
(No debugging symbols found in /usr/bin/dmd)
(gdb) r  -c 
-of.dub/build/argparse-test-library-unittest-linux.posix-x86_64-dmd_v2.100.0-85E634C9744FC817BD0D2766A2B6CFD9/arg
arse-test-library.o -debug -g -unittest -w -version=Have_argparse -Isource/
.dub/code/argparse-test-library-unittest-linux.posix-x86_64-dmd_v2.100.0-662575AE9496601C3D84B10DCD65
AFE_dub_test_root.d source/argparse/ansi.d source/argparse/internal/arguments.d
source/argparse/internal/completer.d source/argparse/internal/help.d
source/argparse/internal/lazystring.d source/argparse/internal/package.d
source/argparse/internal/parser.d source/argparse/internal/subcommands.d
source/argparse/internal/utils.d source/argparse/package.d -vcolumns
Starting program: /usr/bin/dmd -c 
-of.dub/build/argparse-test-library-unittest-linux.posix-x86_64-dmd_v2.100.0-85E634C9744FC817BD0D2766A2B6CFD9/arg
arse-test-library.o -debug -g -unittest -w -version=Have_argparse -Isource/
.dub/code/argparse-test-library-unittest-linux.posix-x86_64-dmd_v2.100.0-662575AE9496601C3D84B10DCD65
AFE_dub_test_root.d source/argparse/ansi.d source/argparse/internal/arguments.d
source/argparse/internal/completer.d source/argparse/internal/help.d
source/argparse/internal/lazystring.d source/argparse/internal/package.d
source/argparse/internal/parser.d source/argparse/internal/subcommands.d
source/argparse/internal/utils.d source/argparse/package.d -vcolumns
[Thread debugging using libthread_db enabled]
Using host libthread_db library 
"/lib/x86_64-linux-gnu/libthread_db.so.1".

Program received signal SIGSEGV, Segmentation fault.
0x0000555555822ee6 in 
getTypePointerBitmap::PointerBitmapVisitor::visit(TypeStruct*) ()

(gdb) where

getTypePointerBitmap::PointerBitmapVisitor::visit(TypeStruct*) ()

dmd.traits.getTypePointerBitmap(dmd.globals.Loc, dmd.mtype.Type, 
dmd.root.array.Array!(ulong).Array*) ()

dmd.traits.semanticTraits(dmd.expression.TraitsExp, 
dmd.dscope.Scope*) ()

ExpressionSemanticVisitor::visit(TraitsExp*) ()

dmd.initsem.inferType(dmd.init.Initializer, dmd.dscope.Scope*) ()

DsymbolSemanticVisitor::visit(VarDeclaration*) ()

dmd.dsymbolsem.templateInstanceSemantic(dmd.dtemplate.TemplateInstance,
dmd.dscope.Scope*, dmd.root.array.Array!(dmd.expression.Expression).(gdb)

Semantic3Visitor::visit(AggregateDeclaration*) ()

Semantic3Visitor::visit(TemplateInstance*) ()

ref dmd.globals.Param) ()

```

How do you debug and fix these things?
Sep 28 2022
next sibling parent reply Nicholas Wilson <iamthewilsonator hotmail.com> writes:
On Wednesday, 28 September 2022 at 22:48:47 UTC, Andrey Zherikov 
wrote:
 I'm refactoring my library by mostly moving functions between 
 modules and I get DMD crashes pretty often. The latest example:
 ```
 Program received signal SIGSEGV, Segmentation fault.
 0x0000555555822ee6 in 
 getTypePointerBitmap::PointerBitmapVisitor::visit(TypeStruct*) 
 ()

 (gdb) where

 getTypePointerBitmap::PointerBitmapVisitor::visit(TypeStruct*) 
 ()

 dmd.traits.getTypePointerBitmap(dmd.globals.Loc, 
 dmd.mtype.Type, dmd.root.array.Array!(ulong).Array*) ()
 ```

 How do you debug and fix these things?
This seems to stem from use of `__traits(getPointerBitmap, T)`, with a `T` that is not handled properly. If you can get a reduced test case that will make things much easier. `dustmite` (which should come with `dmd`, is useful for automatic reduction, otherwise if you have few uses of `__traits(getPointerBitmap, T)`, it might be easier to synthesise an example that crashes the compiler.
Sep 28 2022
parent reply Andrey Zherikov <andrey.zherikov gmail.com> writes:
On Wednesday, 28 September 2022 at 23:07:34 UTC, Nicholas Wilson 
wrote:
 This seems to stem from use of `__traits(getPointerBitmap, T)`, 
 with a `T` that is not handled properly. If you can get a 
 reduced test case that will make things much easier. `dustmite` 
 (which should come with `dmd`, is useful for automatic 
 reduction, otherwise if you have few uses of 
 `__traits(getPointerBitmap, T)`, it might be easier to 
 synthesise an example that crashes the compiler.
I don't use `getPointerBitmap` in my code: ``` $ grep -r --include=*.d getPointerBitmap $ ```
Sep 28 2022
parent reply Paul Backus <snarwin gmail.com> writes:
On Wednesday, 28 September 2022 at 23:15:42 UTC, Andrey Zherikov 
wrote:
 On Wednesday, 28 September 2022 at 23:07:34 UTC, Nicholas 
 Wilson wrote:
 This seems to stem from use of `__traits(getPointerBitmap, 
 T)`, with a `T` that is not handled properly. If you can get a 
 reduced test case that will make things much easier. 
 `dustmite` (which should come with `dmd`, is useful for 
 automatic reduction, otherwise if you have few uses of 
 `__traits(getPointerBitmap, T)`, it might be easier to 
 synthesise an example that crashes the compiler.
I don't use `getPointerBitmap` in my code: ``` $ grep -r --include=*.d getPointerBitmap $ ```
It's used in druntime, by `RTInfo`: https://github.com/dlang/druntime/blob/v2.100.2/src/object.d#L3695-L3702
Sep 28 2022
parent max haughton <maxhaton gmail.com> writes:
On Thursday, 29 September 2022 at 00:07:41 UTC, Paul Backus wrote:
 On Wednesday, 28 September 2022 at 23:15:42 UTC, Andrey 
 Zherikov wrote:
 On Wednesday, 28 September 2022 at 23:07:34 UTC, Nicholas 
 Wilson wrote:
 This seems to stem from use of `__traits(getPointerBitmap, 
 T)`, with a `T` that is not handled properly. If you can get 
 a reduced test case that will make things much easier. 
 `dustmite` (which should come with `dmd`, is useful for 
 automatic reduction, otherwise if you have few uses of 
 `__traits(getPointerBitmap, T)`, it might be easier to 
 synthesise an example that crashes the compiler.
I don't use `getPointerBitmap` in my code: ``` $ grep -r --include=*.d getPointerBitmap $ ```
It's used in druntime, by `RTInfo`: https://github.com/dlang/druntime/blob/v2.100.2/src/object.d#L3695-L3702
getPointerBitmap needs to be completely rewritten. Currently it uses the visitor pattern and doesn't cache anything so a N element static array gets walked N times which is very very very slow even ignoring that each one has the same result.
Sep 28 2022
prev sibling parent reply Andrey Zherikov <andrey.zherikov gmail.com> writes:
I actually see that DMD is very unstable.
Here are three consequtive calls of `dub test --coverage -v 
--build-mode singleFile` without any change in source files:

Failed:
```
C:\D\dmd2\windows\bin\..\..\src\phobos\std\sumtype.d-mixin-2084(2084,7): Error:
unterminated string constant starting at
C:\D\dmd2\windows\bin\..\..\src\phobos\std\sumtype.d-mixin-2084(2084,14)
C:\D\dmd2\windows\bin\..\..\src\phobos\std\sumtype.d-mixin-2084(2084,14):
Error: no identifier for declarator `handler`
C:\D\dmd2\windows\bin\..\..\src\phobos\std\sumtype.d-mixin-2084(2084,14):
Error: semicolon expected to close `alias` declaration
C:\D\dmd2\windows\bin\..\..\src\phobos\std\sumtype.d(2096,32): 
Error: incomplete mixin expression 
`handler`(args[`].get!(SumTypes[`].Types[`])(), )`
C:\D\dmd2\windows\bin\..\..\src\phobos\std\sumtype.d(2096,32): 
Error: incomplete mixin expression 
`handler`(args[`].get!(SumTypes[`].Types[1])(), )`
C:\D\dmd2\windows\bin\..\..\src\phobos\std\sumtype.d(2096,32): 
Error: incomplete mixin expression 
`handler`(args[`].get!(SumTypes[`].Types[2])(), )`
C:\D\dmd2\windows\bin\..\..\src\phobos\std\sumtype.d(2096,32): 
Error: incomplete mixin expression 
`handler`(args[`].get!(SumTypes[`].Types[3])(), )`
C:\D\dmd2\windows\bin\..\..\src\phobos\std\sumtype.d(2096,32): 
Error: incomplete mixin expression 
`handler`(args[`].get!(SumTypes[`].Types[4])(), )`
C:\D\dmd2\windows\bin\..\..\src\phobos\std\sumtype.d(1662,52): 
Error: template instance 
`argparse.internal.parser.Parser.parse!(false, 
Init).parse.matchImpl!(SumType!(Unknown, EndOfArgs, Positional, 
NamedShort, NamedLong))` error instantiating
source\argparse\internal\parser.d(234,19):        instantiated 
from here: `match!(SumType!(Unknown, EndOfArgs, Positional, 
NamedShort, NamedLong))`
source\argparse\internal\subcommands.d(138,47):        
instantiated from here: `parse!(false, Init)`
source\argparse\internal\subcommands.d(103,17):        
instantiated from here: `ParsingSubCommandArgument!(Config('=', 
'\xff', '-', "--", false, false, true, StylingMode.autodetect, 
null, Style(TextStyle([cast(ubyte)1u]), 
TextStyle([cast(ubyte)1u]), TextStyle([cast(ubyte)1u, 
cast(ubyte)4u]), TextStyle([cast(ubyte)93u]), 
TextStyle([cast(ubyte)3u]), TextStyle([cast(ubyte)93u])), null), 
Init, CommandInfo(["init"], LazyString(SumType(Storage(null, ), 
cast(ubyte)0u)), LazyString(SumType(Storage("Print initialization 
script for shell completion.", ), cast(ubyte)0u)), 
LazyString(SumType(Storage("Print initialization script.", ), 
cast(ubyte)0u)), LazyString(SumType(Storage(null, ), 
cast(ubyte)0u))), Complete!(T), "cmd", false)`
source\argparse\internal\package.d(402,32):        ... (4 
instantiations, -v to show) ...
source\argparse\package.d(999,46):        instantiated from here: 
`callParser!(Config('=', '\xff', '-', "--", false, false, true, 
StylingMode.autodetect, null, Style(TextStyle([cast(ubyte)1u]), 
TextStyle([cast(ubyte)1u]), TextStyle([cast(ubyte)1u, 
cast(ubyte)4u]), TextStyle([cast(ubyte)93u]), 
TextStyle([cast(ubyte)3u]), TextStyle([cast(ubyte)93u])), null), 
false, Complete!(T))`
source\argparse\package.d(794,12):        instantiated from here: 
`CLI!(Config('=', '\xff', '-', "--", false, false, true, 
StylingMode.autodetect, null, Style(TextStyle([cast(ubyte)1u]), 
TextStyle([cast(ubyte)1u]), TextStyle([cast(ubyte)1u, 
cast(ubyte)4u]), TextStyle([cast(ubyte)93u]), 
TextStyle([cast(ubyte)3u]), TextStyle([cast(ubyte)93u])), null), 
T)`
C:\D\dmd2\windows\bin\..\..\src\phobos\std\sumtype.d-mixin-2084(2084,7): Error:
unterminated string constant starting at
C:\D\dmd2\windows\bin\..\..\src\phobos\std\sumtype.d-mixin-2084(2084,14)
C:\D\dmd2\windows\bin\..\..\src\phobos\std\sumtype.d-mixin-2084(2084,14):
Error: no identifier for declarator `handler`
C:\D\dmd2\windows\bin\..\..\src\phobos\std\sumtype.d-mixin-2084(2084,14):
Error: semicolon expected to close `alias` declaration
C:\D\dmd2\windows\bin\..\..\src\phobos\std\sumtype.d(2096,32): 
Error: incomplete mixin expression 
`handler`(args[`].get!(SumTypes[`].Types[`])(), )`
C:\D\dmd2\windows\bin\..\..\src\phobos\std\sumtype.d(2096,32): 
Error: incomplete mixin expression 
`handler`(args[`].get!(SumTypes[`].Types[1])(), )`
C:\D\dmd2\windows\bin\..\..\src\phobos\std\sumtype.d(2096,32): 
Error: incomplete mixin expression 
`handler`(args[`].get!(SumTypes[`].Types[2])(), )`
C:\D\dmd2\windows\bin\..\..\src\phobos\std\sumtype.d(2096,32): 
Error: incomplete mixin expression 
`handler`(args[`].get!(SumTypes[`].Types[3])(), )`
C:\D\dmd2\windows\bin\..\..\src\phobos\std\sumtype.d(2096,32): 
Error: incomplete mixin expression 
`handler`(args[`].get!(SumTypes[`].Types[4])(), )`
C:\D\dmd2\windows\bin\..\..\src\phobos\std\sumtype.d(1662,52): 
Error: template instance 
`argparse.internal.parser.Parser.parse!(true, 
Init).parse.matchImpl!(SumType!(Unknown, EndOfArgs, Positional, 
NamedShort, NamedLong))` error instantiating
source\argparse\internal\parser.d(234,19):        instantiated 
from here: `match!(SumType!(Unknown, EndOfArgs, Positional, 
NamedShort, NamedLong))`
source\argparse\internal\subcommands.d(138,47):        
instantiated from here: `parse!(true, Init)`
source\argparse\internal\subcommands.d(104,17):        
instantiated from here: `ParsingSubCommandArgument!(Config('=', 
'\xff', '-', "--", false, false, true, StylingMode.autodetect, 
null, Style(TextStyle([cast(ubyte)1u]), 
TextStyle([cast(ubyte)1u]), TextStyle([cast(ubyte)1u, 
cast(ubyte)4u]), TextStyle([cast(ubyte)93u]), 
TextStyle([cast(ubyte)3u]), TextStyle([cast(ubyte)93u])), null), 
Init, CommandInfo(["init"], LazyString(SumType(Storage(null, ), 
cast(ubyte)0u)), LazyString(SumType(Storage("Print initialization 
script for shell completion.", ), cast(ubyte)0u)), 
LazyString(SumType(Storage("Print initialization script.", ), 
cast(ubyte)0u)), LazyString(SumType(Storage(null, ), 
cast(ubyte)0u))), Complete!(T), "cmd", true)`
source\argparse\internal\package.d(402,32):        ... (4 
instantiations, -v to show) ...
source\argparse\package.d(999,46):        instantiated from here: 
`callParser!(Config('=', '\xff', '-', "--", false, false, true, 
StylingMode.autodetect, null, Style(TextStyle([cast(ubyte)1u]), 
TextStyle([cast(ubyte)1u]), TextStyle([cast(ubyte)1u, 
cast(ubyte)4u]), TextStyle([cast(ubyte)93u]), 
TextStyle([cast(ubyte)3u]), TextStyle([cast(ubyte)93u])), null), 
false, Complete!(T))`
source\argparse\package.d(794,12):        instantiated from here: 
`CLI!(Config('=', '\xff', '-', "--", false, false, true, 
StylingMode.autodetect, null, Style(TextStyle([cast(ubyte)1u]), 
TextStyle([cast(ubyte)1u]), TextStyle([cast(ubyte)1u, 
cast(ubyte)4u]), TextStyle([cast(ubyte)93u]), 
TextStyle([cast(ubyte)3u]), TextStyle([cast(ubyte)93u])), null), 
T)`
C:\D\dmd2\windows\bin\..\..\src\phobos\std\sumtype.d-mixin-2084(2084,7): Error:
unterminated string constant starting at
C:\D\dmd2\windows\bin\..\..\src\phobos\std\sumtype.d-mixin-2084(2084,14)
C:\D\dmd2\windows\bin\..\..\src\phobos\std\sumtype.d-mixin-2084(2084,14):
Error: no identifier for declarator `handler`
C:\D\dmd2\windows\bin\dmd.exe failed with exit code 1.
```

Failed:
```
C:\D\dmd2\windows\bin\dmd.exe failed with exit code -1073741819.
```

Succeeded:
```
Linking...
LINK : 
.dub\build\argparse-test-library-unittest-cov-windows-x86_64-dmd_v2.100.2-dirty-54DD8361E221F5FB88F9291F67344057\argpa
se-test-library.exe not found or not built by the last incremental link;
performing full link
Running argparse-test-library.exe
```
Sep 28 2022
next sibling parent reply Andrey Zherikov <andrey.zherikov gmail.com> writes:
On Thursday, 29 September 2022 at 00:48:03 UTC, Andrey Zherikov 
wrote:
 I actually see that DMD is very unstable.
The same code fails to build on Ubuntu: ``` Starting program: /usr/bin/dmd -debug -cov -g -unittest -w -version=Have_argparse -Isource/ source/argparse/package.d -c -of.dub/build/argparse-test-library-unittest-cov-linux.posix-x86_64-dmd_v2.100.0-2270E3354D7B3AAE3038EDF467033FB /package_bcdb8bae.o -vcolumns [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1". Program received signal SIGILL, Illegal instruction. 0x00005555556b67c0 in ParseTimeVisitor<ASTCodegen>::visit(Expression*) () (gdb) where ParseTimeVisitor<ASTCodegen>::visit(Expression*) () () () () () FuncDeclaration_toObjFile(FuncDeclaration*, bool) () toObjFile::ToObjFile::visit(TemplateInstance*) () ref dmd.globals.Param) () ```
Sep 28 2022
parent reply Steven Schveighoffer <schveiguy gmail.com> writes:
On 9/28/22 9:01 PM, Andrey Zherikov wrote:
 On Thursday, 29 September 2022 at 00:48:03 UTC, Andrey Zherikov wrote:
 I actually see that DMD is very unstable.
This seems like it *might be* an out of memory problem. When the compiler runs out of memory, any of a number of things might happen, including segfaults. -Steve
Sep 28 2022
next sibling parent reply Andrey Zherikov <andrey.zherikov gmail.com> writes:
On Thursday, 29 September 2022 at 03:19:08 UTC, Steven 
Schveighoffer wrote:
 On 9/28/22 9:01 PM, Andrey Zherikov wrote:
 On Thursday, 29 September 2022 at 00:48:03 UTC, Andrey 
 Zherikov wrote:
 I actually see that DMD is very unstable.
This seems like it *might be* an out of memory problem. When the compiler runs out of memory, any of a number of things might happen, including segfaults. -Steve
Why doesn't it fail with "out of memory exception"? I remember it did in previous versions (I use 2.100.2 now).
Sep 29 2022
parent reply Steven Schveighoffer <schveiguy gmail.com> writes:
On 9/29/22 9:57 AM, Andrey Zherikov wrote:
 On Thursday, 29 September 2022 at 03:19:08 UTC, Steven Schveighoffer wrote:
 On 9/28/22 9:01 PM, Andrey Zherikov wrote:
 On Thursday, 29 September 2022 at 00:48:03 UTC, Andrey Zherikov wrote:
 I actually see that DMD is very unstable.
This seems like it *might be* an out of memory problem. When the compiler runs out of memory, any of a number of things might happen, including segfaults.
Why doesn't it fail with "out of memory exception"? I remember it did in previous versions (I use 2.100.2 now).
Classic problem for memory allocation is nobody checks if it succeeds, or if they do, they don't handle it properly. This likely includes various places in the compiler. -Steve
Sep 29 2022
parent reply Walter Bright <newshound2 digitalmars.com> writes:
On 9/29/2022 7:50 AM, Steven Schveighoffer wrote:
 Classic problem for memory allocation is nobody checks if it succeeds, or if 
 they do, they don't handle it properly. This likely includes various places in 
 the compiler.
If you can find one, I owe you a beer for the next BeerConf.
Oct 02 2022
parent reply Steven Schveighoffer <schveiguy gmail.com> writes:
On 10/2/22 5:12 PM, Walter Bright wrote:
 On 9/29/2022 7:50 AM, Steven Schveighoffer wrote:
 Classic problem for memory allocation is nobody checks if it succeeds, 
 or if they do, they don't handle it properly. This likely includes 
 various places in the compiler.
If you can find one, I owe you a beer for the next BeerConf.
haha, now I need to go look for one! In all seriousness though, I've definitely had 4 types of results when DMD runs out of memory: 1. OOM Killer kills the process (this is the most frequent on Linux) 2. Segfault 3. Seemingly random assert error or other exception. 4. Out of memory notification (this is what should always happen, except for OOM killer) Not saying any of this is proof the compiler (or used library) incorrectly ignores a failed memory allocation, but it would fit the pattern. -Steve
Oct 03 2022
next sibling parent Walter Bright <newshound2 digitalmars.com> writes:
On 10/3/2022 7:45 AM, Steven Schveighoffer wrote:
 In all seriousness though, I've definitely had 4 types of results when DMD
runs 
 out of memory:
 
 1. OOM Killer kills the process (this is the most frequent on Linux)
 2. Segfault
 3. Seemingly random assert error or other exception.
 4. Out of memory notification (this is what should always happen, except for
OOM 
 killer)
2 and 3 should be investigated and fixed.
Oct 03 2022
prev sibling parent reply Walter Bright <newshound2 digitalmars.com> writes:
grep reveals:

https://github.com/dlang/dmd/pull/14517
Oct 03 2022
next sibling parent reply Steven Schveighoffer <schveiguy gmail.com> writes:
On 10/3/22 10:13 PM, Walter Bright wrote:
 grep reveals:
 
 https://github.com/dlang/dmd/pull/14517
 
Does prodding you to check count as me finding it? ;) 🍺 -Steve
Oct 03 2022
parent Walter Bright <newshound2 digitalmars.com> writes:
On 10/3/2022 7:17 PM, Steven Schveighoffer wrote:
 Does prodding you to check count as me finding it? ;)
 
 🍺
 
 -Steve
For that you get a virtual beer! 🍺
Oct 03 2022
prev sibling parent reply Dennis <dkorpel gmail.com> writes:
On Tuesday, 4 October 2022 at 02:13:16 UTC, Walter Bright wrote:
 grep reveals:

 https://github.com/dlang/dmd/pull/14517
I have a few more :) The backend has 4 calls to `util_malloc`, 28 calls to `mem_malloc`, 2 calls to `mem_malloc2`, 8 calls to `mem_fmalloc` (why so many `malloc` wrappers?), and 16 calls to `mem_calloc`. I don't see any checks on those. Here's one with plain `malloc`: dmd/backend/dcgcv.d:264 ``` d = cast(debtyp_t *) malloc(debtyp_t.sizeof - (d.data).sizeof + length); d.length = cast(ushort)length; ``` This one checks, but after memcpy'ing to `null`! dmd/common/file.d:148 ``` name = cast(char*) memcpy(malloc(totalNameLength), filename, totalNameLength); name || assert(0, "FileMapping: Out of memory."); ```
Oct 04 2022
next sibling parent reply ryuukk_ <ryuukk.dev gmail.com> writes:
On Tuesday, 4 October 2022 at 10:10:35 UTC, Dennis wrote:
 On Tuesday, 4 October 2022 at 02:13:16 UTC, Walter Bright wrote:
 grep reveals:

 https://github.com/dlang/dmd/pull/14517
I have a few more :) The backend has 4 calls to `util_malloc`, 28 calls to `mem_malloc`, 2 calls to `mem_malloc2`, 8 calls to `mem_fmalloc` (why so many `malloc` wrappers?), and 16 calls to `mem_calloc`. I don't see any checks on those. Here's one with plain `malloc`: dmd/backend/dcgcv.d:264 ``` d = cast(debtyp_t *) malloc(debtyp_t.sizeof - (d.data).sizeof + length); d.length = cast(ushort)length; ``` This one checks, but after memcpy'ing to `null`! dmd/common/file.d:148 ``` name = cast(char*) memcpy(malloc(totalNameLength), filename, totalNameLength); name || assert(0, "FileMapping: Out of memory."); ```
Another case for a proper allocator API in the std!
Oct 04 2022
parent reply Andrey Zherikov <andrey.zherikov gmail.com> writes:
On Tuesday, 4 October 2022 at 15:06:04 UTC, ryuukk_ wrote:
 Another case for a proper allocator API in the std!
Is std.experimental.allocator not good enough? (I never used it so don't know the answer)
Oct 04 2022
parent ryuukk_ <ryuukk.dev gmail.com> writes:
On Tuesday, 4 October 2022 at 17:22:38 UTC, Andrey Zherikov wrote:
 On Tuesday, 4 October 2022 at 15:06:04 UTC, ryuukk_ wrote:
 Another case for a proper allocator API in the std!
Is std.experimental.allocator not good enough? (I never used it so don't know the answer)
Well, it's "experimental", i'm personally not a fan of the interface since i couldn't use it for my WASM needs, it could receive a little facelift imo https://github.com/dlang/projects/issues/87 D should lead the way with the allocator story ``std.allocator``, D did it before all these new languages that pretend to be "original" "D is a general purpose language, with a built-in GC, and a set of allocators to allow fine tuned custom allocation strategy", i'm sold
Oct 04 2022
prev sibling next sibling parent Walter Bright <newshound2 digitalmars.com> writes:
On 10/4/2022 3:10 AM, Dennis wrote:
 I have a few more :)
I know, I found them, too. I have a PR for some of them: https://github.com/dlang/dmd/pull/14509 But it's awaiting being pulled. The trouble is the mem_xxx functions in C did the checking, but as I was just trying to get the code translated to D I took a shortcut and didn't go back and fix it, then forgot about it. Oops.
Oct 04 2022
prev sibling parent reply Walter Bright <newshound2 digitalmars.com> writes:
On 10/4/2022 3:10 AM, Dennis wrote:
 (why so many `malloc` wrappers?)
It's history. The code has been used in many projects, by different groups of people. Multiple memory pools appeared: 1. mark/release pools 2. general alloc/free pools 3. debug allocators 4. alloc and never free pools 5. precompiled header pool
Oct 06 2022
parent reply Andrey Zherikov <andrey.zherikov gmail.com> writes:
I cloned master branch from `https://github.com/dlang/dmd`, built 
DMD with `BUILD=debug ./compiler/src/build.d dmd` then executed 
with a command that dub runs and got the following:
```
ERROR: This is a compiler bug.
Please report it via https://issues.dlang.org/enter_bug.cgi
with, preferably, a reduced, reproducible example and the 
information below.
DustMite (https://github.com/CyberShadow/DustMite/wiki) can help 
with the reduction.
---
DMD v2.100.2

predefs   Have_argparse DigitalMars LittleEndian D_Version2 all 
D_SIMD Posix ELFv1 linux CRuntime_Glibc CppRuntime_Gcc 
D_InlineAsm_X86_64 X86_64 D_LP64 D_PIC unittest assert 
D_PreConditions D_PostConditions D_Invariants D_ModuleInfo 
D_Exceptions D_TypeInfo D_HardFloat
binary    /home/andrey/dmd/dmd/generated/linux/debug/64/dmd
version   v2.100.2

config    /home/andrey/dmd/dmd/generated/linux/debug/64/dmd.conf
DFLAGS    
-I/home/andrey/dmd/dmd/generated/linux/debug/64/../../../../druntime/import
-I/home/andrey/dmd/dmd/generated/linux/debug/64/../../../../../phobos
-L-L/home/andrey/dmd/dmd/generated/linux/debug/64/../../../../../phobos/gene
ated/linux/debug/64 -L--export-dynamic -fPIC
---
core.exception.ArrayIndexError /home/andrey/dmd/dmd/compiler/src/dm
/root/array.d(269): index [1722] is out of bounds for array of length 141
----------------
??:? _d_arraybounds_indexp [0x564720b74f5d]
/home/andrey/dmd/dmd/compiler/src/dmd/root/array.d:269 
_ZN5ArrayIP10ExpressionEixEm [0x5647207f4025]
src/dmd/dinterpret.d:353 _ZN9CtfeStack4pushEP14VarDeclaration 
[0x564720897f1a]
src/dmd/dinterpret.d:2316 int 
dmd.dinterpret.Interpreter.visit(dmd.expression.DeclarationExp).__lambda6!(dmd.dsymbol.Dsymbol).__lambda6(
md.dsymbol.Dsymbol) [0x56472089dc24]
src/dmd/declaration.d:701 int 
dmd.declaration.TupleDeclaration.foreachVar(scope int 
delegate(dmd.dsymbol.Dsymbol)) [0x564720891345]
src/dmd/dinterpret.d:2309 
_ZN11Interpreter5visitEP14DeclarationExp [0x56472089d875]
src/dmd/expression.d:4112 _ZN14DeclarationExp6acceptEP7Visitor 
[0x56472091962d]
src/dmd/dinterpret.d:6526 dmd.expression.Expression 
dmd.dinterpret.interpret(dmd.expression.UnionExp*, 
dmd.expression.Expression, dmd.dinterpret.InterState*, 
dmd.dinterpret.CTFEGoal) [0x5647208aaf18]
src/dmd/dinterpret.d:816 _ZN11Interpreter5visitEP12ExpStatement 
[0x56472089992f]
src/dmd/statement.d:485 _ZN12ExpStatement6acceptEP7Visitor 
[0x5647209ccb31]
src/dmd/dinterpret.d:6591 dmd.expression.Expression 
dmd.dinterpret.interpret(dmd.expression.UnionExp*, 
dmd.statement.Statement, dmd.dinterpret.InterState*) 
[0x5647208ab13b]
src/dmd/dinterpret.d:834 
_ZN11Interpreter5visitEP17CompoundStatement [0x5647208999f1]
src/dmd/statement.d:628 _ZN17CompoundStatement6acceptEP7Visitor 
[0x5647209cd055]
src/dmd/dinterpret.d:6591 dmd.expression.Expression 
dmd.dinterpret.interpret(dmd.expression.UnionExp*, 
dmd.statement.Statement, dmd.dinterpret.InterState*) 
[0x5647208ab13b]
src/dmd/dinterpret.d:834 
_ZN11Interpreter5visitEP17CompoundStatement [0x5647208999f1]
src/dmd/statement.d:628 _ZN17CompoundStatement6acceptEP7Visitor 
[0x5647209cd055]
src/dmd/dinterpret.d:6591 dmd.expression.Expression 
dmd.dinterpret.interpret(dmd.expression.UnionExp*, 
dmd.statement.Statement, dmd.dinterpret.InterState*) 
[0x5647208ab13b]
src/dmd/dinterpret.d:644 dmd.expression.Expression 
dmd.dinterpret.interpretFunction(dmd.expression.UnionExp*, 
dmd.func.FuncDeclaration, dmd.dinterpret.InterState*, 
dmd.root.array.Array!(dmd.expression.Expression).Array*, 
dmd.expression.Expression) [0x5647208992bf]
src/dmd/dinterpret.d:4986 _ZN11Interpreter5visitEP7CallExp 
[0x5647208a5ff8]
src/dmd/expression.d:5169 _ZN7CallExp6acceptEP7Visitor 
[0x56472091be45]
src/dmd/dinterpret.d:6526 dmd.expression.Expression 
dmd.dinterpret.interpret(dmd.expression.UnionExp*, 
dmd.expression.Expression, dmd.dinterpret.InterState*, 
dmd.dinterpret.CTFEGoal) [0x5647208aaf18]
src/dmd/dinterpret.d:6536 dmd.expression.Expression 
dmd.dinterpret.interpret(dmd.expression.Expression, 
dmd.dinterpret.InterState*, dmd.dinterpret.CTFEGoal) 
[0x5647208aaf71]
src/dmd/dinterpret.d:100 dmd.expression.Expression 
dmd.dinterpret.ctfeInterpret(dmd.expression.Expression) 
[0x56472089720a]
src/dmd/expression.d:1619 _ZN10Expression13ctfeInterpretEv 
[0x5647209131ec]
src/dmd/initsem.d:465 dmd.init.Initializer 
dmd.initsem.initializerSemantic(dmd.init.Initializer, 
dmd.dscope.Scope*, ref dmd.mtype.Type, 
dmd.init.NeedInterpret).visitExp(dmd.init.ExpInitializer) 
[0x56472097105d]
src/dmd/initsem.d:1058 
_Z19initializerSemanticP11InitializerP5ScopeRP4Type13NeedInterpret
[0x56472096f691]
src/dmd/semantic2.d:259 
_ZN16Semantic2Visitor5visitEP14VarDeclaration [0x5647209c45e8]
src/dmd/declaration.d:1703 _ZN14VarDeclaration6acceptEP7Visitor 
[0x564720893765]
src/dmd/semantic2.d:79 _Z9semantic2P7DsymbolP5Scope 
[0x5647209c3e7d]
src/dmd/semantic2.d:173 
_ZN16Semantic2Visitor5visitEP16TemplateInstance [0x5647209c42d0]
src/dmd/dtemplate.d:7518 _ZN16TemplateInstance6acceptEP7Visitor 
[0x5647208fd19d]
src/dmd/semantic2.d:79 _Z9semantic2P7DsymbolP5Scope 
[0x5647209c3e7d]
src/dmd/dsymbolsem.d:6216 void 
dmd.dsymbolsem.templateInstanceSemantic(dmd.dtemplate.TemplateInstance,
dmd.dscope.Scope*, dmd.root.array.Array!(dmd.expression.Expression).Array*)
[0x5647208e8094]
src/dmd/dsymbolsem.d:2639 
_ZN22DsymbolSemanticVisitor5visitEP16TemplateInstance 
[0x5647208dd3b6]
src/dmd/dtemplate.d:7518 _ZN16TemplateInstance6acceptEP7Visitor 
[0x5647208fd19d]
src/dmd/dsymbolsem.d:130 _Z15dsymbolSemanticP7DsymbolP5Scope 
[0x5647208d5395]
src/dmd/typesem.d:2799 void dmd.typesem.resolve(dmd.mtype.Type, 
ref const(dmd.globals.Loc), dmd.dscope.Scope*, out 
dmd.expression.Expression, out dmd.mtype.Type, out 
dmd.dsymbol.Dsymbol, bool).visitInstance(dmd.mtype.TypeInstance) 
[0x5647209f71db]
src/dmd/typesem.d:3169 void dmd.typesem.resolve(dmd.mtype.Type, 
ref const(dmd.globals.Loc), dmd.dscope.Scope*, out 
dmd.expression.Expression, out dmd.mtype.Type, out 
dmd.dsymbol.Dsymbol, bool) [0x5647209f6784]
src/dmd/dtemplate.d:6599 bool 
dmd.dtemplate.TemplateInstance.semanticTiargs(ref 
const(dmd.globals.Loc), dmd.dscope.Scope*, 
dmd.root.array.Array!(dmd.root.rootobject.RootObject).Array*, 
int, dmd.declaration.TupleDeclaration) [0x5647208fa86d]
src/dmd/dtemplate.d:6851 bool 
dmd.dtemplate.TemplateInstance.semanticTiargs(dmd.dscope.Scope*) 
[0x5647208fb0af]
src/dmd/expressionsem.d:13071 dmd.expression.Expression 
dmd.expressionsem.semanticY(dmd.expression.DotTemplateInstanceExp,
dmd.dscope.Scope*, int) [0x56472094d57a]
src/dmd/expressionsem.d:6766 
_ZN25ExpressionSemanticVisitor5visitEP22DotTemplateInstanceExp 
[0x564720938901]
src/dmd/expression.d:4984 
_ZN22DotTemplateInstanceExp6acceptEP7Visitor [0x56472091b765]
src/dmd/expressionsem.d:12513 
_Z18expressionSemanticP10ExpressionP5Scope [0x56472094b263]
src/dmd/statementsem.d:205 
_ZN24StatementSemanticVisitor5visitEP12ExpStatement 
[0x5647209d05e7]
src/dmd/statement.d:485 _ZN12ExpStatement6acceptEP7Visitor 
[0x5647209ccb31]
src/dmd/statementsem.d:147 
_Z17statementSemanticP9StatementP5Scope [0x5647209d04cb]
src/dmd/statementsem.d:268 
_ZN24StatementSemanticVisitor5visitEP17CompoundStatement 
[0x5647209d08ae]
src/dmd/statement.d:628 _ZN17CompoundStatement6acceptEP7Visitor 
[0x5647209cd055]
src/dmd/statementsem.d:147 
_Z17statementSemanticP9StatementP5Scope [0x5647209d04cb]
src/dmd/statementsem.d:475 
_ZN24StatementSemanticVisitor5visitEP14ScopeStatement 
[0x5647209d142e]
src/dmd/statement.d:736 _ZN14ScopeStatement6acceptEP7Visitor 
[0x5647209cd45d]
src/dmd/statementsem.d:147 
_Z17statementSemanticP9StatementP5Scope [0x5647209d04cb]
src/dmd/statementsem.d:513 
_ZN24StatementSemanticVisitor5visitEP19ForwardingStatement 
[0x5647209d162d]
src/dmd/statement.d:776 _ZN19ForwardingStatement6acceptEP7Visitor 
[0x5647209cd59d]
src/dmd/statementsem.d:147 
_Z17statementSemanticP9StatementP5Scope [0x5647209d04cb]
src/dmd/statementsem.d:268 
_ZN24StatementSemanticVisitor5visitEP17CompoundStatement 
[0x5647209d08ae]
src/dmd/statement.d:628 _ZN17CompoundStatement6acceptEP7Visitor 
[0x5647209cd055]
src/dmd/statementsem.d:147 
_Z17statementSemanticP9StatementP5Scope [0x5647209d04cb]
src/dmd/semantic3.d:598 
_ZN16Semantic3Visitor5visitEP15FuncDeclaration [0x5647209c7149]
src/dmd/func.d:2930 _ZN15FuncDeclaration6acceptEP7Visitor 
[0x5647209560d9]
src/dmd/semantic3.d:82 _Z9semantic3P7DsymbolP5Scope 
[0x5647209c5b29]
src/dmd/semantic3.d:133 
_ZN16Semantic3Visitor5visitEP16TemplateInstance [0x5647209c5cd2]
src/dmd/dtemplate.d:7518 _ZN16TemplateInstance6acceptEP7Visitor 
[0x5647208fd19d]
src/dmd/semantic3.d:82 _Z9semantic3P7DsymbolP5Scope 
[0x5647209c5b29]
src/dmd/dtemplate.d:7506 void 
dmd.dtemplate.TemplateInstance.trySemantic3(dmd.dscope.Scope*) 
[0x5647208fd156]
src/dmd/dsymbolsem.d:6293 void 
dmd.dsymbolsem.templateInstanceSemantic(dmd.dtemplate.TemplateInstance,
dmd.dscope.Scope*, dmd.root.array.Array!(dmd.expression.Expression).Array*)
[0x5647208e83da]
src/dmd/dtemplate.d:3090 void dmd.dtemplate.functionResolve(ref 
dmd.declaration.MatchAccumulator, dmd.dsymbol.Dsymbol, 
dmd.globals.Loc, dmd.dscope.Scope*, 
dmd.root.array.Array!(dmd.root.rootobject.RootObject).Array*, 
dmd.mtype.Type, 
dmd.root.array.Array!(dmd.expression.Expression).Array*, 
const(char)**) [0x5647208f0efa]
src/dmd/func.d:3227 dmd.func.FuncDeclaration 
dmd.func.resolveFuncCall(ref const(dmd.globals.Loc), 
dmd.dscope.Scope*, dmd.dsymbol.Dsymbol, 
dmd.root.array.Array!(dmd.root.rootobject.RootObject).Array*, 
dmd.mtype.Type, 
dmd.root.array.Array!(dmd.expression.Expression).Array*, 
dmd.func.FuncResolveFlag) [0x564720956943]
src/dmd/expressionsem.d:4991 
_ZN25ExpressionSemanticVisitor5visitEP7CallExp [0x564720932367]
src/dmd/expression.d:5169 _ZN7CallExp6acceptEP7Visitor 
[0x56472091be45]
src/dmd/expressionsem.d:12513 
_Z18expressionSemanticP10ExpressionP5Scope [0x56472094b263]
src/dmd/statementsem.d:205 
_ZN24StatementSemanticVisitor5visitEP12ExpStatement 
[0x5647209d05e7]
src/dmd/statement.d:485 _ZN12ExpStatement6acceptEP7Visitor 
[0x5647209ccb31]
src/dmd/statementsem.d:147 
_Z17statementSemanticP9StatementP5Scope [0x5647209d04cb]
src/dmd/statementsem.d:268 
_ZN24StatementSemanticVisitor5visitEP17CompoundStatement 
[0x5647209d08ae]
src/dmd/statement.d:628 _ZN17CompoundStatement6acceptEP7Visitor 
[0x5647209cd055]
src/dmd/statementsem.d:147 
_Z17statementSemanticP9StatementP5Scope [0x5647209d04cb]
src/dmd/semantic3.d:598 
_ZN16Semantic3Visitor5visitEP15FuncDeclaration [0x5647209c7149]
src/dmd/func.d:2930 _ZN15FuncDeclaration6acceptEP7Visitor 
[0x5647209560d9]
src/dmd/semantic3.d:82 _Z9semantic3P7DsymbolP5Scope 
[0x5647209c5b29]
src/dmd/semantic3.d:133 
_ZN16Semantic3Visitor5visitEP16TemplateInstance [0x5647209c5cd2]
src/dmd/dtemplate.d:7518 _ZN16TemplateInstance6acceptEP7Visitor 
[0x5647208fd19d]
src/dmd/semantic3.d:82 _Z9semantic3P7DsymbolP5Scope 
[0x5647209c5b29]
src/dmd/dtemplate.d:7506 void 
dmd.dtemplate.TemplateInstance.trySemantic3(dmd.dscope.Scope*) 
[0x5647208fd156]
src/dmd/dsymbolsem.d:6293 void 
dmd.dsymbolsem.templateInstanceSemantic(dmd.dtemplate.TemplateInstance,
dmd.dscope.Scope*, dmd.root.array.Array!(dmd.expression.Expression).Array*)
[0x5647208e83da]
src/dmd/dtemplate.d:3090 void dmd.dtemplate.functionResolve(ref 
dmd.declaration.MatchAccumulator, dmd.dsymbol.Dsymbol, 
dmd.globals.Loc, dmd.dscope.Scope*, 
dmd.root.array.Array!(dmd.root.rootobject.RootObject).Array*, 
dmd.mtype.Type, 
dmd.root.array.Array!(dmd.expression.Expression).Array*, 
const(char)**) [0x5647208f0efa]
src/dmd/func.d:3227 dmd.func.FuncDeclaration 
dmd.func.resolveFuncCall(ref const(dmd.globals.Loc), 
dmd.dscope.Scope*, dmd.dsymbol.Dsymbol, 
dmd.root.array.Array!(dmd.root.rootobject.RootObject).Array*, 
dmd.mtype.Type, 
dmd.root.array.Array!(dmd.expression.Expression).Array*, 
dmd.func.FuncResolveFlag) [0x564720956943]
src/dmd/expressionsem.d:4991 
_ZN25ExpressionSemanticVisitor5visitEP7CallExp [0x564720932367]
src/dmd/expression.d:5169 _ZN7CallExp6acceptEP7Visitor 
[0x56472091be45]
src/dmd/expressionsem.d:12513 
_Z18expressionSemanticP10ExpressionP5Scope [0x56472094b263]
src/dmd/statementsem.d:205 
_ZN24StatementSemanticVisitor5visitEP12ExpStatement 
[0x5647209d05e7]
src/dmd/statement.d:485 _ZN12ExpStatement6acceptEP7Visitor 
[0x5647209ccb31]
src/dmd/statementsem.d:147 
_Z17statementSemanticP9StatementP5Scope [0x5647209d04cb]
src/dmd/statementsem.d:268 
_ZN24StatementSemanticVisitor5visitEP17CompoundStatement 
[0x5647209d08ae]
src/dmd/statement.d:628 _ZN17CompoundStatement6acceptEP7Visitor 
[0x5647209cd055]
src/dmd/statementsem.d:147 
_Z17statementSemanticP9StatementP5Scope [0x5647209d04cb]
src/dmd/semantic3.d:598 
_ZN16Semantic3Visitor5visitEP15FuncDeclaration [0x5647209c7149]
src/dmd/func.d:2930 _ZN15FuncDeclaration6acceptEP7Visitor 
[0x5647209560d9]
src/dmd/semantic3.d:82 _Z9semantic3P7DsymbolP5Scope 
[0x5647209c5b29]
src/dmd/semantic3.d:133 
_ZN16Semantic3Visitor5visitEP16TemplateInstance [0x5647209c5cd2]
src/dmd/dtemplate.d:7518 _ZN16TemplateInstance6acceptEP7Visitor 
[0x5647208fd19d]
src/dmd/semantic3.d:82 _Z9semantic3P7DsymbolP5Scope 
[0x5647209c5b29]
src/dmd/dtemplate.d:7506 void 
dmd.dtemplate.TemplateInstance.trySemantic3(dmd.dscope.Scope*) 
[0x5647208fd156]
src/dmd/dsymbolsem.d:6233 void 
dmd.dsymbolsem.templateInstanceSemantic(dmd.dtemplate.TemplateInstance,
dmd.dscope.Scope*, dmd.root.array.Array!(dmd.expression.Expression).Array*)
[0x5647208e8115]
src/dmd/dtemplate.d:3090 void dmd.dtemplate.functionResolve(ref 
dmd.declaration.MatchAccumulator, dmd.dsymbol.Dsymbol, 
dmd.globals.Loc, dmd.dscope.Scope*, 
dmd.root.array.Array!(dmd.root.rootobject.RootObject).Array*, 
dmd.mtype.Type, 
dmd.root.array.Array!(dmd.expression.Expression).Array*, 
const(char)**) [0x5647208f0efa]
src/dmd/func.d:3227 dmd.func.FuncDeclaration 
dmd.func.resolveFuncCall(ref const(dmd.globals.Loc), 
dmd.dscope.Scope*, dmd.dsymbol.Dsymbol, 
dmd.root.array.Array!(dmd.root.rootobject.RootObject).Array*, 
dmd.mtype.Type, 
dmd.root.array.Array!(dmd.expression.Expression).Array*, 
dmd.func.FuncResolveFlag) [0x564720956943]
src/dmd/expressionsem.d:1317 dmd.expression.Expression 
dmd.expressionsem.resolvePropertiesX(dmd.dscope.Scope*, 
dmd.expression.Expression, dmd.expression.Expression) 
[0x564720926a84]
src/dmd/expressionsem.d:1401 
_Z17resolvePropertiesP5ScopeP10Expression [0x564720926e8e]
src/dmd/expressionsem.d:1627 bool 
dmd.expressionsem.preFunctionParameters(dmd.dscope.Scope*, 
dmd.root.array.Array!(dmd.expression.Expression).Array*, 
const(bool)) [0x564720927752]
src/dmd/expressionsem.d:4530 
_ZN25ExpressionSemanticVisitor5visitEP7CallExp [0x564720930a0b]
src/dmd/expression.d:5169 _ZN7CallExp6acceptEP7Visitor 
[0x56472091be45]
src/dmd/expressionsem.d:12513 
_Z18expressionSemanticP10ExpressionP5Scope [0x56472094b263]
src/dmd/statementsem.d:205 
_ZN24StatementSemanticVisitor5visitEP12ExpStatement 
[0x5647209d05e7]
src/dmd/statement.d:485 _ZN12ExpStatement6acceptEP7Visitor 
[0x5647209ccb31]
src/dmd/statementsem.d:147 
_Z17statementSemanticP9StatementP5Scope [0x5647209d04cb]
src/dmd/statementsem.d:268 
_ZN24StatementSemanticVisitor5visitEP17CompoundStatement 
[0x5647209d08ae]
src/dmd/statement.d:628 _ZN17CompoundStatement6acceptEP7Visitor 
[0x5647209cd055]
src/dmd/statementsem.d:147 
_Z17statementSemanticP9StatementP5Scope [0x5647209d04cb]
src/dmd/semantic3.d:598 
_ZN16Semantic3Visitor5visitEP15FuncDeclaration [0x5647209c7149]
src/dmd/func.d:2930 _ZN15FuncDeclaration6acceptEP7Visitor 
[0x5647209560d9]
src/dmd/semantic3.d:82 _Z9semantic3P7DsymbolP5Scope 
[0x5647209c5b29]
src/dmd/expressionsem.d:5414 
_ZN25ExpressionSemanticVisitor5visitEP14DeclarationExp 
[0x56472093422c]
```


I'll try to run dmd under gdb in hope to get more details but may 
be above would be enough for compiler devs to ring a bell.
Oct 07 2022
next sibling parent Andrey Zherikov <andrey.zherikov gmail.com> writes:
On Friday, 7 October 2022 at 14:12:14 UTC, Andrey Zherikov wrote:
 I'll try to run dmd under gdb in hope to get more details but 
 may be above would be enough for compiler devs to ring a bell.
Here is gdb stack: ``` Breakpoint 2, Array<Expression*>::operator[](unsigned long) (this=..., i=1722) at /home/andrey/dmd/dmd/compiler/src/dmd/root/array.d:269 269 return data[i]; (gdb) p this $4 = (const dmd.root.array.Array!(dmd.expression.Expression).Array &) 0x555555da6398: {length = 3, data = {0x7ffff4f4ca00, 0x7ffff4f4c730, 0x7ffff4f4c730, 0x7ffff4f4a350, 0x7ffff4f4a170, 0x7fffdbfa30c0, 0x7fffdbd3f1e0, 0x7fffdbfa3c10, 0x7ffff4f4db10, 0x7ffff4f4db60, 0x7ffff4f4db60, 0x7ffff4f4db10, 0x7fffdbd3e300, 0x7ffff4f4c910, 0x7fffdbd3e3f0, 0x7fffdbd3dd80, 0x7fffdbd3dd80, 0x7ffff4f4cf70, 0x7ffff3d4d420, 0x7fffdbd3dd80, 0x7ffff4f4d150, 0x7ffff4f4d360, 0x7ffff4f4d3c0, 0x7ffff4f4d3f0, 0x7fffdbd3dd80, 0x7ffff4f4d1b0, 0x7ffff4f4d230, 0x7ffff4f4d260, 0x7fffdc25a2f0, 0x7fffdc243570, 0x7fffdc243570, 0x7fffdc366260, 0x7fffdc366c20, 0x7fffdc6bd600, 0x7ffff4f77f40, 0x7ffff4f7c0a0, 0x7ffff4f82390, 0x7fffdc6bd680, 0x7fffdc243a20, 0x7fffdc25a2f0, 0x7ffff4f94860, 0x7fffdc243a20, 0x7fffdc482ff0, 0x7fffdc260500, 0x7fffdc482ff0, 0x7ffff4f94800, 0x7fffdc482ff0, 0x7ffff37973a0, 0x7fffdc243570, 0x7ffff4f94800, 0x7ffff4f96830, 0x7ffff4f96890, 0x7ffff4f968c0, 0x7fffdc243570, 0x7ffff4f963e0, 0x7ffff4f96460, 0x7ffff4f96490, 0x7ffff2c1a760, 0x7ffff2c1a7a0, 0x7ffff4f948c0, 0x7ffff283ff70, 0x7ffff283ff40, 0x7fffdc482ff0, 0x7ffff2c1a760, 0x7ffff2c1a7a0, 0x7ffff2c24140, 0x7ffff4f948c0, 0x7ffff283ff70, 0x7ffff2c27be0, 0x7ffff2c3a1a0, 0x7ffff4f949f0, 0x7ffff4f94a50, 0x7ffff2c3a5b0, 0x7ffff54223d0, 0x7ffff27ae960, 0x7ffff27aec70, 0x7ffff27aeda0, 0x7ffff54223d0, 0x7ffff4f94bc0, 0x7ffff4f94bf0, 0x7ffff27b6460, 0x7ffff2835f80, 0x7ffff27b6460, 0x7ffff2839790, 0x7ffff27aeda0, 0x7fffdc482ff0, 0x7ffff4f948c0, 0x7fffdc482ff0, 0x7ffff27e28e0, 0x7fffdc243570, 0x7ffff4f948c0, 0x7ffff4f96000, 0x7ffff4f96060, 0x7ffff4f96090, 0x7fffdc243570, 0x7ffff4f95bb0, 0x7ffff4f95c30, 0x7ffff4f95c60, 0x7ffff45a1d40, 0x7ffff4f84d80, 0x7fffec3f85b0, 0x7fffec3f85e0, 0x7fffec3f85b0, 0x7ffff4f84e70, 0x7ffff4f84f30, 0x7ffff45a1ef0, 0x7ffff4f84f30, 0x7fffec3f9180, 0x7fffec3f9150, 0x7fffec3f9120, 0x7ffff4f7aa90, 0x7fffec3c0680, 0x7ffff45a1d40, 0x7ffff4f7aa90, 0x7fffec3cc210, 0x7fffec3cc240, 0x7fffec3cc210, 0x7ffff4f7ab80, 0x7ffff4f7ac40, 0x7ffff45a1ef0, 0x7ffff4f7ac40, 0x7fffec3ccde0, 0x7fffec3ccdb0, 0x7fffec3ccd80, 0xffffffffffffffff <repeats 17 times>}, smallarray = {0x7ffff4e03e80}} (gdb) where i=1722) at /home/andrey/dmd/dmd/compiler/src/dmd/root/array.d:269 (this=..., v=0x7fffdbbf7e90) at src/dmd/dinterpret.d:353 _D3dmd10dinterpret11Interpreter5visitMRCQBm10expression14DeclarationExpZ__T9__lambda6TCQDh7dsymbo 7DsymbolZQBgMFQBaZi (__capture=0x7fffffff3210, s=0x7fffdbbf7e90) at src/dmd/dinterpret.d:2316 _D3dmd11declaration16TupleDeclaration10foreachVarMFMDFCQCb7dsymbol7DsymbolZiZi (this=0x7fffdbbf8c60, dg=...) at src/dmd/declaration.d:701 (this=0x7fffffff3260, e=0x7fffdbbf4170) at src/dmd/dinterpret.d:2309 (this=0x7fffdbbf4170, v=0x7fffffff3260) at src/dmd/expression.d:4112 _D3dmd10dinterpret9interpretFPSQBd10expression8UnionExpCQCcQz10ExpressionPSQCvQCu10InterState QDoQDn8CTFEGoalZQCd (goal=<incomplete type>, istate=0x7fffffff3640, e=0x7fffdbbf4170, pue=0x7fffffff39f0) at src/dmd/dinterpret.d:6526 (this=0x7fffffff3320, s=0x7fffdbbf4140) at src/dmd/dinterpret.d:816 (this=0x7fffdbbf4140, v=0x7fffffff3320) at src/dmd/statement.d:485 _D3dmd10dinterpret9interpretFPSQBd10expression8UnionExpCQCc9statement9StatementPSQDbQDa10InterState CQDvQCs10Expression (istate=0x7fffffff3640, s=0x7fffdbbf4140, pue=0x7fffffff39f0) at src/dmd/dinterpret.d:6591 (this=0x7fffffff3400, s=0x7fffdbbf3de0) at src/dmd/dinterpret.d:834 (this=0x7fffdbbf3de0, v=0x7fffffff3400) at src/dmd/statement.d:628 _D3dmd10dinterpret9interpretFPSQBd10expression8UnionExpCQCc9statement9StatementPSQDbQDa10InterState CQDvQCs10Expression (istate=0x7fffffff3640, s=0x7fffdbbf3de0, pue=0x7fffffff39f0) at src/dmd/dinterpret.d:6591 (this=0x7fffffff34e0, s=0x7fffdbbfd460) at src/dmd/dinterpret.d:834 (this=0x7fffdbbfd460, v=0x7fffffff34e0) at src/dmd/statement.d:628 _D3dmd10dinterpret9interpretFPSQBd10expression8UnionExpCQCc9statement9StatementPSQDbQDa10InterState CQDvQCs10Expression (istate=0x7fffffff3640, s=0x7fffdbbfd460, pue=0x7fffffff39f0) at src/dmd/dinterpret.d:6591 _D3dmd10dinterpret17interpretFunctionFPSQBm10expression8UnionExpCQCl4func15FuncDeclarationPSQDmQDl10InterStatePSQEg4root5array__T5ArrayTCQFfQDt10 xpressionZQBbQxZQBa ( thisarg=0x0, arguments=0x7fffdbbf6840, istate=0x0, fd=0x7fffdbbf3ad0, pue=0x7fffffff39f0) at src/dmd/dinterpret.d:644 (this=0x7fffffff3990, e=0x7fffdbbf3a30) at src/dmd/dinterpret.d:4986 (this=0x7fffdbbf3a30, v=0x7fffffff3990) at src/dmd/expression.d:5169 _D3dmd10dinterpret9interpretFPSQBd10expression8UnionExpCQCcQz10ExpressionPSQCvQCu10InterState QDoQDn8CTFEGoalZQCd (goal=<incomplete type>, istate=0x0, e=0x7fffdbbf3a30, pue=0x7fffffff39f0) at src/dmd/dinterpret.d:6526 _D3dmd10dinterpret9interpretFCQBc10expression10ExpressionPSQCfQCe10InterState QCyQCx8CTFEGoalZQCn (goal=<incomplete type>, istate=0x0, e=0x7fffdbbf3a30) at src/dmd/dinterpret.d:6536 _D3dmd10dinterpret13ctfeInterpretFCQBh10expression10ExpressionZQBd (e=0x7fffdbbf3a30) at src/dmd/dinterpret.d:100 (this=0x7fffdbbf3a30) at src/dmd/expression.d:1619 _D3dmd7initsem19initializerSemanticRCQBj4init11InitializerPSQCg6dscope5ScopeKCQCy5mtype4TypeEQDnQCe13NeedInterpretZ8visitExpMFCQEvQDm 4ExpInitializerZQEk ( __capture=0x7fffffff3cc0, i=0x7fffdbbf3a00) at src/dmd/initsem.d:465 Scope*, Type*&, NeedInterpret) (init=0x7fffdbbf3a00, sc=0x7fffdbbf6ef0, tx= 0x7fffdbbf3950: 0x7fffebb7d280, needInterpret=<incomplete type>) at src/dmd/initsem.d:1058 Semantic2Visitor::visit(VarDeclaration*) (this=0x7fffffff3d60, vd=0x7fffdbbf38f0) at src/dmd/semantic2.d:259 (this=0x7fffdbbf38f0, v=0x7fffffff3d60) at src/dmd/declaration.d:1703 (dsym=0x7fffdbbf38f0, sc=0x7fffdbbf6ef0) at src/dmd/semantic2.d:79 Semantic2Visitor::visit(TemplateInstance*) (this=0x7fffffff3e40, tempinst=0x7fffdbf35f00) at src/dmd/semantic2.d:173 (this=0x7fffdbf35f00, v=0x7fffffff3e40) at src/dmd/dtemplate.d:7518 (dsym=0x7fffdbf35f00, sc=0x7fffdbbe4a70) at src/dmd/semantic2.d:79 _D3dmd10dsymbolsem24templateInstanceSemanticFCQBs9dtemplate16TemplateInstancePSQCz6dscope5ScopePSQDr4root5array__T5ArrayTCQEq10expressi n10ExpressionZQBkZv (fargs=0x0, (gdb) DsymbolSemanticVisitor::visit(TemplateInstance*) (this=0x7fffffff41e0, ti=0x7fffdbf35f00) at src/dmd/dsymbolsem.d:2639 (this=0x7fffdbf35f00, v=0x7fffffff41e0) at src/dmd/dtemplate.d:7518 (dsym=0x7fffdbf35f00, sc=0x7fffdbf3e310) at src/dmd/dsymbolsem.d:130 _D3dmd7typesem7resolveFCQw5mtype4TypeKxSQBm7globals3LocPSQCd6dscope5ScopeJCQCv10expression10ExpressionJQDcJCQEc7dsymbol7DsymbolbZ13visitInstanceMFCQF QEu12TypeInstanceZv ( __capture=0x7fffffff4280, mt=0x7fffdbf35e80) at src/dmd/typesem.d:2799 _D3dmd7typesem7resolveFCQw5mtype4TypeKxSQBm7globals3LocPSQCd6dscope5ScopeJCQCv10expression10ExpressionJQDcJCQE 7dsymbol7DsymbolbZv (intypeid=false, ps= 0x7fffffff42e0: 0x0, pt= 0x7fffffff42d0: 0x0, pe= 0x7fffffff42d8: 0x0, sc=0x7fffdbf3e310, loc=..., mt=0x7fffdbf35e80) at src/dmd/typesem.d:3169 _D3dmd9dtemplate16TemplateInstance14semanticTiargsFKxSQCa7globals3LocPSQCr6dscope5ScopePSQDj4root5array__T5ArrayTCQEiQz10rootobject10RootObjectZQBmiCQFr11declaration 6TupleDeclarationZb (atd=0x0, flags=0, tiargs=0x7fffdbf35dd0, sc=0x7fffdbf3e310, loc=...) at src/dmd/dtemplate.d:6599 _D3dmd9dtemplate16TemplateInstance14semanticTiargsMFPSQCa6dscope5ScopeZb (this=0x7fffdbf362c0, sc=0x7fffdbf3e310) at src/dmd/dtemplate.d:6851 _D3dmd13expressionsem9semanticYFCQBf10expression22DotTemplateInstanceExpPSQCu6dscope5Scopei CQDnQCi10Expression (flag=1, sc=0x7fffdbf3e310, exp=0x7fffdbf35d60) ```
Oct 07 2022
prev sibling parent reply Walter Bright <newshound2 digitalmars.com> writes:
This is good stuff! Please submit this data to bugzilla https://issues.dlang.org
Oct 07 2022
parent reply Andrey Zherikov <andrey.zherikov gmail.com> writes:
On Friday, 7 October 2022 at 19:43:00 UTC, Walter Bright wrote:
 This is good stuff! Please submit this data to bugzilla 
 https://issues.dlang.org
Unfortunately I'm not able due to "Currently, registering using Gmail addresses is not allowed due to spam." Waiting for the time when bugs are moved to github.
Oct 07 2022
parent Walter Bright <newshound2 digitalmars.com> writes:
On 10/7/2022 5:04 PM, Andrey Zherikov wrote:
 On Friday, 7 October 2022 at 19:43:00 UTC, Walter Bright wrote:
 This is good stuff! Please submit this data to bugzilla
https://issues.dlang.org
Unfortunately I'm not able due to "Currently, registering using Gmail addresses is not allowed due to spam." Waiting for the time when bugs are moved to github.
https://issues.dlang.org/show_bug.cgi?id=23398
Oct 08 2022
prev sibling parent Walter Bright <newshound2 digitalmars.com> writes:
On 9/28/2022 8:19 PM, Steven Schveighoffer wrote:
 This seems like it *might be* an out of memory problem. When the compiler runs 
 out of memory, any of a number of things might happen, including segfaults.
All memory allocations in DMD are checked for returning null, and if so, the program exits with a fatal error. If you find any that do not, please post to bugzilla and let me know.
Oct 02 2022
prev sibling parent =?UTF-8?Q?Ali_=c3=87ehreli?= <acehreli yahoo.com> writes:
On 9/28/22 17:48, Andrey Zherikov wrote:
 without any change in source files:

 Failed:
[...]
 Failed:
[...]
 Succeeded:
I see progress. :o) Ali
Sep 28 2022