[Nasm-bugs] [Bug 3392438] spurious "assertion output_ins.times >= 0 failed" in a certain file

no-reply at bugzilla-nasm.gorcunov.org no-reply at bugzilla-nasm.gorcunov.org
Tue Sep 12 12:20:23 PDT 2017


https://bugzilla.nasm.us/show_bug.cgi?id=3392438

C. Masloch <pushbx at 38.de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |pushbx at 38.de

--- Comment #1 from C. Masloch <pushbx at 38.de> ---
I've prepared a simpler test case. I'm suspecting that the panic is caused by
an early pass when it assembles things in a way that the TIMES value would be
negative; eg jumps at first are assembled as near jumps.

$ nasm -v
NASM version 2.14rc0-20170624 compiled on Jun 24 2017
$ echo -ne 'org 0\nstart:\ntimes (508 / 2) jmp fill\nfill:\n%assign i
$-$$\n%fatal i\ntimes 508-(fill-start) nop\ndd 0_AA55_0000h\n' > nasmbug.asm
$ nasm -Ox nasmbug.asm -l nasmbug.lst -o nasmbug.bin
nasmbug.asm:6: fatal: 508
$ nasm nasmbug.asm -l nasmbug.lst -o nasmbug.bin
nasmbug.asm:6: fatal: 508
$ echo -ne 'org 0\nstart:\ntimes (508 / 2) jmp fill\nfill:\n%assign i
$-$$\n;%fatal i\ntimes 508-(fill-start) nop\ndd 0_AA55_0000h\n' > nasmbug.asm
$ nasm -Ox nasmbug.asm -l nasmbug.lst -o nasmbug.bin
nasmbug.asm:7: panic: assertion output_ins.times >= 0 failed at asm/nasm.c:1342
$ nasm nasmbug.asm -l nasmbug.lst -o nasmbug.bin
nasmbug.asm:7: panic: assertion output_ins.times >= 0 failed at asm/nasm.c:1342
$ nasm -O0 nasmbug.asm -l nasmbug.lst -o nasmbug.bin
nasmbug.asm:7: panic: assertion output_ins.times >= 0 failed at asm/nasm.c:1342
$ echo -ne 'org 0\nstart:\ntimes (500 / 2) jmp fill\nfill:\n%assign i
$-$$\n;%fatal i\ntimes 508-(fill-start) nop\ndd 0_AA55_0000h\n' > nasmbug.asm
$ nasm -Ox nasmbug.asm -l nasmbug.lst -o nasmbug.bin
nasmbug.asm:7: panic: assertion output_ins.times >= 0 failed at asm/nasm.c:1342
$ echo -ne 'org 0\nstart:\ntimes (500 / 2) jmp fill\nfill:\n%assign i
$-$$\n%fatal i\ntimes 508-(fill-start) nop\ndd 0_AA55_0000h\n' > nasmbug.asm
$ nasm -Ox nasmbug.asm -l nasmbug.lst -o nasmbug.bin
nasmbug.asm:6: fatal: 500
$ 

(Attempts with shorter test cases (ie not 512 bytes of output) have failed as
yet. Not sure why.)

-- 
You are receiving this mail because:
You are on the CC list for the bug.
You are watching all bug changes.


More information about the Nasm-bugs mailing list