MASM 32 fatal error A1016 - by Keeping_Real_Busy

Status : 

  Postponed<br /><br />
		Due to current priorities, the product team decided to postpone the resolution of this item.<br /><br />
		A more detailed explanation for the resolution of this particular item may have been provided in the comments section.


0
0
Sign in
to vote
ID 356393 Comments
Status Closed Workarounds
Type Bug Repros 0
Opened 7/16/2008 10:00:29 AM
Access Restriction Public

Description

I encountered a MASM Internal Assembler Error.

-------------------------------------------------------------------------------
Here is the failing source:
-------------------------------------------------------------------------------

OPTION CASEMAP:NONE

.686P
.MMX
.XMM
.MODEL flat, stdcall
.STACK 4096

APIExitProcess EQU <ExitProcess>

APIExitProcess  PROTO,dExitCode:DWORD

Calc PROTO,dPercent:DWORD

StrucTest   STRUCT
            wRecPointers    WORD ?
StrucTest   ENDS

REC_PTRS EQU 12

.data

.data?

    MyStruct    StrucTest <>

.code

main PROC

    mov    esi,OFFSET MyStruct
    INVOKE Calc,OFFSET [esi+REC_PTRS]
    INVOKE ExitProcess,0

main ENDP

Calc PROC,
     dPercent:DWORD

     ret
Calc ENDP

END main

-------------------------------------------------------------------------------
Here is the make:
(using MASM 6.15)
-------------------------------------------------------------------------------

ML /nologo -Zi -c -Fl -Sg -coff test.asm
if errorlevel 1 goto terminate

LINK32 /nologo test.obj kernel32.lib /SUBSYSTEM:CONSOLE /DEBUG /MAP /OUT:test.exe
if errorLevel 1 goto terminate

:terminate

-------------------------------------------------------------------------------
Here is the execution report using MASM 6.15:
-------------------------------------------------------------------------------

Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.

F:\DAVE06DATA\Strtest\Sortbin>maketest

F:\DAVE06DATA\Strtest\Sortbin>ML /nologo -Zi -c -Fl -Sg -coff test.asm
 Assembling: test.asm
test.asm(32) : fatal error A1016: Internal Assembler Error

F:\DAVE06DATA\Strtest\Sortbin>if errorlevel 1 goto terminate
F:\DAVE06DATA\Strtest\Sortbin>

-------------------------------------------------------------------------------
Here is the execution report using MASM 8:
Note: MASM 8 did not even set errorLevel so the make attempted to link anyway
but, in this case, it used the MASM 6.15 LINK32 (I only copied ML.EXE from
Visual Studio 8 into the sbin directory for this MASM 8 test).
I would have tried to use MASM 9 but have been unable to get a copy since last
August (still not available for download from Microsoft) when I reported ORCAS
BETA 2 errors.
-------------------------------------------------------------------------------

Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.

F:\DAVE06DATA\Strtest\Sortbin>maketest

F:\DAVE06DATA\Strtest\Sortbin>ML /nologo -Zi -c -Fl -Sg -coff test.asm
 Assembling: test.asm

MASM : fatal error A1016: Internal error

  Version 8.00.50727.104

  ExceptionCode            = C0000005
  ExceptionFlags           = 00000000
  ExceptionAddress         = 0041B196 (00400000) "F:\DAVE06DATA\Strtest\Sortbin\ml.exe"
  NumberParameters         = 00000002
  ExceptionInformation[ 0] = 00000000
  ExceptionInformation[ 1] = 00000024

CONTEXT:
  Eax    = 00001800  Esp    = 0012F8A4
  Ebx    = 00001800  Ebp    = 00000000
  Ecx    = 0035802C  Esi    = 00358060
  Edx    = 00000000  Edi    = 00000000
  Eip    = 0041B196  EFlags = 00010246
  SegCs  = 0000001B  SegDs  = 00000023
  SegSs  = 00000023  SegEs  = 00000023
  SegFs  = 0000003B  SegGs  = 00000000
  Dr0    = 00000000  Dr3    = 00000000
  Dr1    = 00000000  Dr6    = 00000000
  Dr2    = 00000000  Dr7    = 00000000

F:\DAVE06DATA\Strtest\Sortbin>if errorlevel 1 goto terminate

F:\DAVE06DATA\Strtest\Sortbin>LINK32 /nologo test.obj kernel32.lib /SUBSYSTEM:CONSOLE /DEBUG /MAP /OUT:test.exe
test.obj : fatal error LNK1136: invalid or corrupt file

F:\DAVE06DATA\Strtest\Sortbin>if errorLevel 1 goto terminate
F:\DAVE06DATA\Strtest\Sortbin>

-------------------------------------------------------------------------------
The failing statement is:
-------------------------------------------------------------------------------

    INVOKE Calc,OFFSET [esi+REC_PTRS]

-------------------------------------------------------------------------------
at least MASM indicated the failing line number - line 32.

Yes, I know, it is totally bad code, but should NOT cause a MASM crash.

the code should be:

    mov    ebx,esi
    add    ebx,REC_PTRS
    INVOKE Calc,ebx
-------------------------------------------------------------------------------

Sign in to post a comment.
Posted by gel on 8/17/2008 at 12:47 PM
Keeping_Real_Busy,

MASM 9.0 is included in Visual C++ 2008 SP1 Express Edition.

Posted by Keeping_Real_Busy on 8/5/2008 at 11:20 AM
Would it do any good to ask why MASM 9.0 has not been made available for download. I reported problems last year (yes, 12 months ago) with the missing MASM 9.0 (32 bit version) in ORCAS BETA2. "They" said the problem would be corrected for the final release. I have checked back periodically, but Microsoft has not offered MASM 9.0 for download. It has been a year! MASM 8.0 has a problem that I reported and was told that it did not occur in ORCAS BETA2 and I would like a fix. WHEN???
Posted by Microsoft on 7/30/2008 at 10:58 AM
One more thing. We should be setting the return code from ml.exe to a non-zero value if there is an internal assembler error. We'll add this to the fixes to be considered for the next release.
Posted by Microsoft on 7/29/2008 at 3:31 PM
Thanks for contacting Microsoft and reporting this issue.

This is basically an access violation in the MASM expression evaluator. This also fails with ML.EXE 9.00.21022.08 (VS2008), which is the latest release, as well as our current source. And be aware that the upcoming SP1 release of VS2008 will still have the problem.

The repro case can be as simple as:

;ml -c t.asm
.386
.MODEL flat
.code
mov eax, OFFSET [esi+1]
END

I'm glad you were able to identify the source line that triggered the problem. And, yes, correcting the source is the right thing to do but you are also correct that we should more elegantly deal with the issue. We'll consider this for the next release of MASM.

Thank you,
Visual Studio Product Team
Posted by Microsoft on 7/17/2008 at 12:01 AM
Thanks for your feedback. We are escalating this bug to the product unit who works on that specific feature area. The team will review this issue and make a decision on whether they will fix it or not for the next release.

Thank you,
Visual Studio Product Team