Thread overview
[Issue 6045] New: Unable to demangle symbols
May 22, 2011
Robert Clipsham
May 22, 2011
kennytm@gmail.com
Sep 06, 2011
Sean Kelly
Jan 03, 2012
Trass3r
Sep 28, 2013
Andrej Mitrovic
May 22, 2011
http://d.puremagic.com/issues/show_bug.cgi?id=6045

           Summary: Unable to demangle symbols
           Product: D
           Version: D2
          Platform: Other
        OS/Version: Mac OS X
            Status: NEW
          Severity: normal
          Priority: P2
         Component: druntime
        AssignedTo: nobody@puremagic.com
        ReportedBy: robert@octarineparrot.com


--- Comment #0 from Robert Clipsham <robert@octarineparrot.com> 2011-05-22 22:31:03 BST ---
In a backtrace, the following symbols were outputted as mangled symbols, rather than demangled:

_D8serenity9persister6Sqlite7__arrayZ _D8serenity9persister6Sqlite70__T15SqlitePersisterTS8serenity9persister6Sqlite11__unittest6FZv4TestZ15SqlitePersister12__T7opIndexZ7opIndexMFmZS8serenity9persister6Sqlite11__unittest6FZv4Test

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
May 22, 2011
http://d.puremagic.com/issues/show_bug.cgi?id=6045


kennytm@gmail.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |kennytm@gmail.com


--- Comment #1 from kennytm@gmail.com 2011-05-22 14:55:05 PDT ---
The 1st symbol cannot be demangled because 'Z' is not a valid type. It could be demangled if that 'Z' is valid, e.g. replacing it with 'i':

       _D8serenity9persister6Sqlite7__arrayi
    -> int serenity.persister.Sqlite.__array

The same goes for vtbl (e.g. _D10TypeInfo_C6__vtblZ), module info (e.g.
_D2rt3aaA12__ModuleInfoZ), etc.

The 2nd symbol cannot be demangled probably because pull #15 is not completely merged (because my local copy of druntime is able to demangle that) due to 64-bit issue.

    void serenity.persister.Sqlite.__unittest6().Test
serenity.persister.Sqlite.SqlitePersister!(void
serenity.persister.Sqlite.__unittest6().Test).SqlitePersister.opIndex!().opIndex(ulong)

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
September 06, 2011
http://d.puremagic.com/issues/show_bug.cgi?id=6045


Sean Kelly <sean@invisibleduck.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |sean@invisibleduck.org


--- Comment #2 from Sean Kelly <sean@invisibleduck.org> 2011-09-06 12:13:06 PDT ---
Is that second symbol really valid?  Here's a brief run-down of one pertinent portion of the parse, given:

70__T15SqlitePersisterTS8serenity9persister6Sqlite11__unittest6FZ

The format for a TemplateInstanceName is:

Number __T LName TemplateArgs Z

So we pick off '70' as Number, match the '__T', pick out the LName of "SqlitePersister", then match a template arg (which begin with a 'T', 'V', or 'S') to get "serenity.persister.Sqlite.__unittest6".  At this point we expect a 'T', 'V', or 'S' if there's another template arg to parse... there isn't one, so we jump back to parsing the TemplateInstance name and expect a 'Z' to terminate the name.  We find an 'F' instead, so this isn't a template name and so we assume that this is a weird qualified name instead.

Is there some use of the 'F' that the ABI doesn't mention?  Otherwise I think core.demangle is currently correct in its treatment of the second symbol.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
January 03, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=6045


Trass3r <mrmocool@gmx.de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |mrmocool@gmx.de
         OS/Version|Mac OS X                    |All


--- Comment #3 from Trass3r <mrmocool@gmx.de> 2012-01-03 10:51:46 PST ---
Guess it's a good idea to use this issue as a gathering point for demangling problems.

Here's another one: _D3std11parallelism8TaskPool28__T6reduceVAyaa5_61202b2062Z130__T6reduceTS4test4mainFZv39__T3mapS28_D4test4mainFZv7getTermMFiZeZ49__T3mapTS3std5range15__T4iotaTyiTyiZ4iota6ResultZ3mapM6ResultZ6reduceMFS4test4mainFZv39__T3mapS28_D4test4mainFZv7getTermMFiZeZ49__T3mapTS3std5range15__T4iotaTyiTyiZ4iota6ResultZ3mapMFS3std5range15__T4iotaTyiTyiZ4iotaFyiyiZS3std5range15__T4iotaTyiTyiZ4iota6Result6ResultZS4test4mainFZv39__T3mapS28_D4test4mainFZv7getTermMFiZeZ49__T3mapTS3std5range15__T4iotaTyiTyiZ4iota6ResultZ3mapM6Result6ResultZe

from the std.parallel example:
import std.algorithm, std.parallelism, std.range;
void main() {
    immutable n = 1_000_000_000;
    immutable delta = 1.0 / n;

    real getTerm(int i) {
        immutable x = ( i - 0.5 ) * delta;
        return delta / ( 1.0 + x * x ) ;
    }

    immutable pi = 4.0 * taskPool.reduce!"a + b"(
        std.algorithm.map!getTerm(iota(n))
    );
}

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
September 21, 2013
http://d.puremagic.com/issues/show_bug.cgi?id=6045



--- Comment #4 from github-bugzilla@puremagic.com 2013-09-21 06:15:13 PDT ---
Commit pushed to master at https://github.com/D-Programming-Language/phobos

https://github.com/D-Programming-Language/phobos/commit/9837043cfc75a37d4a79941cc5b401e19213088d Merge pull request #1592 from rainers/demangle_local

fix issues 10277 & 6045:improve demangling for function local symbols

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
September 21, 2013
http://d.puremagic.com/issues/show_bug.cgi?id=6045



--- Comment #5 from github-bugzilla@puremagic.com 2013-09-21 09:17:19 PDT ---
Commit pushed to master at https://github.com/D-Programming-Language/druntime

https://github.com/D-Programming-Language/druntime/commit/64ae912e8e89840a0ed14fc149c10fe6bfb8e169 Merge pull request #611 from rainers/demangle_local

fix issues 10277 & 6045:improve demangling for function local symbols

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
September 28, 2013
http://d.puremagic.com/issues/show_bug.cgi?id=6045


Andrej Mitrovic <andrej.mitrovich@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |andrej.mitrovich@gmail.com


--- Comment #6 from Andrej Mitrovic <andrej.mitrovich@gmail.com> 2013-09-28 03:04:56 PDT ---
I guess this is fixed now?

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