Answered by:
MASM ML64.exe - Corrupted Errors/Warnings
Question
-
Hi,
Trying to update ML64.exe from 10.0.40219.1 (works great) to 14.00.23506.0 (corrupted)
but noticed that the errors/warnings output are corrupted in VS 2015 v14.00.23506.0.
For example, open a console window:
C:\Users\myuser\Downloads\TCPService\Bin\TCPService\x64>make.bat
Microsoft (R) Macro Assembler (x64) Version 14.00.23506.0
ml64 /c /W3 /Sa /Zi /Zd /FlTCPService64.lst /FoTCPService64.obj make.txt
Copyright (C) Microsoft Corporation. All rights reserved.
Assembling: make.txt
..\..\..\Object\x64\Subs.asm(12)ze
..\..\..\Object\x64\Subs.asm(12) : error A2008:syntax error :..\..\..\Object\x64\Subs.asm(50)ze
..\..\..\Object\x64\Subs.asm(50) : error A2008:syntax error :????F??♥..\..\..\Object\x64\Subs.asm(63
)ze
..\..\..\Object\x64\Subs.asm(63) : error A2008:syntax error :????F??♥..\..\..\Object\x64\Xeq.asm(68)
e
..\..\..\Object\x64\Xeq.asm(68) : warning A6004:procedure argument or local not referenced : unusedl
ocal2forcF??????>..\..\..\Object\x64\Xeq.asm(351)ze
..\..\..\Object\x64\Xeq.asm(351) : warning A6004:procedure argument or local not referenced : starze
r magnit????ô..\..\..\Object\x64\EventLogW.asm(150)ied size
..\..\..\Object\x64\EventLogW.asm(150) : warning A6004:procedure argument or local not referenced :
?F←..\..\..\Object\x64\Tcp.asm(4046)ize
..\..\..\Object\x64\Tcp.asm(4046) : warning A6004:procedure argument or local not referenced : te???
ôNotice all the weird characters and general text corruption.
A successful build using v10 instead of v14 looks like this:
Assembling: make.txt
..\..\..\Object\x64\Xeq.asm(68) : warning A6004:procedure argument or local not referenced : unusedlocal2forceEnter
..\..\..\Object\x64\Xeq.asm(351) : warning A6004:procedure argument or local not referenced : startupInfo
..\..\..\Object\x64\EventLogW.asm(150) : warning A6004:procedure argument or local not referenced : moduleNameEnd
..\..\..\Object\x64\Tcp.asm(4046) : warning A6004:procedure argument or local not referenced : tempbufferAny ideas?
Thanks.
- Edited by cyber_flash Friday, July 1, 2016 2:31 PM
Friday, July 1, 2016 2:16 PM
Answers
-
Hi cyber_flash,
thanks for posting here.
>>ml64 /c /W3 /Sa /Zi /Zd /FlTCPService64.lst /FoTCPService64.obj make.txt
According to the MSDN document of ML and ML64 Command-Line Reference, some command-line options to ML and ML64 are placement-sensitive. For example, because ML and ML64 can accept several /c options, any corresponding /Fo options must be specified before /c.
So I suggest you try to write like this:
ml64 /W3 /Sa /Zi /Zd /FlTCPService64.lst /FoTCPService64.obj /c make.txt
Best Regards,
Sera Yu
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Monday, July 4, 2016 6:00 AM -
>>ML64.exe output gets corrupted when dealing with directory traversal paths such as ..\..\..\ or relative and absolute paths too.
The pExt:QWORD you use means allocate and optionally initialize 8 bytes of storage for each initializer. Maybe because the length of the paths overflows.
Best Regards,
Sera Yu
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Friday, July 8, 2016 7:28 AM
All replies
-
/W3 displays level 1, level 2 and level 3 (production quality) warnings. https://msdn.microsoft.com/en-us/library/thxezb7y.aspx
Here's the command that I'm running:
ml64 /nologo /c /W3 /Sa /Zi /Zd /FlMyServer64.lst /FoMyServer64.obj make.txt
Assembling: make.txt
..\..\..\Object\x64\PauseW.asm(626) size
..\..\..\Object\x64\PauseW.asm(626) : warning A6004:procedure argument or local not referenc..\..\..\Object\x64\PauseW.asm(626 : endtime
..\..\..\Object\x64\PauseW.asm(626) : warning A6004:procedure argument or local not reference
..\..\..\Object\x64\PauseW.asm(626) size
..\..\..\Object\x64\PauseW.asm(626) : warning A6004:procedure argument or local not referenced..\..\..\Object\x64\ContainerDebug.asm(3456)specified size
..\..\..\Object\x64\Server.asm(6602) : warning A6004:procedure argument or local not refe..\..\..\Object\x64\Server.asm(6602)nced : port
Notice the output is jumbled.Using this ML64 from here:
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\x86_amd64\ml64.exe
Anyone else having this issue? Same problem for v12 .... but v10..... looks good.
ml64 /nologo /c /W3 /Sa /Zi /Zd /FlMyServer64.lst /FoMyServer64.obj make.txt
Assembling: make.txt
..\..\..\Object\x64\PauseW.asm(626) : warning A6004:procedure argument or local not referenced : timex
..\..\..\Object\x64\PauseW.asm(626) : warning A6004:procedure argument or local not referenced : endtime
..\..\..\Object\x64\PauseW.asm(626) : warning A6004:procedure argument or local not referenced : quiescetypeThe make.txt file looks like this snippet:
INCLUDE ..\..\..\Object\x64\W64.asm
INCLUDE ..\..\..\Object\x64\Definitions.asm
INCLUDE ..\..\..\Object\x64\DefinitionsS.asm
INCLUDE ..\..\..\Object\x64\DefinitionsW.asm
INCLUDE ..\..\..\Object\x64\Allocations.asm
INCLUDE ..\..\..\Object\x64\AllocationsS.asm
INCLUDE ..\..\..\Object\x64\AllocationsW.asm
INCLUDE ..\..\..\Object\x64\DebugFunctions.asm
INCLUDE ..\..\..\Object\x64\PauseW.asm
INCLUDE ..\..\..\Object\x64\IniFile.asm
INCLUDE ..\..\..\Object\x64\MainW.asm
INCLUDE ..\..\..\Object\x64\Subs.asm
INCLUDE ..\..\..\Object\x64\SubsS.asm
INCLUDE ..\..\..\Object\x64\SubsW.asm
INCLUDE ..\..\..\Object\x64\OsW.asmIs there a way to have ML64.exe output the warnings in a sequential manner
or see what changed between v10 and v14?
Even basic compiler errors are corrupted:
C:\Users\myuser\Downloads\TCPService\Bin\TCPService\x64>ml64 /c /w /Sa /Zi /Zd /FlTCPService64
.lst /FoTCPService64.obj make.txt
Microsoft (R) Macro Assembler (x64) Version 14.00.23506.0
Copyright (C) Microsoft Corporation. All rights reserved.
Assembling: make.txt
..\..\..\Object\x64\Subs.asm(12)ze
..\..\..\Object\x64\Subs.asm(12) : error A2008:syntax error :..\..\..\Object\x64\Subs.asm(50)ze
..\..\..\Object\x64\Subs.asm(50) : error A2008:syntax error :????1?N♥..\..\..\Object\x64\Subs.asm(63
)ze
..\..\..\Object\x64\Subs.asm(63) : error A2008:syntax error :????1?N♥Error : TCPService64.obj not cr
eated.Thanks.
- Edited by cyber_flash Friday, July 1, 2016 2:02 PM
- Merged by Weiwei Cai Monday, July 4, 2016 5:38 AM same problem
Friday, July 1, 2016 1:34 AM -
Hi cyber_flash,
thanks for posting here.
>>ml64 /c /W3 /Sa /Zi /Zd /FlTCPService64.lst /FoTCPService64.obj make.txt
According to the MSDN document of ML and ML64 Command-Line Reference, some command-line options to ML and ML64 are placement-sensitive. For example, because ML and ML64 can accept several /c options, any corresponding /Fo options must be specified before /c.
So I suggest you try to write like this:
ml64 /W3 /Sa /Zi /Zd /FlTCPService64.lst /FoTCPService64.obj /c make.txt
Best Regards,
Sera Yu
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Monday, July 4, 2016 6:00 AM -
Tried your suggestion...no success. :(
VS 2010 -> 10.0.40219.1 (works great) but VS 2015 -> 14.00.23506.0 (corrupted text)
I think a ML64 programmer needs to take a peek or perhaps some one can verify the corruption too.
I don't think I'm the only one experiencing this issue?
ml64 /W3 /Sa /Zi /Zd /FlTCPService64.lst /FoTCPService64.obj /c make.txt
Microsoft (R) Macro Assembler (x64) Version 14.00.23506.0
Copyright (C) Microsoft Corporation. All rights reserved.
Assembling: make.txt
..\..\..\Object\x64\Subs.asm(12)ze
..\..\..\Object\x64\Subs.asm(12) : error A2008:syntax error :..\..\..\Object\x64\Subs.asm(50)ze
..\..\..\Object\x64\Subs.asm(50) : error A2008:syntax error :????D?G♥..\..\..\Object\x64\Subs.asm(63
)ze
..\..\..\Object\x64\Subs.asm(63) : error A2008:syntax error :????D?G♥..\..\..\Object\x64\Xeq.asm(68)
e
..\..\..\Object\x64\Xeq.asm(68) : warning A6004:procedure argument or local not referenced : unusedl
ocal2forcD??????>..\..\..\Object\x64\Xeq.asm(351)ze
..\..\..\Object\x64\Xeq.asm(351) : warning A6004:procedure argument or local not referenced : starze
r magnit????ô..\..\..\Object\x64\EventLogW.asm(150)ied size
..\..\..\Object\x64\EventLogW.asm(150) : warning A6004:procedure argument or local not referenced :
?D←..\..\..\Object\x64\Tcp.asm(4046)ize
..\..\..\Object\x64\Tcp.asm(4046) : warning A6004:procedure argument or local not referenced : te???
ô
Thanks.
P.S. I'll try to narrow down the issue to the simplest case...while this above issue is being looked into.
Tuesday, July 5, 2016 12:18 AM -
Narrowed it down...
ML64.exe output gets corrupted when dealing with directory traversal paths such as ..\..\..\ or relative and absolute paths too.
To reproduce, please do the following:
Create a make.bat:
MAKE.BAT
set path="C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\x86_amd64"
set lib="C:\Program Files (x86)\Windows Kits\10\Lib\10.0.10586.0\um\x64\"
set include="C:\Program Files (x86)\Windows Kits\10\Include\10.0.10586.0\um\"
ml64 /c make.txt
Create a Make.txt:
MAKE.TXT
INCLUDE ..\Source\asm\subs\Subs.asm
END
Create Subs.asm in this subfolder path ..\Source\asm\subs\
SUBS.ASM
.CODE
CheckExtension PROC FRAME
LOCAL pExt:QWORD
MOV [RBP+16],RCX
MOV [RBP+24],RDX
MOV [RBP+32],R8
PUSH RSI
PUSH RBX
PUSH RDI
;; blah, blah, ...
POP RDI
POP RBX
POP RSI
RET 0
CheckExtension ENDP
Now run ML64.exe using this command:
ml64 /c make.txt
Microsoft (R) Macro Assembler (x64) Version 14.00.23506.0
Copyright (C) Microsoft Corporation. All rights reserved.
Assembling: make.txt
..\Source\asm\subs\Subs.asm(4
..\Source\asm\subs\Subs.asm(4) : error A2008:syntax error : p??2..\Source\asm\subs\Subs.asm(22)e
..\Source\asm\subs\Subs.asm(22) : error A2220:Missing .ENDPROLO2???n?n
Also, specifying relative and absolute paths are corrupted too:
Make.txt
INCLUDE source\asm\subs\Subs.asm
END
C:\Users\myuser\Downloads\TCPService\Bin\TCPService\x64>make.bat
Microsoft (R) Macro Assembler (x64) Version 14.00.23506.0
Copyright (C) Microsoft Corporation. All rights reserved.
Assembling: make.txt
C:\Users\myuser\Downloads\TCPService\Object\x64\Subs.asm(4) size
: error A2008:syntax error : pExt
C:\Users\myuser\Downloads\TCPService\Object\x64\Subs.asm(23)ed size
: error A2220:Missing .ENDPROLOGIf I omit the paths and simply put ALL the ASM files in the same folder as the BAT file - no corruption occurs:
Make.txt
INCLUDE Subs.asm
END
ml64 /c make.txt
Microsoft (R) Macro Assembler (x64) Version 14.00.23506.0
Copyright (C) Microsoft Corporation. All rights reserved.
Assembling: make.txt
Subs.asm(4) : error A2008:syntax error : pExt
Subs.asm(23) : error A2220:Missing .ENDPROLOGThanks.
- Edited by cyber_flash Thursday, July 7, 2016 12:19 PM
Tuesday, July 5, 2016 1:12 AM -
>>ML64.exe output gets corrupted when dealing with directory traversal paths such as ..\..\..\ or relative and absolute paths too.
The pExt:QWORD you use means allocate and optionally initialize 8 bytes of storage for each initializer. Maybe because the length of the paths overflows.
Best Regards,
Sera Yu
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Friday, July 8, 2016 7:28 AM -
Got a simple repro:
1. Open this VS2015 command prompt: VS2015 x86 x64 Cross Tools Command Prompt
2. Create a test.asm in this path: C:\asif\asif1\asif2\
.CODE main PROC mov eax,rax mov ecx,rcx RET main ENDP3. Run this ML64 command:
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC>ml64 /c c:\asif\asif1\asif2\test.asm
Microsoft (R) Macro Assembler (x64) Version 14.00.24210.0
Copyright (C) Microsoft Corporation. All rights reserved.
Assembling: c:\asif\asif1\asif2\test.asm
c:\asif\asif1\asif2\test.asm(7)e
c:\asif\asif1\asif2\test.asm(7) : error A2088:END directive required at end of f
il☺c:\asif\asif1\asif2\test.asm(4)e
c:\asif\asif1\asif2\test.asm(5)eNotice these above errors are scrambled and bogus!
The odd thing is this command works below:
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC>ml64 /c c:\asif\asif1\test.asm
Microsoft (R) Macro Assembler (x64) Version 14.00.24210.0
Copyright (C) Microsoft Corporation. All rights reserved.
Assembling: c:\asif\asif1\test.asm
c:\asif\asif1\test.asm(7) : error A2088:END directive required at end of file
c:\asif\asif1\test.asm(4) : error A2022:instruction operands must be the same size
c:\asif\asif1\test.asm(5) : error A2022:instruction operands must be the same sizeIt seems like a file path with many slashes "\" or path length confuses ML64.exe?
Also, the 32bit compiler ML.EXE produces scrambled results:
The ML.exe repro:
C:\asif\asif1\asif2>ml /c C:\asif\asif1\asif2\test.asm
Microsoft (R) Macro Assembler Version 14.00.24210.0Copyright (C) Microsoft Corporation. All rights reserved.Assembling: C:\asif\asif1\asif2\test.asmC:\asif\asif1\asif2\test.asm(2)eC:\asif\asif1\asif2\test.asm(2) : error A2013:.MODEL must precede this directiv??ù?ÙC:\asif\asif1\asif2\test.asm(3)eC:\asif\asif1\asif2\test.asm(3) : error A2034:must be in segment block : 13:.MODEL must precede this directiv??ù?ÙC:\asif\asif1\asif2\test.asm(4)eC:\asif\asif1\asif2\test.asm(4) : error A2034:must be in segment blocde this directiv??ù?ÙC:\asif\asif1\asif2\test.asm(5)eC:\asif\asif1\asif2\test.asm(5) : error A2034:must be in segment blocde this directiv??ù?ÙC:\asif\asif1\asif2\test.asm(6)eC:\asif\asif1\asif2\test.asm(6) : error A2034:must be in segment blocde this directiv??ù?ÙC:\asif\asif1\asif2\test.asm(7)eC:\asif\asif1\asif2\test.asm(7) : fatal error A1010:unmatched block nestlocde this directiv??ù?ÙC:\asif\asif1\asif2>
test.asm is
.CODEmain PROCmov eax,raxmov ecx,rcxRETmain ENDPVS2008 & VS2012 seem okay, VS2013/15 are not!
- Edited by cyber_flash Saturday, July 23, 2016 11:59 AM
Thursday, July 21, 2016 7:32 PM -
VS2017 ML/ML64/LINK exe's have been fixed. No more corruption.
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.10.24911\bin\HostX86\x86
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.10.24911\bin\HostX86\x64Although, these fixed versions don't seem to have been updated in VS2015 (yet).
Thanks M$! :)
Friday, February 17, 2017 3:06 AM