www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 11280] New: [REG 2.064] Symbol missing although it should be there

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=11280

           Summary: [REG 2.064] Symbol missing although it should be there
           Product: D
           Version: D2
          Platform: x86
        OS/Version: All
            Status: NEW
          Severity: regression
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: code benjamin-thaut.de



PDT ---
This only happens on 32-bit windows. This used to work with dmd 2.064 beta 1
and all previous versions of dmd. The attached repro case does not work with
the latest git head of the 2.064 branch
(718dfbb02f8ca7356e8f46637b2e90e2f81d96d0).

For building the attached repro case simply run the build.cmd inside the src
directory. The script will automatically run libunres on the generated lib file
to list all the unresolved symbols. When compiling the attached repro case with
dmd 2.064 beta 1 or any version before that you will notice that the symbol
"_D6thBase6plugin8ScanPair6__initZ" is not in the list of the unresolved
symbols. If you run libunres -p on the generated file you will notice that the
symbol actually is part of the public symbols. When compiling with the latest
git head dmd the symbol "_D6thBase6plugin8ScanPair6__initZ" will be listed as
unresolved symbol and will not be listed when running libunres -p. 

Also really interresting about the repro case is, that if you remove the line
from build.cmd which adds thBase\container\hashmap.d the library will stop
compiling with some strange import error messages.

The repro cases includes the modified druntime import folder of my version of
druntime. A possible reason for this issues are the public imports inside
object.di which might cause the issue for whatever reason. When removing
-version=NOGCSAFE from the build command for the lib the issues goes away.
Doing so will disable the public imports inside object.di.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Oct 16 2013
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=11280




PDT ---
Created an attachment (id=1267)
repro case

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Oct 16 2013
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=11280




Introduced commit:
https://github.com/D-Programming-Language/dmd/commit/fc9b88cddaf3a279dcf5ce1ec8b262c4a47020e1

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Oct 19 2013
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=11280


Walter Bright <bugzilla digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bugzilla digitalmars.com



19:54:46 PDT ---
Hmm, pull request 2660.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Oct 20 2013
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=11280




PDT ---
I don't quite understand why this only happens when compiling for 32-bit. It
works fine for 64-bit?

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Oct 21 2013
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=11280


Martin Nowak <code dawg.eu> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |code dawg.eu



What's your actual problem with the generated library?
I don't can't produce any link errors so the symbol is in the library.
Also libunres shows _D6thBase6plugin8ScanPair6__initZ as common symbol (using
-d).

The only strange thing I found is that COMDEF records are not added to the
library symbol table (https://github.com/dawgfoto/dmd/compare/fix11280).
It seems like libunres showing an unresolved symbol is a libunres bug.

That said I'm lacking any useful and reliable tool to inspect omf lib symbol
tables.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Oct 21 2013
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=11280




PDT ---
The actual problem is that optlink also lists _D6thBase6plugin8ScanPair6__initZ
as unresolved symbol. Just like libunres. Which results in my application no
longer linking with dmd 2.064.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Oct 21 2013
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=11280




I can also reproduce the described libunres behavior with a minimal test case.

struct Foo {}
void bar() { Foo[2] foos; } // references Foo.init

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Oct 21 2013
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=11280





 The actual problem is that optlink also lists _D6thBase6plugin8ScanPair6__initZ
 as unresolved symbol.
Mmh, I can't reproduce that. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Oct 21 2013
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=11280




PDT ---
You have to add my version of the druntime import folder (which is included in
the repro case), specify -version=NOGCSAFE and impor thBase.logging to trigger
the bug. I can will add a simple executable which causes the linker error
tomorrow. I removed it from the repro case because I thought it is not
releveant as libunres also lists the symbol as unresolved.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Oct 21 2013
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=11280




01:18:06 PDT ---
Created an attachment (id=1276)
repro case with executable

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Oct 22 2013
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=11280




01:19:27 PDT ---
The second repro case will compile fine using dmd 2.064 beta 1. When using the
latest git head of the 2.064 branch it will fail to compile with the optlink
error message:
Error 42: Symbol Undefined _D6thBase6plugin8ScanPair6__initZ

I'm using optlink:
OPTLINK (R) for Win32  Release 8.00.13

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Oct 22 2013
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=11280




14:11:33 PDT ---
https://github.com/D-Programming-Language/dmd/pull/2689

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Oct 22 2013
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=11280




Commits pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/12c81ff96b1cfee8db1489dc8d97c46d02e928c5
fix
Issue 11280 - [REG 2.064] Symbol missing although it should be there

https://github.com/D-Programming-Language/dmd/commit/06f5c75dccf0533499cd7aebd228e4dcb505f8c7


fix Issue 11280 - [REG 2.064] Symbol missing although it should be there

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Oct 23 2013
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=11280




Commit pushed to 2.064 at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/56d1ebd7e68d1bed331f89045f0ac4b3fd64ac92


fix Issue 11280 - [REG 2.064] Symbol missing although it should be there

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Oct 23 2013
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=11280


Kenji Hara <k.hara.pg gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |link-failure, pull
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED


-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Oct 23 2013
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=11280




Commit pushed to 2.064 at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/0f8cd2885cbd485a93f3cbfebc5b6ad5a448df1b


fix Issue 11280 - [REG 2.064] Symbol missing although it should be there

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Oct 23 2013
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=11280




10:43:13 PDT ---
I can confirm that this is also fixed in my actual project.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Oct 23 2013
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=11280




---

 I can confirm that this is also fixed in my actual project.
Thanks! -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Oct 23 2013