[Issue 10398] New: Dmd bugs detected by memcheck when compile druntime+phobos

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Jun 18 02:22:07 PDT 2013


http://d.puremagic.com/issues/show_bug.cgi?id=10398

           Summary: Dmd bugs detected by memcheck when compile
                    druntime+phobos
           Product: D
           Version: unspecified
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: diagnostic, ice
          Severity: major
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: maxim at maxim-fomin.ru


--- Comment #0 from Maxim Fomin <maxim at maxim-fomin.ru> 2013-06-18 02:22:01 PDT ---
Memcheck reports following traces:

1) Issue in Lexer::scan() or Lexer::nextToken()

==8678== Invalid write of size 8
==8678==    at 0x4E0E20: Lexer::scan(Token*) (lexer.c:464)
==8678==    by 0x4E0BA4: Lexer::nextToken() (lexer.c:333)
==8678==    by 0x525082: Parser::parseStatement(int, unsigned char**)
(parse.c:3972)
==8678==    by 0x523907: Parser::parseContracts(FuncDeclaration*)
(parse.c:3378)
==8678==    by 0x523217: Parser::parseDeclarations(unsigned long, unsigned
char*) (parse.c:3238)
==8678==    by 0x51B2E0: Parser::parseDeclDefs(int, Dsymbol**) (parse.c:237)
==8678==    by 0x51CFB4: Parser::parseBlock(Dsymbol**) (parse.c:872)
==8678==    by 0x51C7E5: Parser::parseDeclDefs(int, Dsymbol**) (parse.c:663)
==8678==    by 0x51AF50: Parser::parseModule() (parse.c:132)
==8678==    by 0x4ED93E: Module::parse() (module.c:498)
==8678==    by 0x4EB000: tryMain(unsigned long, char**) (mars.c:1396)
==8678==    by 0x4EBE5F: main (mars.c:1715)
==8678==  Address 0x7feffeab8 is on thread 1's stack

This repeats several times with difference in read/write status and source line
is sometimes 464, 465, 468, 469, 472, 474, etc. Sometimes trace is

==9132==    at 0x4E619F: isidchar(unsigned char) (lexer.c:52)
==9132==    by 0x4E0BA4: Lexer::nextToken() (lexer.c:333)
==9132==    by 0x525082: Parser::parseStatement(int, unsigned char**)
(parse.c:3972)
....

2) Issue in reghasvalue():

==9140== Conditional jump or move depends on uninitialised value(s)
==9140==    at 0x42A546: reghasvalue (cgen.c:442)
==9140==    by 0x5E772A: simplify_code (cod3.c:5120)
==9140==    by 0x429E4F: gen (cgen.c:180)
==9140==    by 0x5D8677: cdind (cod2.c:2787)
==9140==    by 0x41DD37: codelem (cgcod.c:2481)
==9140==    by 0x5C6CCB: logexp (cod1.c:516)
==9140==    by 0x5C6A48: logexp (cod1.c:472)
==9140==    by 0x5DE01B: outblkexitcode (cod3.c:765)
==9140==    by 0x41B9FA: blcodgen(block*) (cgcod.c:1298)
==9140==    by 0x4195BE: codgen (cgcod.c:243)
==9140==    by 0x519F6A: writefunc2(Symbol*) (out.c:1224)
==9140==    by 0x519882: writefunc(Symbol*) (out.c:897)

3) Issue in peephole():

==9265== Conditional jump or move depends on uninitialised value(s)
==9265==    at 0x5C5566: peephole(code*, unsigned int) (cgsched.c:2927)
==9265==    by 0x5C19E0: cgsched_pentium(code**, unsigned int) (cgsched.c:91)
==9265==    by 0x5C1ACC: cgsched_block (cgsched.c:112)
==9265==    by 0x419A00: codgen (cgcod.c:330)
==9265==    by 0x519F6A: writefunc2(Symbol*) (out.c:1224)
==9265==    by 0x519882: writefunc(Symbol*) (out.c:897)
==9265==    by 0x4C49BD: FuncDeclaration::toObjFile(int) (glue.c:1043)
==9265==    by 0x4C2A3A: Module::genobjfile(int) (glue.c:350)
==9265==    by 0x4EBABB: tryMain(unsigned long, char**) (mars.c:1625)
==9265==    by 0x4EBE5F: main (mars.c:1715)

4) Issue in asm_is_fpreg() which looks like related to #1:

==9274== Invalid read of size 1
==9274==    at 0x4CDB46: asm_is_fpreg(char*) (iasm.c:2241)
==9274==    by 0x4D1CB2: asm_primary_exp() (iasm.c:4402)
==9274==    by 0x4D196A: asm_una_exp() (iasm.c:4270)
==9274==    by 0x4D1738: asm_br_exp() (iasm.c:4146)
==9274==    by 0x4D142D: asm_mul_exp() (iasm.c:4069)
==9274==    by 0x4D133A: asm_add_exp() (iasm.c:4030)
==9274==    by 0x4D11FB: asm_shift_exp() (iasm.c:4002)
==9274==    by 0x4D109B: asm_rel_exp() (iasm.c:3952)
==9274==    by 0x4D0F37: asm_equal_exp() (iasm.c:3909)
==9274==    by 0x4D0E7A: asm_and_exp() (iasm.c:3886)
==9274==    by 0x4D0DBD: asm_xor_exp() (iasm.c:3863)
==9274==    by 0x4D0D00: asm_inc_or_exp() (iasm.c:3840)
==9274==  Address 0x5e450ca is 0 bytes after a block of size 42 alloc'd
==9274==    at 0x4C2A0B4: calloc (in
/usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==9274==    by 0x4EC45E: Mem::calloc(unsigned long, unsigned long) (rmem.c:60)
==9274==    by 0x54F38F: StringEntry::alloc(char const*, unsigned long)
(stringtable.c:98)
==9274==    by 0x54F587: StringTable::update(char const*, unsigned long)
(stringtable.c:156)
==9274==    by 0x4E13CE: Lexer::scan(Token*) (lexer.c:618)
==9274==    by 0x4E0C03: Lexer::peek(Token*) (lexer.c:347)
==9274==    by 0x4E0C3C: Lexer::peekNext() (lexer.c:359)
==9274==    by 0x524A34: Parser::parseStatement(int, unsigned char**)
(parse.c:3866)
==9274==    by 0x5250B9: Parser::parseStatement(int, unsigned char**)
(parse.c:3978)
==9274==    by 0x51E1B6: Parser::parseUnitTest() (parse.c:1320)
==9274==    by 0x51B41D: Parser::parseDeclDefs(int, Dsymbol**) (parse.c:275)
==9274==    by 0x51AF50: Parser::parseModule() (parse.c:132)

5) Finally compilation is aborted with following error:
std/math.d(2265): Error: static assert  (false && 0.00000L * infL <=
cast(real)4) is false.

Marked as diagnostic as compilation aborts with error message and ice as these
may be bugs in dmd.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list