Bug 21280 – No error output "cast(ubyte[4])("ABCDEF"[0..4]);"

Status
NEW
Severity
critical
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2020-09-27T01:20:47Z
Last change time
2024-12-13T19:11:49Z
Keywords
backend
Assigned to
No Owner
Creator
sdv
Moved to GitHub: dmd#19795 →

Comments

Comment #0 by sdvcn — 2020-09-27T01:20:47Z
//code: auto v = cast(ubyte[4])("ABCDEF"[0..4]); /* The compiler does not output any information */
Comment #1 by destructionator — 2020-09-27T01:31:51Z
Specifically the compiler seems to hang in a loop allocating memory until it exhausts the system! Yikes. I put it in gdb and ctrl+c'd a couple times just to see where it was: Program received signal SIGINT, Interrupt. 0x00007ffff7c88ebc in _int_malloc () from /lib64/libc.so.6 (gdb) where #0 0x00007ffff7c88ebc in _int_malloc () from /lib64/libc.so.6 #1 0x00007ffff7c8a7e4 in malloc () from /lib64/libc.so.6 #2 0x0000555555919c8b in code_chunk_alloc() () #3 0x000055555567d483 in CodeBuilder::gen(code*) () #4 0x00005555559032ae in cdeq(CodeBuilder&, elem*, unsigned int*) () #5 0x00005555558b4cbf in codelem(CodeBuilder&, elem*, unsigned int*, unsigned int) () #6 0x00005555558e14e9 in cdcomma(CodeBuilder&, elem*, unsigned int*) () #7 0x00005555558b4cbf in codelem(CodeBuilder&, elem*, unsigned int*, unsigned int) () #8 0x00005555558c1e0f in outblkexitcode(CodeBuilder&, block*, int&, char const*, Symbol**, unsigned int) () #9 0x00005555558fdcff in blcodgen(block*) () #10 0x00005555558fc6a8 in codgen(Symbol*) () #11 0x0000555555940dcb in writefunc2(Symbol*) () #12 0x0000555555940708 in writefunc(Symbol*) () #13 0x0000555555683364 in FuncDeclaration_toObjFile(FuncDeclaration*, bool) () #14 0x00005555556a9f32 in genObjFile(Module*, bool) () #15 0x000055555576f776 in _D3dmd4mars7tryMainFmPPxaKSQz7globals5ParamZi () #16 0x000055555577941f in D main () (gdb) c Continuing. ^C Program received signal SIGINT, Interrupt. 0x00005555558b496c in simplify_code(code*) () (gdb) where #0 0x00005555558b496c in simplify_code(code*) () #1 0x000055555567d4b6 in CodeBuilder::gen(code*) () #2 0x00005555559032ae in cdeq(CodeBuilder&, elem*, unsigned int*) () #3 0x00005555558b4cbf in codelem(CodeBuilder&, elem*, unsigned int*, unsigned int) () #4 0x00005555558e14e9 in cdcomma(CodeBuilder&, elem*, unsigned int*) () #5 0x00005555558b4cbf in codelem(CodeBuilder&, elem*, unsigned int*, unsigned int) () #6 0x00005555558c1e0f in outblkexitcode(CodeBuilder&, block*, int&, char const*, Symbol**, unsigned int) () #7 0x00005555558fdcff in blcodgen(block*) () #8 0x00005555558fc6a8 in codgen(Symbol*) () #9 0x0000555555940dcb in writefunc2(Symbol*) () #10 0x0000555555940708 in writefunc(Symbol*) () #11 0x0000555555683364 in FuncDeclaration_toObjFile(FuncDeclaration*, bool) () #12 0x00005555556a9f32 in genObjFile(Module*, bool) () #13 0x000055555576f776 in _D3dmd4mars7tryMainFmPPxaKSQz7globals5ParamZi () #14 0x000055555577941f in D main () (gdb) c Continuing. ^C Program received signal SIGINT, Interrupt. 0x00007ffff7c88ebc in _int_malloc () from /lib64/libc.so.6 Then it ran out of memory and slaughtered my system anyway.
Comment #2 by robert.schadek — 2024-12-13T19:11:49Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/19795 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB