Author Topic: bug?  (Read 1384 times)

jimg

  • Member
  • ***
  • Posts: 251
bug?
« on: May 31, 2017, 03:47:34 PM »
Assembling the following seems to make uasm and hjwasm crash.
Code: [Select]
.686
.model Flat, Stdcall
option Casemap :None   ; case sensitive

.data
 db 1
LastBit  equ $

.code
Program:
ret
end Program

It works ok in jwasm and ml615.

jj2007

  • Member
  • *****
  • Posts: 8339
  • Assembler is fun ;-)
    • MasmBasic
Re: bug?
« Reply #1 on: May 31, 2017, 05:36:39 PM »
Interesting, but:
Code: [Select]
*** Assemble using \masm32\bin\Hasm32 /c /coff  tmp_file.asm ***
Hasm v2.32, May 16 2017, Masm-compatible assembler.
Portions Copyright (c) 1992-2002 Sybase, Inc. All Rights Reserved.
Source code is available under the Sybase Open Watcom Public License.

Tmp_File.asm: 12 lines, 2 passes, 0 ms, 0 warnings, 0 errors

Which version did you use? What kind of errors?

aw27

  • Member
  • *****
  • Posts: 1202
  • Let's Make ASM Great Again!
Re: bug?
« Reply #2 on: May 31, 2017, 06:32:27 PM »
Assembling the following seems to make uasm and hjwasm crash.
Code: [Select]
.686
.model Flat, Stdcall
option Casemap :None   ; case sensitive

.data
 db 1
LastBit  equ $

.code
Program:
ret
end Program

It works ok in jwasm and ml615.

Builds fine with uasm 2.34 but triggers antivirus. Runs fine after setting an exception.

jimg

  • Member
  • ***
  • Posts: 251
Re: bug?
« Reply #3 on: June 01, 2017, 12:10:11 AM »
crashes using version 2.34 of uasm32, test also failed with v2.16 of hjwasm, doesn't crash with uasm64-
Through process of elimination, I've narrowed it down to the -Fl option.
Compile like this:

uasm32 -c -Fl test.asm

jj2007

  • Member
  • *****
  • Posts: 8339
  • Assembler is fun ;-)
    • MasmBasic
Re: bug?
« Reply #4 on: June 01, 2017, 04:22:23 AM »
Confirmed: It's /Fl, and only the 32-bit version crashes.

johnsa

  • Member
  • ****
  • Posts: 676
    • Uasm
Re: bug?
« Reply #5 on: June 02, 2017, 04:23:52 AM »
Hi,

This has been fixed in 2.35 and will be available shortly.

Cheers
John

johnsa

  • Member
  • ****
  • Posts: 676
    • Uasm
Re: bug?
« Reply #6 on: June 02, 2017, 08:09:31 PM »
The problem is the following piece of code in listing.c

  sprintf( &ll.buffer[idx+2], "%-" PREFFMTSTR I32_SPEC "X", sym->value );

idx = 10 in the case of LastBit  equ $ and PREFMTSTR = 25 in Jwasm up.. which causes a stack over-write as the buffer is only 32 in size. I've fixed this by reducing the size from 25 to 20.
I can see why this doesn't work, but I cannot figure why it would have ever worked in jwasm! it must have been blind luck :)

Nidud you may want to check this on your side as well?

John

jimg

  • Member
  • ***
  • Posts: 251
Re: bug?
« Reply #7 on: June 02, 2017, 10:52:24 PM »
Probably not the last snafu.   I just had to update an app that's been running properly for ten years, up until the last windows 10 update.  (I neglected to clear the carry flag in one place.  Apparently the windows api preceding it always returned with the carry clear until the last update.)

Any idea when it will be updated on the uasm site?  It's still showing 2.34

johnsa

  • Member
  • ****
  • Posts: 676
    • Uasm
Re: bug?
« Reply #8 on: June 02, 2017, 11:01:46 PM »
I've put a pre - release out for final testing, you can grab it here so-long if you like :
http://www.terraspace.co.uk/uasm.zip

Just want to make sure that we've covered as many possible testing angles as possible before release as the changes were quite massive.

jimg

  • Member
  • ***
  • Posts: 251
Re: bug?
« Reply #9 on: June 03, 2017, 12:05:04 AM »
Thanks :biggrin:

I have another bug I'll post as a separate thread.