Author Topic: LNK4209: Debugging information corrupt  (Read 2388 times)

johnsa

  • Member
  • ****
  • Posts: 680
    • Uasm
Re: LNK4209: Debugging information corrupt
« Reply #15 on: December 06, 2017, 03:32:16 AM »
I can only find it available still a preview 5, where did you find the update ? :) It's not showing in my VS notifications either.

Leaeaxedx

  • Regular Member
  • *
  • Posts: 8
Re: LNK4209: Debugging information corrupt
« Reply #16 on: December 06, 2017, 08:28:28 PM »
I can only find it available still a preview 5, where did you find the update ? :) It's not showing in my VS notifications either.

VS showed me the available update 15.5.

I have no idea why this is not the case for you.

Have you tried the Tools\Extensions and Updates drop down menu option? A dialog opens to select updates.

Igor

BTW: I noticed your are on the UASM developer team. Great work, keep up!  :t

johnsa

  • Member
  • ****
  • Posts: 680
    • Uasm
Re: LNK4209: Debugging information corrupt
« Reply #17 on: December 06, 2017, 09:00:43 PM »
Thanks :) Will do,

Yeah I checked there , still nothing.. I'm using VS 2017 Pro, maybe it hasn't been applied to Pro yet ?

Leaeaxedx

  • Regular Member
  • *
  • Posts: 8
Re: LNK4209: Debugging information corrupt
« Reply #18 on: December 06, 2017, 09:19:45 PM »
That might be the case. I'm using the Community version.

johnsa

  • Member
  • ****
  • Posts: 680
    • Uasm
Re: LNK4209: Debugging information corrupt
« Reply #19 on: December 18, 2017, 12:15:57 AM »
15.5.2 is now available for Visual Studio Professional, so I can remove the preview. Yay :)

AW

  • Member
  • *****
  • Posts: 1303
  • Let's Make ASM Great Again!
Re: LNK4209: Debugging information corrupt
« Reply #20 on: December 29, 2017, 07:18:37 AM »
I am using the latest Microsoft (R) Incremental Linker Version 14.12.25831.0 and the latest UASM v2.46, Dec 14 2017

With this code:
Code: [Select]
; Assemble with
; uasm64 -c -win64 -Zp8 /Sg /WX /Zi main.asm
;OR with
; ml64 -c -Zp8 /Sg /WX /Zi main.asm
; link /ENTRY:start /SUBSYSTEM:windows /MACHINE:X64 /FIXED /DEBUG /DEBUGTYPE:CV /PDB:"main.pdb" main.obj

option casemap:none

includelib \masm32\Lib64\kernel32.lib
ExitProcess proto :dword;

.code

start Proc
sub rsp,8
int 3
mov ecx,0
call ExitProcess
start Endp

end

When assembled with MASM and debugged on Windbg I see the source:


When assembled with UASM and debugged on Windbg I don't see the source:


No errors, all linked perfectly.

johnsa

  • Member
  • ****
  • Posts: 680
    • Uasm
Re: LNK4209: Debugging information corrupt
« Reply #21 on: December 29, 2017, 07:28:23 AM »
Just tried with VS and WinDbg x64, VS automatically opened the source file, windbg I had to manually open it to start but then it was all working fine, although I've had that same issue always with Windbg tbh..


nidud

  • Member
  • *****
  • Posts: 1507
    • https://github.com/nidud/asmc
Re: LNK4209: Debugging information corrupt
« Reply #22 on: December 29, 2017, 07:51:25 AM »
I had to manually open it to start but then it was all working fine, although I've had that same issue always with Windbg tbh..

Even if you use the full path name to the source as argument?

johnsa

  • Member
  • ****
  • Posts: 680
    • Uasm
Re: LNK4209: Debugging information corrupt
« Reply #23 on: December 29, 2017, 10:15:57 PM »
I haven't tried to be honest, I never use windbg only Visual Studio, it's a much nicer environment to debug in, and profile etc etc..

LiaoMi

  • Member
  • **
  • Posts: 235
Re: LNK4209: Debugging information corrupt
« Reply #24 on: March 28, 2018, 10:02:22 AM »
Hi,

by simple comparison I decided to find out why the 64 bit version of the Microsoft linker does not work, I make an empty project, with hope the whole difference will be visible, PDB processing stops here -Ln 2816
 
Code: [Select]
00 00 00 00 00 00
FF FF FF FF 1A 09 2F F1  48 00 00 00 28 02 00 00
F9 00 00 00 01 00 00 00  55 01 00 00 01 00 00 00
71 01 00 00 01 00 00 00  09 01 00 00 01 00 00 00
C5 00 00 00 01 00 00 00  39 01 00 00 01 00 00 00
8D 01 00 00 01 00 00 00  29 01 00 00 01 00 00 00
E1 00 00 00 01 00 00 00  00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00  00 00 00 40 00 00 00 00

the logic is

mywindow1.pdb_ml_link_x64 - ml64 & link64 - Ok
mywindow1.pdb_uasm64_bad_x64_linker - uasm64 & link64 - mywindow1.obj : fatal error LNK1318: Unexpected PDB error; OK (0) ''
mywindow1.pdb_uasm64_x32_Link - uasm64 & link32 - Ok

Where

mywindow1.pdb_uasm64_x32_Link
and
mywindow1.pdb_ml_link_x64,

different in content  :icon_rolleyes:, after that I compared jwasm64 and ml64, this bug or structure change is already present there, the size of the object files is the same, I decided to debug a bit, the place with a fatal error occurs at the first pass in the procedure

Code: [Select]
00007FF78240A2EF                                          | 48 8B CE                         | MOV     RCX, RSI                                                                            |
00007FF78240A2F2                                          | E8 85 06 01 00                   | CALL    <link.IMAGE::FPdbEarlyTypeMerge>                                                    |
00007FF78240A2F7                                          | 84 C0                            | TEST    AL, AL                                                                              |
00007FF78240A2F9                                          | 0F 85 67 04 00 00                | JNE     link.7FF78240A766                                                                   |



00007FF782435994 <link.AppendOp>                          | 40 53                            | PUSH    RBX                                                                                 |
00007FF782435996                                          | 48 83 EC 30                      | SUB     RSP, 30                                                                             |
00007FF78243599A                                          | 44 8B 02                         | MOV     R8D, DWORD PTR DS:[RDX]                                                             |
00007FF78243599D                                          | 48 8B D9                         | MOV     RBX, RCX                                                                            |
00007FF7824359A0                                          | 44 88 4C 24 20                   | MOV     BYTE PTR SS:[RSP + 20], R9B                                                         |
00007FF7824359A5                                          | E8 36 44 FE FF                   | CALL    <link.CTaskQueue::Append>                                                           |
00007FF7824359AA                                          | 83 F8 01                         | CMP     EAX, 1                                                                              |
00007FF7824359AD                                          | 0F 84 9F B4 03 00                | JE      link.7FF782470E52                                                                   |
00007FF7824359B3                                          | 48 83 C4 30                      | ADD     RSP, 30                                                                             |
00007FF7824359B7                                          | 5B                               | POP     RBX                                                                                 |
00007FF7824359B8                                          | C3                               | RET   

Append failed  :( Maybe someone has an idea, how to approach the problem from the other side  :idea:


LiaoMi

  • Member
  • **
  • Posts: 235
Re: LNK4209: Debugging information corrupt
« Reply #25 on: April 24, 2018, 06:06:05 PM »
Hi friends,

problem with fatal error LNK1318 has been fixed, this means that in the next release all versions of the Microsoft linker should link even third-party modules without error in the debugging information, I hope everything is finally fixed and we will be able to test the linker for a 64 bit system with debugging information from UASM.

The bug reporting system is very convenient and simple, you just need to give exact examples, with the source code and binary file. Another problem that is covered in the topic here http://masm32.com/board/index.php?topic=6508.msg69749#msg69749 and http://masm32.com/board/index.php?topic=6447.msg69055#msg69055 added to the processing chain for the Microsoft support service.  :eusa_clap: :eusa_clap: :eusa_clap: :eusa_clap: :t