Thread overview
[Issue 2238] New: Internal DMD data corruption
Jul 19, 2008
d-bugmail
Jul 19, 2008
d-bugmail
Aug 30, 2008
d-bugmail
[Issue 2238] Linker shows long identifier names in a not human readable compressed form on Windows
Aug 30, 2008
d-bugmail
Dec 09, 2008
d-bugmail
Aug 25, 2009
simon
Aug 25, 2009
simon
July 19, 2008
http://d.puremagic.com/issues/show_bug.cgi?id=2238

           Summary: Internal DMD data corruption
           Product: D
           Version: 1.033
          Platform: PC
        OS/Version: Windows
            Status: NEW
          Severity: minor
          Priority: P4
         Component: DMD
        AssignedTo: bugzilla@digitalmars.com
        ReportedBy: 2korden@gmail.com


Compiling the code:

main.d
~~~~~~
import math.Matrix;

void main()
{
    auto a = new Matrix44F();
    Matrix44F.add(a, a);
}

math/Matrix.d
~~~~~~~~~~~~~
module math.Matrix;

class Matrix44F
{
    static M add(M)(M a, M b);
}

produces the following DMD output:
Error 42: Symbol Undefined
_D4math6Mбrix9х44F32__T3addTCЂ–ЎZЂ„ќFЂ—ќЂ˜ґЂ—˜

Looks like some internal data corruption takes place...
Changing nearly anything (return type value, number of arguments, module name
etc.) makes problem disappear.


-- 

July 19, 2008
<d-bugmail@puremagic.com> wrote in message news:bug-2238-3@http.d.puremagic.com/issues/...
> http://d.puremagic.com/issues/show_bug.cgi?id=2238
>
>           Summary: Internal DMD data corruption
>           Product: D
>           Version: 1.033
>          Platform: PC
>        OS/Version: Windows
>            Status: NEW
>          Severity: minor
>          Priority: P4
>         Component: DMD
>        AssignedTo: bugzilla@digitalmars.com
>        ReportedBy: 2korden@gmail.com
>
>
> Compiling the code:
>
> main.d
> ~~~~~~
> import math.Matrix;
>
> void main()
> {
>    auto a = new Matrix44F();
>    Matrix44F.add(a, a);
> }
>
> math/Matrix.d
> ~~~~~~~~~~~~~
> module math.Matrix;
>
> class Matrix44F
> {
>    static M add(M)(M a, M b);
> }
>
> produces the following DMD output:
> Error 42: Symbol Undefined
> _D4math6Mбrix9х44F32__T3addTCЂ–ЎZЂ„ќFЂ—ќЂ˜ґЂ—˜
>
> Looks like some internal data corruption takes place...
> Changing nearly anything (return type value, number of arguments, module
> name
> etc.) makes problem disappear.

DMDWin compresses long(er) symbol names in order to fit them in the extremely restrictive limits of the OMF format, so the above symbol looks pretty typical for templates on DMDWin.  It's odd that it doesn't seem to be resolving correctly though.  Maybe one part of the compiler is lz77 compressing the template symbol names and another is MD5 hashing them?


July 19, 2008
http://d.puremagic.com/issues/show_bug.cgi?id=2238


2korden@gmail.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Version|1.033                       |1.031




------- Comment #1 from 2korden@gmail.com  2008-07-19 16:41 -------
DMD1.029 gives correct error message, but DMD1.031+ doesn't so it's a regression and Windows only (thanks Christian).


-- 

August 30, 2008
http://d.puremagic.com/issues/show_bug.cgi?id=2238


bugzilla@digitalmars.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |INVALID




------- Comment #2 from bugzilla@digitalmars.com  2008-08-29 21:16 -------
It isn't corrupt data. dmd will compress the identifiers when they get too long, you're seeing the compressed version (because the linker just spits out what it sees).


-- 

August 30, 2008
http://d.puremagic.com/issues/show_bug.cgi?id=2238


2korden@gmail.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|minor                       |enhancement
             Status|RESOLVED                    |REOPENED
         Resolution|INVALID                     |
            Summary|Internal DMD data corruption|Linker shows long identifier
                   |                            |names in a not human
                   |                            |readable compressed form on
                   |                            |Windows




------- Comment #3 from 2korden@gmail.com  2008-08-30 06:30 -------
Ok, I agree that it's not a bug, but it is an annoying. There could be some mapping from a compressed name too full one, and linker should output correct mangled name. Its output supposed to be read by human, isn't it? It is supposed to help user in tracking the problem, not for confusing him.

Besides, showing external data in internal representation isn't very good as it breaks incapsulation :)


-- 

December 09, 2008
http://d.puremagic.com/issues/show_bug.cgi?id=2238





------- Comment #4 from 2korden@gmail.com  2008-12-08 19:14 -------
Bump! Just hit by this one again. How am I supposed to decypher (and fix)
errors like:

 Error 42: Symbol Undefined
_D3stl4utiбcont6Vector40__TЂ‡ЊTC2ui7Ђ„ќrol7CяэZЂ‡Ґ9findFirstMFЂќ°SЂЖр8IteraЂѓ‰
 Error 42: Symbol Undefined
_D3stl4utiбcont6Vector40__TЂ‡ЊTC2ui7Ђ„ќrol7CяэZЂ‡Ґ3endMFZSЂЖО8IteraЂѓ‰


-- 

August 25, 2009
http://d.puremagic.com/issues/show_bug.cgi?id=2238





--- Comment #5 from simon <s.d.hammett@googlemail.com>  2009-08-25 11:06:20 PDT ---
Created an attachment (id=441)
 --> (http://d.puremagic.com/issues/attachment.cgi?id=441)
Test case for unhelpful behaviour

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
August 25, 2009
http://d.puremagic.com/issues/show_bug.cgi?id=2238


simon <s.d.hammett@googlemail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |s.d.hammett@googlemail.com




--- Comment #6 from simon <s.d.hammett@googlemail.com>  2009-08-25 11:09:00 PDT ---
I think this is a bug.

dmd is hitting an error, outputting no error message, leaving behind a corrupt .obj and then just to add to the confusion is going on to run the link step, resulting in the erroneous linker errors.

This situation is less than ideal.
At the least dmd should exit with 'unknown error'.

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